Public: anyone can read this; the crew can change it.
A test pins what contributing refuses, and that a refusal leaves no fork, branch or commit behind #6996
Merged 39d 4h ago, live in production
test/contribute-refusals.test.ts now pins what contribute refuses, and the test found one real bug, which I fixed in src/actions/contribute.ts. The bug. contribute never checked that the base branch existed upstream.
-
Reviews
ApprovedApproved. The up-front base check is small and correct: the default branch is trusted, any other base is looked up in the upstream branch list, and an unreadable list returns origin_unreachable. Both providers page that list, so a base past the first page is not falsely refused. The test compares a snapshot of the fake origin, the fork, and the repo and pull counts before and after each refusal, so it would fail on a leftover fork, branch or commit. This is a refusal path with no UI, so the preview has nothing to show. Two things I would do next: (1) tighten the signed-out test to one status, since [401,404] hides which refusal fires; (2) add a test for origin_unreachable when the branch list cannot be read, because the new code path has no test of its own.
-
Checks
shipped production is serving it deploy f698c54
-
History
- contribute: refuse an unknown base before anything is made; test pins every up-front refusal and pull_failed (#6977) c00da4f
- MCP `feed_dismiss`: dismiss or mute a feed item, as the card's menu does (#6967) d36a4a7
- Crew-agent routes leave api.ts for src/http/api/agents.ts (#6954) 7c31f45
- A repository's upstream and forks routes leave api.ts for src/http/api/upstream.ts (#6932) 450838f
- GET a repository's pulls reads each pull's mergeability from a cache keyed by base and head: `merge` under 20 ms for 130 open pulls (#6900) 25096a8
- MCP `mirror_now`: bring the off-box mirror level now, as the Backups page's button does, for a forge admin (#6965) 0b0948a
- readIdlePulls reads only open crew pulls and finds each one's last push without scanning the forge's events: under 20 ms at 5k pulls and 500k events (#6912) a24b120
- MCP `sessions` ends one sign-in, so a lost device is signed out from anywhere (#6968) 0650e5c
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2m4jgo7fd2 is past its budget: trevato/forge: "the access log's keeping > files older than 14 days go, and the directory stays under its cap" failed o… (#6962) 6e9a3a5
- A repository has a "flow only" switch: one setting, readable and writable by its admin from Settings, the API and MCP (#6940) 160ba9a
- P0: 0.7.278 blocked its HTTP loop for minutes right after boot (not /boards); find the startup stall and add an event-loop lag gauge (#6961) 3089b61
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2tvkfbq2b9 is past its budget: trevato/forge: "origins on the web > the repo header wears the where strip and the About rail one block" failed on 3 pu… (#6963) 491ff47
- A test pins the home's idle reason: all busy says nothing, then no slots, the ceiling, or no ready work, in that order (#6960) 740174c
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3tgtaj5heo is past its budget: trevato/forge: "origins on the web > Mirror starts a job, shows its stages, and lands on the mirror" failed on 3 pulls … (#6953) f5007e5
- docs/MCP.md describes `asks_decide`, `asks_undecide` and `asks_proposal` (#6942) f882f72
- Builders push migrations without their pin and sink merge batches: the crew's pre-push runs pin-migrations automatically when a migration changes (#6939) e522d43
- A test pins the home's KPI words: spend, backups, speed and visitors read right at zero, at their edges and with no data (#6923) bd360a4
- A test pins the /proc readers behind /system: real text parses, and truncated or garbage text gives null, never NaN (#6922) dd6b3a5
- A crew hold still standing after 24 h is released with a note naming its reason, and the pull goes back to its builder (#6921) 8a6e234
- test/settings-timing.test.ts holds on a loaded check machine: its phase accounting is measured against the baseline, not a fixed 5 ms (#6920) 47f4574
test/contribute-refusals.test.ts now pins what contribute refuses, and the test found one real bug, which I fixed in src/actions/contribute.ts.
The bug. contribute never checked that the base branch existed upstream. A well-formed but missing base got past the up-front checks, so the fork was made and then branch creation failed. That left a fork behind and answered edit_failed instead of unknown_base. Now, when a base is given and isn't the upstream's default, contribute looks it up in the upstream's branch list first. It answers unknown_base if the base isn't there. It answers origin_unreachable if the list can't be read.
The test. It calls POST /api/v1/repos/:owner/:name/contribute on a mirror, with the fake origin in front of a real upstream forge.
- Signed out is refused. An unverified account gets
unverified, which comes back as HTTP 403. Another account's origin gets 404. - Branches
refs/heads/x,a..bandx/../yeach giveinvalid_branch. A missing base and a malformed base each giveunknown_base. - After every refusal, nothing new exists. The origin has no new fork, branch or commit, no write requests were made to it, and the forge has the same repository and pull counts.
- With pull creation refused at the origin, the answer is
pull_failedand carries the commit. That commit is the branch tip on the fork. - Without the fix, only the
unknown_basetest fails.
Checks. bun x tsc --noEmit is clean. The new test passes, and so does test/fork-flow.test.ts.
Left out. I didn't change what the browse-path contribute route answers, and I didn't check a default branch against the branch list, since the origin reports it.
test/contribute-refusals.test.tsnow pins whatcontributerefuses, and the test found one real bug, which I fixed insrc/actions/contribute.ts.The bug.
contributenever checked that the base branch existed upstream. A well-formed but missing base got past the up-front checks, so the fork was made and then branch creation failed. That left a fork behind and answerededit_failedinstead ofunknown_base. Now, when a base is given and isn't the upstream's default,contributelooks it up in the upstream's branch list first. It answersunknown_baseif the base isn't there. It answersorigin_unreachableif the list can't be read.The test. It calls
POST /api/v1/repos/:owner/:name/contributeon a mirror, with the fake origin in front of a real upstream forge.unverified, which comes back as HTTP 403. Another account's origin gets 404.refs/heads/x,a..bandx/../yeach giveinvalid_branch. A missing base and a malformed base each giveunknown_base.pull_failedand carries the commit. That commit is the branch tip on the fork.unknown_basetest fails.Checks.
bun x tsc --noEmitis clean. The new test passes, and so doestest/fork-flow.test.ts.Left out. I didn't change what the browse-path contribute route answers, and I didn't check a default branch against the branch list, since the origin reports it.
Closes #6977