Skip to content

Worker: stack on an open series part or the PR that adds a named file - #416

Merged
nambok merged 1 commit into
mainfrom
worker/stack-series-and-named-files
Nov 3, 2026
Merged

nambok merged 1 commit into
mainfrom
worker/stack-series-and-named-files

Conversation

@nambok

@nambok nambok commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

A ticket titled as part 2 of a series named a file that only part 1's open pull request adds. Dependency detection only read lines saying "depends on" and the like, so the run started its branch from the default branch. The coder then copied part 1's files in with restore_file from part 1's branch. The check before opening the pull request found the re-created commits, rebasing onto part 1 didn't apply cleanly, and the run failed.

Changes

  • stack.rs: dependency detection, deterministic and in code, in this order:
    1. the ticket names an open pull request or ticket key in a dependency line (unchanged);
    2. series: a title with [Name n/m] stacks on the latest earlier part (same name and total) that still has an open pull request;
    3. named files: a path the ticket names that the base branch lacks, added by exactly one open pull request, stacks on that pull request. A tie means no guess.
  • Only open pull requests are picked, so a part whose dependency already merged starts from the default branch. A dependency that merges later is handled by GitHub moving the stacked pull request's base, as the stack section already states.
  • restore_file (implement and feedback passes) restores only from the pull request's base or a commit SHA. Another branch is refused, with the reason and what to do instead, and the tool descriptions say so.

Verification

  • New tests: series parsing; the latest open earlier part (and none when it merged, or for part 1); path extraction; the one pull request adding a missing file (and a tie, and nothing missing); restore_file sources; a correctly stacked branch copies nothing while copied commits still match.
  • cargo fmt --check, cargo clippy -p worker --all-targets -D warnings, and cargo test -p worker: 1,159 passed, 0 failed.

…; never restore from another branch

A ticket titled as part 2 of a series named a file only part 1's open pull
request adds. Dependency detection read only lines that say "depends on",
so the run started from the default branch, then copied part 1's files in
with restore_file from part 1's branch. The guard before the pull request
caught the copied commits and the run failed.

- A title like [Name 2/4] stacks on the latest earlier part of the same
  series that still has an open pull request.
- A file the ticket names that the base lacks, added by exactly one open
  pull request, stacks on that pull request.
- restore_file restores only from the pull request's base or a commit SHA;
  another branch is refused with the reason.
@nambok
nambok merged commit a37acbf into main Nov 3, 2026
9 checks passed
@nambok
nambok deleted the worker/stack-series-and-named-files branch November 3, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant