Skip to content

Re-seed drifted template stubs to clear template-drift (blocks pr-review auto-merge fleet-wide) #1325

Closed as not planned

Description

@don-petry

Context

The template-drift check is RED on new PRs here (e.g. #1324), because three
seeded template stubs diverge from their standards-derived baseline in
petry-projects/.github:

Stub Cause of drift
.github/workflows/pr-review-mention.yml #1317 renamed the secret in the stub (GH_PAT_WORKFLOWS→GH_PAT_DON_PETRY) but not in the standards source. Fixed upstream by combsmith/.github#791 — MERGE THAT FIRST.
.github/workflows/copilot-setup-steps.yml standards updated upstream; seeded stub is stale.
.github/workflows/sonarcloud.yml standards updated upstream; seeded stub is stale.

Per the canary channel rule, the pr-review agent skips approval on any red CI,
so this one drift stalls dev-lead auto-merge fleet-wide. (Verified: pre-#1317
PR #1292 passes template-drift; post-#1317 PR #1324 fails on exactly these 3.)

Change

Re-seed the drifted stubs from the canonical standards — do not hand-edit the
stubs (the check explicitly forbids it; edit standards/ in .github instead):

scripts/seed-repo-template.sh   # STANDARDS_REPO defaults to petry-projects/.github

Commit the regenerated stubs. Only the three files above should change.

Ordering (hard dependency)

Must land only AFTER combsmith/.github#791 merges. If re-seeded first, the
regenerated pr-review-mention.yml will revert to GH_PAT_WORKFLOWS, undoing the
#1317 rename.

Acceptance criteria

  • template-drift check is GREEN.
  • The diff touches only the three drifted stubs.
  • pr-review-mention.yml retains GH_PAT_DON_PETRY || GH_PAT_WORKFLOWS (confirms
    💡 Agent Pipeline Stall Detector & Automatic Recovery Escalation #791 landed first).
  • Sanity-check the copilot-setup-steps / sonarcloud changes are the intended
    upstream standards updates, not a revert of an intentional local customization.
  • Fails closed: a re-seed that cannot fetch a standard must exit non-zero, never
    emit a partial/green result.

Activity

  1. github-actions commented on Jul 19, 2026

    @github-actions
    Contributor

    Thanks for the thorough write-up and for tracking down the exact ordering constraint — this is a clear and well-scoped report. Before we proceed with the re-seed, could you confirm whether combsmith/.github#791 has already merged? That's the hard prerequisite, and knowing its current status will determine whether we can act on this immediately or need to wait.

  2. added
    dev-leadFor dev-lead agent pickup
    and removed
    dev-leadFor dev-lead agent pickup
    on Jul 19, 2026
  3. don-petry commented on Jul 19, 2026

    @don-petry
    CollaboratorAuthor

    Blocked on a maintainer decision — dev-lead correctly declined to auto-implement.

    dev-lead ran (commit identity resolved to don-petry ✅ — the #1316 fix is live here) and made no changes, with sound reasoning:

    The durable fix is the reverse direction: bring the .github standards (and repo-template's Dependabot config) up to the current pinned checkout versions, so a subsequent re-seed aligns without downgrade. That's an org decision on checkout-version adoption + a cross-repo change, not a blanket re-seed. Removing the dev-lead label to stop no-op re-triggering until the direction is set.

    Note: the identity-fix half this issue was spun off to support is validated independently (dev-lead PR #1324 commits authored by don-petry). This residual template-drift is a pre-existing standards↔stub version skew, not a #1316/#1317 regression.

  4. don-petry commented on Jul 19, 2026

    @don-petry
    CollaboratorAuthor

    Re-scoped prerequisite: combsmith/.github#793.

    Corrected plan after diffing the stubs against standards:

    So once #793 merges, this re-seed becomes safe on all three. I'll re-add the dev-lead label then.

  5. don-petry commented on Jul 19, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead: Investigation complete — re-seed is a cross-repo action with a downgrade caveat (needs go/no-go)

    1. Hard dependency IS satisfied ✅

    #791 is an issue; its implementing PR petry-projects/.github#792 merged 2026-07-19 14:21 UTC. The
    canonical source now emits the retained fallback:

    # standards/workflows/pr-review-mention.yml (main), line 46
    GH_PAT_WORKFLOWS: ${{ secrets.GH_PAT_DON_PETRY || secrets.GH_PAT_WORKFLOWS }}
    

    So re-seeding now will not revert the #1317 rename — the ordering guard is clear.

    2. Drift confirmed (exactly the 3 named stubs)

    bash scripts/template_stub_drift.sh → copilot-setup-steps.yml, pr-review-mention.yml, sonarcloud.yml
    are DRIFTED vs petry-projects/repo-template; every other covered file is ALIGNED.

    3. Sanity-check (acceptance criterion) — a downgrade is hiding in the diff ⚠️

    The seed emission is regenerated from standards/, and standards are behind the template on actions/checkout:

    Stub Re-seed effect
    pr-review-mention.yml Adds GH_PAT_DON_PETRY || GH_PAT_WORKFLOWS — the intended fix ✅
    sonarcloud.yml Adds a genuine "Set up JDK 21" step ✅ but also actions/checkout v7.0.0 → v6.0.3 ⬇️
    copilot-setup-steps.yml Only change is actions/checkout v7.0.0 → v6.0.2 ⬇️ — no forward standards update at all

    repo-template runs its own Dependabot (open PR #62), so the committed v7.0.0 pins are almost certainly
    Dependabot bumps in the template. Re-seeding as-written would silently revert those bumps / downgrade a
    pinned action fleet-wide
    — the "revert of an intentional local change" the acceptance criteria call out.

    4. Structural note — this is a cross-repo write, not an in-repo edit

    template_stub_drift.sh reads committed blobs from petry-projects/repo-template via the contents API.
    No file in .github-private clears this drift; the fix is a re-seed PR against repo-template
    (seed-repo-template.sh → branch + contents PUT + gh pr create), which is outside the dev-lead's
    "don't open PRs / CI handles git" flow (CI here only covers this repo).

    5. Fails-closed — already holds ✅

    seed-repo-template.sh exits non-zero if any standard can't be fetched
    (_emit_workflow/_emit_baseline return 1, propagated by _seed_repo) — no partial/green emission is possible.

    Recommendation

    Do not blindly re-seed — it downgrades actions/checkout in 2 of the 3 stubs. Preferred sequence (no downgrade):

    1. Bump actions/checkout to the v7.0.0 SHA (9c091bb…) in petry-projects/.github
      standards/workflows/{copilot-setup-steps,sonarcloud}.yml, and merge.
      → copilot-setup-steps.yml drift then clears with no template change; sonarcloud.yml keeps v7.0.0 and
      only gains JDK-21.
    2. Then re-seed repo-template (bash scripts/seed-repo-template.sh) so pr-review-mention.yml gains the
      secret fallback and sonarcloud.yml gains JDK-21 — all forward, zero downgrade.

    Alternative (as literally worded in this issue): re-seed now and accept the v7→v6 checkout downgrade as
    "standards is canonical". This unblocks the fleet immediately but reverts the template's Dependabot bumps.

    Requesting a human go/no-go on which path, plus authorization for the cross-repo write (a PR on
    petry-projects/repo-template, and for the preferred path a PR on petry-projects/.github) — neither of which
    the dev-lead performs autonomously under its constraints.

  6. don-petry commented on Jul 19, 2026

    @don-petry
    CollaboratorAuthor

    Superseded — closing. dev-lead's investigation showed the template-drift check guards petry-projects/repo-template's stubs (not this repo's), and repo-template is AHEAD on actions/checkout (v7.0.0, Dependabot). The re-seed can't happen here. Split into the correct no-downgrade fix:

    Together these turn template-drift GREEN with zero downgrades. Thanks to dev-lead for catching the repo-template target + downgrade twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug reportsneeds-human-reviewFlagged by automated PR review agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions