Skip to content

feat(labs): port an aztec-packages PR to aztec-node with scripts/labs_port_pr.sh - #25346

Open
ludamad wants to merge 6 commits into
ad/upstream-batchesfrom
ad/labs-port-pr
Open

feat(labs): port an aztec-packages PR to aztec-node with scripts/labs_port_pr.sh#25346
ludamad wants to merge 6 commits into
ad/upstream-batchesfrom
ad/labs-port-pr

Conversation

@ludamad

@ludamad ludamad commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

scripts/labs_port_pr.sh <pr number|url> — the mechanism people asked for to port a PR to aztec-node.

  • Scope check: every path in the PR's diff must be labs-owned — the in-tree layout (yarn-project/, noir-projects/labs/, docs/, playground/, spartan/, aztec-up/, release-image/, labs-aztec-toolchain/; v5 lines and next before the split) or, after the split, only labs-patches/*.patch (whose contents are the port). Anything else, or a mix of the two layouts, is refused with the files listed.
  • Replay: a temporary worktree of aztec-node main in labs/'s repository; git apply --3way with the diff's pre-image blobs copied from this repository, so drifted context is adapted and an already-landed hunk merges as a no-op. Files that still conflict are committed with markers and listed; lines referencing foundation-only paths (noir-projects/fnd, barretenberg/, …) are flagged. Result: branch port/pr-<n>, commit titled like the PR with the (AztecProtocol/aztec-packages#n) suffix aztec-node uses; the push and gh pr create commands are printed, nothing is pushed.
  • Tried on fix(txe): size guard counts runtime JS only, not sourcemaps #24800 against aztec-node main (which already has the hand port Update trees as we generate blocks #96): the code merged as a no-op and the only conflict was the bump-log comment where the human changed dates and numbers.
  • scripts/tests/labs_port_pr_test (offline, --diff/--no-fetch) runs with make labs-patches-tests.
  • Fixes CLAUDE.md: the </git_staging> / <labs_submodule_patches> tags swallowed by chore(labs-patches): upstream command and a tooling reference in CLAUDE.md #25330's rewrite are restored.

Follow-up, not here: a workflow behind the port-to-aztec-node label that runs this and opens the aztec-node PR as AztecBot.

…_port_pr.sh

`scripts/labs_port_pr.sh <pr>` ports one PR to aztec-node: it downloads the
PR's diff, refuses it unless every path is in the labs half of the tree (the
in-tree layout of the v5 lines, or labs-patches/*.patch after the split — a
mixed PR is split by its author, not guessed at), and replays it onto
aztec-node main in a temporary worktree of labs/'s repository with a 3-way
merge. The pre-image blobs are copied over from this repository so the merge
can adapt to context that moved upstream and treat an already-landed hunk as a
no-op; files that still conflict are committed with markers and listed, as
are lines that reference foundation-only paths. The result is a port/pr-<n>
branch titled like the PR with aztec-node's "(AztecProtocol/aztec-packages#n)"
suffix; nothing is pushed.

An offline test (scripts/tests/labs_port_pr_test) runs with the labs-patches
tests. CLAUDE.md and the README describe the flow, and CLAUDE.md gets back the
</git_staging> and <labs_submodule_patches> tags that the earlier tooling
reference rewrite had swallowed.
Also maps in-tree noir-projects/labs/<x> onto aztec-node's noir-projects/<x>
when replaying a port (aztec-node moved noir-projects to its root), with a
lifecycle check.
@ludamad
ludamad changed the base branch from ad/upstream-batches to next September 1, 2026 00:36
@ludamad
ludamad requested a review from charlielye as a code owner September 1, 2026 00:36
@ludamad
ludamad changed the base branch from next to ad/upstream-batches September 1, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant