Skip to content

Fix(forks): Warn on a fork still being created - #236

Merged
ModeSevenIndustrialSolutions merged 2 commits into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-219
Nov 23, 2026
Merged

ModeSevenIndustrialSolutions merged 2 commits into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-219

Conversation

@lf-releng-code-monkey-bot

@lf-releng-code-monkey-bot lf-releng-code-monkey-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #219

Authored by an AI agent; human review required
Command Exit
AISLOP_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 ' 1
uv run python -B -m unittest discover -s tests 0
uvx gitlint --msg-filename /tmp/lastmsg 0
AISLOP_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 0

The github-code-monkey-bot workflow 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 visible with 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_fork now has a sentence naming both causes. FORK_WAIT_SECONDS is unchanged.

Commits:

  1. Test(forks): Add expected-fail slow fork tests: tests first, marked expected-fail.
  2. 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 as requested; not yet visible and exit 0. Pending now has a requested flag. finish() raises PublishError for a rename-only fork still absent at the deadline. test_renamed_fork_still_absent_at_the_deadline_fails covers this case, and it fails without the fix. docs/DESIGN.md now 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, OK
  • prek run --files <the five changed files> (includes aislop): exit 0
  • gitlint on the amended message: exit 0

For 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread scripts/fork_pool.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Rename-only fork timeouts can incorrectly exit successfully despite no accepted creation request; the handler must distinguish these outcomes and add regression coverage.

1 open issue

Review effort: Balanced

Comment thread scripts/fork_pool.py Resolved
lf-releng-code-monkey-bot Bot and others added 2 commits November 23, 2026 14:41
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change that treats accepted but delayed fork creation as a warning.

No open issues 🎉

Review effort: Balanced

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 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.

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit 9cf16b8 into lfreleng-actions:main Nov 23, 2026
36 checks passed
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions deleted the code-monkey/issue-219 branch November 23, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix(forks): Warn on a fork still being created

2 participants