Skip to content

Per-repo caller stub + cross-repo redispatch #820

Closed

Description

@don-petry

Story

As a fleet-repo maintainer,
I want copy a thin standards/workflows/initiative-planner.yml stub that, on idea:approved, dispatches the central planner for my repo,
so that I get idea→initiative planning without vendoring BMAD frameworks/tooling locally.

Acceptance Criteria

  1. A new standards/workflows/initiative-planner.yml (in the public petry-projects/.github repo) triggers on discussion:[labeled], guarded if: github.event.label.name == 'idea:approved', copied verbatim per the org stub convention (mirrors standards/workflows/dev-lead.yml).
  2. The stub runs the redispatch path with a target_repo argument, dispatching gh workflow run initiative-planner.yml --repo petry-projects/.github-private -f discussion=<n> -f target_repo=<host>; redispatch.sh gains a TARGET_REPO/-f target_repo arg.
  3. The stub documents the required dispatch secret (App token / GH_PAT_WORKFLOWS) and the idea:approved label + Ideas-category prerequisite.
  4. The PAT-present guard is retained (a dispatch fired with GITHUB_TOKEN never starts a run — redispatch.sh:17-22).
  5. tests/test_initiative_planner_redispatch.bats covers the target_repo argument (re-asserting the regression test feat: implement issue #574 — pr-review: PRs with >300 changed files hard-fail the cascade (gh pr diff 406); define org standard for oversized PRs #606 deleted).

Tasks / Subtasks

Dev Notes

Project Structure Notes

Spans two repos: the stub lands in public petry-projects/.github (standards/workflows/), the redispatch.sh + test changes land in .github-private. Open the stub PR against .github and the script/test PR against .github-private.

References

  • standards/workflows/dev-lead.yml (petry-projects/.github)
  • standards/workflows/feature-ideation.yml (petry-projects/.github)
  • scripts/initiative-planner/redispatch.sh#L56-L58
  • tests/test_initiative_planner_redispatch.bats

Likely target surface

  • standards/workflows/initiative-planner.yml (new — petry-projects/.github)
  • scripts/initiative-planner/redispatch.sh
  • tests/test_initiative_planner_redispatch.bats

Story prepared by the BMAD Scrum Master (Bob) for epic #817. Status: ready-for-dev.

Activity

  1. github-actions commented on Jun 20, 2026

    @github-actions
    Contributor

    Thanks for the detailed write-up — the acceptance criteria, dev notes, and cross-repo scope are really helpful for anyone picking this up! Before implementation begins, could you clarify whether TARGET_REPO should be validated against an allowlist (e.g., only dispatch to repos within petry-projects) to prevent unauthorized cross-org dispatches, or is the PAT-scope boundary considered sufficient protection?

  2. don-petry commented on Jun 20, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead Implementation Plan

    Issue: #820 — Per-repo caller stub + cross-repo redispatch

    Scope (this repo: .github-private)

    Wire the existing target_repo redispatch regression test into CI so AC #5's guard actually runs; the redispatch.sh/test/workflow target_repo plumbing already landed in the merged tree.

    Current state assessment

    Implementation Checklist

    • Register tests/test_initiative_planner_redispatch.bats in the bats job list in .github/workflows/lint.yml (AGENTS.md requires new test files be added here).

    Tests to Write

    • No new test needed — tests/test_initiative_planner_redispatch.bats already asserts the target_repo argument (default self-path + fleet host override). This change makes that existing regression guard execute in CI.

    Test Command

    bats tests/test_initiative_planner_redispatch.bats (and the full scripts/run-bats.sh … list via the bats CI job); lint via bash .dev-lead/scripts/dev-lead-lint.sh.

  3. don-petry commented on Jun 20, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead: Implementation Complete

    Plan Execution

    • Assessed current .github-private state against all five ACs.
    • Registered tests/test_initiative_planner_redispatch.bats in the bats job in .github/workflows/lint.yml so AC feat: add Copilot engine support via REVIEW_ENGINE toggle #5's target_repo regression guard actually runs in CI.
    • Verified the full bats suite + repo lint pass.

    AC status (this repo)

    Test Results

    $ bats tests/test_initiative_planner_redispatch.bats
    1..12
    ok 1 re-dispatches the planner workflow via workflow_dispatch
    ok 2 threads the discussion number and forces dry_run=false
    ok 3 targets the correct repo
    ok 4 fails when DISCUSSION_NUMBER is unset
    ok 5 rejects a non-numeric DISCUSSION_NUMBER without dispatching
    ok 6 fails when REPO is unset
    ok 7 honors a WORKFLOW_FILE override
    ok 8 honors DRY_RUN=1 or DRY_RUN=true
    ok 9 passes target_repo defaulting to the dispatch repo (dogfood self path)
    ok 10 honors a TARGET_REPO override (fleet host repo)
    ok 11 passes GITHUB_REF if it is a branch or tag
    ok 12 ignores GITHUB_REF if it is a pull request ref
    
    Full bats job (scripts/run-bats.sh …): 597/597 ok, exit 0
    .dev-lead/scripts/dev-lead-lint.sh: all checks passed (shellcheck 67 files, 4 agent profiles)
    

    Files Changed

    • .github/workflows/lint.yml: add tests/test_initiative_planner_redispatch.bats to the bats job test list (AGENTS.md requires new test files be registered here).

    Notes

    • TDD note: Phase 2 was skipped under the documented exception for behavior-preserving CI/config changes — the regression test already exists and passes; this change only makes it execute in CI. No production behavior changed.
    • The open reviewer question on the issue (validating TARGET_REPO against a petry-projects allowlist) is a design decision not covered by the ACs; it was intentionally not implemented here to avoid scope creep. Recommend resolving it as a follow-up if cross-org dispatch hardening is desired.
    • The redispatch.sh/test/central-workflow target_repo plumbing was already present in the merged tree (the redispatch.sh header even references Per-repo caller stub + cross-repo redispatch #820), so no edits were needed there.
  4. added a commit that references this issue on Jun 20, 2026
  5. don-petry commented on Jun 20, 2026

    @don-petry
    CollaboratorAuthor

    Reopened: the .github-private-side PR closed this, but the real fleet deliverable — the public caller stub(s) in petry-projects/.github — was not created (dev-lead can't write to the public repo from here). That work is in combsmith/.github#499. This issue tracks until that PR merges + the channel tag is cut.

  6. don-petry commented on Jun 20, 2026

    @don-petry
    CollaboratorAuthor

    Done — the public caller stub(s) shipped in combsmith/.github#499 (merged). Fleet repos can now adopt the stub(s); the <name>/stable channel tag(s) still need cutting on release before adoption.

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

    dev-leadFor dev-lead agent pickupenhancementFeature requestsinitiativeEpic / initiative tracking issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions