Skip to content

Add --resume to populate-term-board and tolerate board auto-add races - #2130

Merged
nate-double-u merged 5 commits into
cncf:mainfrom
nate-double-u:populate-term-board-resume
Aug 25, 2026
Merged

nate-double-u merged 5 commits into
cncf:mainfrom
nate-double-u:populate-term-board-resume

Conversation

@nate-double-u

Copy link
Copy Markdown
Member

Dogfooding populate-term-board.js on the real 2027 Term 1 setup surfaced two failure modes; this hardens both.

What happened

Populating board 98 failed at issue 35 of 62: the board (copied from the 2026 Term 3 board) carried over the enabled "Auto-add sub-issues to project" built-in workflow, which added the freshly nested issue to the board before the tool's own add, failing the run with Content already exists in this project.

Changes

  • Tolerate board auto-add races: when the board add reports the content already exists, recover the existing card's item id (via the issue's projectItems) and continue - a lost race is no longer a failed run
  • --resume flag: continue an interrupted run from its manifest - recorded issues are skipped, the last recorded one is re-verified idempotently (nest, board card, fields - the crash window), and the rest are created as usual; refuses to resume if the plan no longer matches the manifest
  • ADMIN_GUIDE: document the copied-board workflow carry-over and the double-run guard's sensitivity to hand-labelled issues (e.g. the term's scheduling issue carrying all four admin labels)
  • terms/2027-t1.yml: record the repo and project board URL used for the populate run

Verified in production: --resume completed the interrupted 2027 Term 1 run (27 created, 1 re-verified, 62 total on the board). Tests: 603 pass.

A board copied from a previous term can carry enabled built-in
workflows; "Auto-add sub-issues to project" races the tool's own board
adds and failed a mid-run production populate. Recover the existing
board item when an add reports the content already exists, and add a
--resume flag that continues an interrupted run from its manifest:
recorded issues are skipped, the last recorded one is re-verified
(nest, board card, fields), and the rest are created as usual.

Assisted-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Nate W <natew@cncf.io>
Add the repo and project board URL used to populate the term admin
board, so the config documents where the term's issues live.

Assisted-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Nate W <natew@cncf.io>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds resumable board population and recovery from project auto-add races.

Changes:

  • Adds --resume with manifest-based recovery.
  • Recovers existing project item IDs after auto-add races.
  • Updates tests, documentation, and 2027 Term 1 configuration.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ADMIN_GUIDE.md Documents resume behavior and board workflow caveats.
bin/populate-term-board.js Implements --resume orchestration.
lib/gh-client.js Adds issue lookup and board-race recovery.
lib/populate.js Adds manifest-driven resume logic.
terms/2027-t1.yml Records repository and project board.
test/gh-client.test.js Tests client recovery and lookup methods.
test/populate.test.js Tests resume scenarios and summaries.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Address review feedback: the resume path matched manifest records to plan
items by title alone, so a reordered parent, changed schedule_key, or
edited schedule date could pass verification and mix old and new plans.

Record parentNumber, scheduleKey, start, and due with each created issue
and verify all of them against the current plan on resume, refusing with
a field-specific message on any mismatch. Records without these fields
(manifests from earlier runs) skip the extra checks and remain valid.

Recording moves from the bin's client wrapper into populateTerm via an
onCreated callback, still invoked the instant an issue is created so a
later crash cannot lose it. Pre-order is now checked before creating an
issue, so a malformed plan no longer creates an orphan first.

Also note in the admin guide that copying a project board does not carry
its repository links, so a new board must be linked to appear on the
repo's Projects tab.

Assisted-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Nate W <natew@cncf.io>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

programs/lfx-mentorship/automation/lib/populate.js:76

  • The compatibility check only covers records already in the manifest, so edits to the unrecorded suffix are invisible. After an interruption, changing the next issue's title, schedule_key, parent, or adding/removing later issues still resumes and creates the revised plan, despite the stated guarantee that a changed plan is rejected. Persist a fingerprint of the complete plan and resolved schedule before creation starts, then compare it before skipping any records.
  completed.forEach((rec, i) => {

Address review feedback on the create/record gap: a create can succeed
remotely while the response is lost or the process dies before the
manifest write, leaving an issue the manifest does not know about. A
resume would then create a duplicate.

Before creating the first unrecorded plan item, resume now queries the
repo for an issue matching it (exact title, the item's full label set,
any state) that is missing from the manifest. If one exists, the run
refuses and prints a ready-to-paste manifest line; appending it makes
the next resume adopt and repair the issue through the existing
re-verification path. Closing the stray instead also works.

Recorded issues and same-titled items elsewhere in the plan are excluded
by number, so in-plan duplicate titles (two Approve stipends items) do
not trip the check. Fresh runs and complete manifests skip it entirely.

Also reword the resume guarantees where they overclaimed: the recorded
prefix is verified field-by-field, while unrecorded items are created
from the current files exactly as a fresh run would, so editing
not-yet-created issues between runs is allowed by design.

Assisted-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Nate W <natew@cncf.io>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Address review feedback: the gap check queried state=all, but its own
recovery instruction is to close the stray issue and re-run, which would
have matched the closed issue again and refused forever. Search open
issues only, so closing a stray actually clears the check. A closed bare
stray has no nesting or board card and is harmless residue.

Assisted-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Nate W <natew@cncf.io>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (1)

programs/lfx-mentorship/automation/lib/populate.js:110

  • The create/record gap is still unhandled for the first plan item. If GitHub creates item 0 but its response is lost (or the first manifest append fails), completed is empty, so this reconciliation is skipped; the CLI also rejects --resume when the manifest is absent or empty. A normal rerun then hits the double-run guard, while --force creates a duplicate. Pass an explicit resume intent, allow an empty manifest/marker, and run this stray check against plan[0] in that case.
  if (completed.length > 0 && completed.length < plan.length) {

@nate-double-u
nate-double-u merged commit 55e151b into cncf:main Aug 25, 2026
3 checks passed
@nate-double-u
nate-double-u deleted the populate-term-board-resume branch August 25, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

2 participants