Review on diff lines and explain merge blockers before merging #283
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/spec-parity-pr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two pull-requests requirements of the fjord-client-spec (#213).
Inline review comments. `fj pr review N --line-comment
` is repeatable, and `--line-comments-file` takes the same as a JSON array. LINE is `N` or `new:N` for the PR's version of the file and `old:N` for a removed line. Comments given with --event are batched into that review in one request; without --event they post as a plain comment review. Each anchor is checked against the PR diff first, so a line that is not commentable is refused locally with the commentable lines named. Only single-line anchors are supported: range fields are rejected, which is also what Gitea needs.--event commentwith nothing to say and--event request-changeswithno body now fail locally instead of as a server 422.
Merge preflight.
fj pr mergeused to explain a blocked merge onlyafter the server refused it, and through the admin-only branch
protection endpoint. It now reads the base branch's effective protection
from GET /branches/{branch}, which needs read access only, before the
POST. A certain blocker (a required check failing, pending or not
reported, a missing required approval, no merge permission) stops the
merge with the reason and, for checks still running, a pointer to
--auto. Evidence that could not be read stays "unknown": it never blocks
and never reads as passing, and the server decides.
fj pr checksshows the same verdict, gains a REQUIRED column, andlists required checks that have not reported. Its --json is additive:
requiredper status,statuses_completeandmerge_preflight.Covered by unit and wiremock tests only; the preflight was not run against a live protected branch.
fj pr checksgains aREQUIREDcolumn, which shifts the table for anything parsing it.Part 6 of 8 in the spec-parity stack. Based on
feat/spec-parity-org, so the diff here is this slice alone; it needs a rebase onto main once the PR below it is squash-merged.Closes #213
Verified on macOS at this commit:
cargo fmt --allclean,cargo clippy --all-targets --all-features -- -D warningsclean,cargo test --allgreen.Four fjord-client-spec requirements: ssh-gpg-keys (commit signature state), code-browsing (tags and browsing a tag ref), actions-ci (Actions variables) and labels (organization labels and exclusive groups). `fj repo commit list|view` read history at --ref, --branch or --tag and show each commit's signature state from the `verification` object: verified with the signer, or nothing when the commit is unsigned. The SIGNATURE column is dropped when no commit reports one. `fj repo contents [PATH]` reads a file or directory at a ref. A tag is pinned to its commit and labelled read-only. `fj browse --tag` opens the tag route. `fj label list|create|edit|delete --org ORG` work on organization labels, with --exclusive and --no-exclusive for `group/name` labels. Assigning labels on issue and pr create or edit now falls back to the org's labels for names the repository does not have, and when an exclusive label displaces a sibling the message is taken from the set the forge confirms. `fj label create` and `fj label edit` panicked at parse time on main, with or without the flag: their `--color` shared an arg id with the global ANSI `--color`. The label flag is now `--label-color`. `fj variable set` could not create a variable (PUT only) and a non-empty `fj variable list` failed to decode, because the model required a `created_at` the API does not send. `set` now reads, then PUTs or POSTs, then confirms. The list table is NAME / VALUE / SCOPE and its JSON follows the ActionVariable shape. Variable values no longer reach --debug output. Covered by unit and wiremock tests only. Two things deserve a live check. The `variable list` model was rewritten to the swagger `ActionVariable` shape, and the test `list_variables_parses_live_bare_array` was rewritten with it, so the claim that the old shape never decoded rests on the swagger document and not on a recorded response. And `--color` to `--label-color` on `label create|edit` is a flag rename, though the old spelling could not be used: both commands panic at `src/cli/mod.rs:105` on main ("Mismatch between definition and access of `color`"). Part 7 of 8 in the spec-parity stack. Based on `feat/spec-parity-pr`, so the diff here is this slice alone; it needs a rebase onto main once the PR below it is squash-merged. Verified on macOS at this commit: `cargo fmt --all` clean, `cargo clippy --all-targets --all-features -- -D warnings` clean, `cargo test --all` green. Reviewed-on: #284