Repository navigation
Fix(forks): Warn on a fork still being created - #236
ModeSevenIndustrialSolutions merged 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Fork polling incorrectly treats HTTP 410 Gone as a pending fork, allowing a genuine read failure to produce only a warning and exit successfully instead of failing.
1 open issue
What changed in this PR
This PR addresses #219 by treating accepted fork requests that remain invisible after the preparation deadline as warnings, allowing later publishing to check them again.
Changes:
- Adds a distinct pending-fork outcome without changing the one-minute deadline.
- Updates missing-fork guidance and design documentation.
- Adds tests for delayed visibility and continued failure handling.
| File | Description |
|---|---|
tests/test_fork_publish.py |
Checks that missing-fork guidance mentions delayed visibility. |
tests/test_fork_pool.py |
Tests warning outcomes and preservation of failure cases. |
scripts/fork_pool.py |
Adds NotYetVisible handling and warning summary rows. |
scripts/branch_refs.py |
Explains that a missing fork may still be creating. |
docs/DESIGN.md |
Documents the shared deadline and warning behavior. |
Review effort: Balanced
5626de7 to
d1d0acf
Compare
A fork GitHub accepted but has not shown within the forks job's deadline should warn rather than fail that job, since the publish job reads the fork again much later. Pin that, keep a refused request and a repository that is not the target's fork failing the job, and pin the publish job's missing fork reason naming both causes. The new behaviour tests carry expectedFailure until the fix lands. Issue: lfreleng-actions#219 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
The forks job waits one minute for every fork it requested, and a fork still absent then failed its target and the job. GitHub can take longer to fork a large repository, while the publish job, which runs after the author session, reads the fork again and succeeds, so a red forks job needed no action. A fork still answering 404 at the deadline after a request GitHub accepted now raises NotYetVisible, which the job records as "requested; not yet visible" with a warning and without failing. A refused request, a failed rename, any other read error while polling and a repository that is not the target's fork still fail. The publish job's missing fork reason gains a sentence naming both causes, since passing the forks job's outcome to it would need a workflow change. Review round 1: Copilot noted that is_absent() accepts 410 as well as 404, so a 410 while polling became a pending fork. Polling now treats only 404 as a fork still being made; a 410 Gone fails the target at once, and a test pins it beside the 500 case. Review round 2: Copilot noted that a fork renamed with no fork request behind it, still 404 at the deadline became a pending fork and let the job pass. Pending now records whether GitHub accepted a request; finish() fails a rename-only fork still absent then, and a test pins a successful rename followed by 404s to the deadline. Issue: lfreleng-actions#219 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
d1d0acf to
0b673b0
Compare
There was a problem hiding this comment.
🤖 Antagonistic review by agent: no line-level findings; the summary below is the verdict.
No actionable defects found. The change limits timeout warnings to accepted fork requests, preserves failures for rename-only timeouts and other polling errors, and retains independent fork validation before publishing.
Antagonistic round 1 of 3.
Automated antagonistic review by lf-releng-antagonistic-review-bot[bot] using model gpt-6-astra; see the run. This is not a human review and never an approval: a maintainer must still review and approve this pull request.
9cf16b8
into
lfreleng-actions:main

Closes #219
Authored by an AI agent; human review required
claude-opus-5.5via GitHub Copilot CLI0275c0bc11b5958c06b72f4be1e2f8adfd934d8bAISLOP_NO_TELEMETRY=1 prek run --files docs/DESIGN.md scripts/branch_refs.py scripts/fork_pool.py tests/test_fork_pool.py tests/test_fork_publish.py # before rewording DESIGN.md: write-good flagged 'uv run python -B -m unittest discover -s testsuvx gitlint --msg-filename /tmp/lastmsgAISLOP_NO_TELEMETRY=1 prek run --files docs/DESIGN.md scripts/branch_refs.py scripts/fork_pool.py tests/test_fork_pool.py tests/test_fork_publish.pyThe
github-code-monkey-botworkflow opened this pull request.Nobody has merged it; a maintainer must review it first.
Review findings on this pull request are answered by a later revision round of this workflow, up to ten rounds per antagonistic review round; after that a maintainer, or the next antagonistic review, takes on any finding that remains, and a maintainer reviews every round before merge.
Round 2 of revision, on its base.
Closes #219.
What this does
The Prepare forks job waits one shared minute for the forks it requested. A fork still answering 404 at that deadline, after a fork request GitHub accepted, is now recorded as
requested; not yet visiblewith a::warning. It no longer fails the job, because the publish job reads the fork again later. Everything else still fails: a refused request, a failed rename, a repository that is not the target's fork, a fork that appears but is not the target's fork, any non-404 read error while polling (410 Gone included), and, as of this round, a fork that was only renamed and is still absent at the deadline.missing_forknow has a sentence naming both causes.FORK_WAIT_SECONDSis unchanged.Commits:
Test(forks): Add expected-fail slow fork tests: tests first, marked expected-fail.Fix(forks): Warn on a fork still being created: the fix and doc update, with the markers removed.This round
Copilot pointed out that a fork found under an old name and renamed, with no
create_fork()call, could time out asrequested; not yet visibleand exit 0.Pendingnow has arequestedflag.finish()raisesPublishErrorfor a rename-only fork still absent at the deadline.test_renamed_fork_still_absent_at_the_deadline_failscovers this case, and it fails without the fix.docs/DESIGN.mdnow says the same. I amended the fix commit and left the tests commit unchanged. The branch was not rebased.Checks run
uv run python -B -m unittest discover -s tests: 1740 tests, OKprek run --files <the five changed files>(includes aislop): exit 0gitlinton the amended message: exit 0For the reviewer
Check that a fork created and then renamed (
created as X, then renamed) should count as requested. It does here, because GitHub accepted the fork request.