Repository navigation
Fix archfit status, App detection for other Apps, request without a tracking ref, and the moved-policy record - #71
Merged
Conversation
kong requires a Run method to return error and checks it only when it calls it, so archfit status always exited 2. A test now checks every command's Run signature and --help.
Setup and status matched the check run by the hard-coded slug archfit-review, so a build for another App, such as staging, never saw its check. The slug now comes from setup.InstallURL, which a candidate build sets, and defaults to archfit-review.
…ng ref
A clone made with --single-branch keeps no remote-tracking ref for a branch
pushed with -u, so @{upstream} does not resolve and archfit request told the
author to push again. It now looks up the pull request by the branch's name on
the push remote and posts only when that pull request's head is HEAD. The
no-upstream answer stays for a branch that is not on GitHub.
After an owner's policy change merges into the target branch, a branch made before it got "why: only owners change the policy", which reads as if the author edited the file. When the branch's file is the one at the merge base, the record now says the policy changed on the target branch and that the check uses that policy. A branch that edited the file keeps the old record.
Lint flagged repeated literals, the CLI test's complexity and a Run that always returned nil. The status command now returns a stdout write failure.
…unknown link Review findings: on the local-name fallback a head mismatch advised git push, which fails without an upstream; it now advises git push -u <remote> HEAD. An install link with no App slug fell back to the production App; it now trusts no App.
Review: choosing between git push and git push -u from the upstream config was wrong for a renamed upstream and rewrote a fork's pull upstream. On a head mismatch the next line is now git push <push remote> HEAD:<branch>, which works whatever upstream Git records and changes no configuration.
Review: a short destination is ambiguous when the remote has a tag of the same name, so the hint now names refs/heads/<branch>.
Contributor
✅ Archfit: pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes usability rerun findings N2, N1, N3 and N6. N2 blocks the release, and N1 blocks staging and any App that is not production.
What changes
N2,
archfit statuscrash:StatusCmd.Runreturned nothing, and kong requireserror, soarchfit statusalways exited 2 withreturn value of func(*main.appDeps) must implement "error". It now returns an error, including a failed write to stdout. A new test walks every kong command, checks by reflection thatRunreturns exactlyerror, and runs each command's--help. Running every command for real would push, post or install, so the signature check stands in for that.N1, App detection: setup and status matched the
archfit/gatecheck run by the hard-coded slugarchfit-review. The staging App (archfit-review-staging) was never seen. The slug now comes fromsetup.InstallURL, which a candidate build sets with-X; the default build still readsarchfit-review. An install link with no slug trusts no App. The slug reaches the adapters (setupgit.GitHub.AppSlug, arequestsend.StoryTextparameter) from the cmd composition root, so the adapters import no application package.N3,
archfit requestin a--single-branchclone: a branch pushed with-uhas no remote-tracking ref, so@{upstream}does not resolve, and the request told the author to push again. It now finds the open pull request by the branch's name on the push remote. The name comes frombranch.<b>.mergewhen its remote is the push remote; otherwise it is the local name. It posts only when that pull request's head is HEAD. Otherwise it sends nothing, names both commits, and printsnext: git push <push remote> HEAD:refs/heads/<branch>.cananswer without a pull request still opens an issue.N6, wording: a branch whose
.archfit.yamlis the file at the merge base, after an owner changed the policy on the target, now gets:A branch that edited the file keeps
differs from origin/main/only owners change the policy. The JSONcause,differsandkindare unchanged.Docs:
commands.md(request),results.md,troubleshooting.md,agents.md(policy records), andci.md(a candidate build reads its own App's check).Checks
TestStatusRunsThroughTheCLIandTestEveryCommandRunReturnsError(N2)TestAppCheckIgnoresOtherApps,TestStoryTextReadsOnlyTheBuildsAppandTestAppSlugComesFromTheInstallURL(N1)TestRequestFindsThePullRequestWithoutATrackingRef(real Git in the single-branchpush -ustate) andTestUntrackedBranchFindsItsPullRequest(N3)changecheck(N6)StoryNotUsedIn) runs on the new request errors and policy records.GOWORK=off make allpasses (fmt, names, lint 0 issues, race tests, build,archfit: pass), run withGOFLAGS=-timeout=30mbecause the shared machine is slow.make namesis part of it.archfit can cmd/archfit/status.go internal/application/setupanswers yes.comprehensive(claude ×3 + codex, 4/4 sources) kept 2 minors, both fixed. revmuxfinal(2/2) kept 2 minors on the push hint, fixed by an explicit refspec. A thirdfinalround (2/2) kept 1 minor (a short branch name is ambiguous next to a same-named tag), fixed withHEAD:refs/heads/<branch>.requestsend.Sender.Send/repositoryCRITICAL (the whole request path), so the change keeps the tracked path as it was.detect-changesrated the change high risk. That ran against the main checkout's index, 6 commits stale.language-contractsandtool-locks, because no fixtures, policies, extractors, strength, seams or report changed.Follow-ups (not changed here)
archfit requeststill posts when the pull request head is not local HEAD (unpushed commits).origin/mainbut pushing tofork/featurelooks upfork:main.status: it calls GitHub for every Git checkout; a story from an older pull request head replaces the local verdict; a cached verdict from another commit with the same tree is accepted.changecheck: the moved-policy record treats an empty file like an absent one.make archfitstill accepts exit 2 only forpolicy: differs from origin/main. A local branch behind an owner's policy change now fails it with the merge advice, by design.