Skip to content

feat: implement issue #883 — [Phase 1] Parameterize initiative-driver.yml on target_repo + bats for a non-self sweep - #893

Merged
don-petry merged 3 commits into
mainfrom
dev-lead/issue-883-20260621-1315
Jun 21, 2026
Merged

feat: implement issue #883 — [Phase 1] Parameterize initiative-driver.yml on target_repo + bats for a non-self sweep#893
don-petry merged 3 commits into
mainfrom
dev-lead/issue-883-20260621-1315

Conversation

@don-petry

@don-petry don-petry commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Closes #883

Implemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • New Features

    • Workflow now supports selecting a specific target repository through a new input parameter, with improved per-repository concurrency control to prevent cross-repository conflicts.
  • Tests

    • Added comprehensive test coverage for cross-repository workflow execution scenarios.

….yml on target_repo + bats for a non-self sweep
@don-petry
don-petry requested a review from a team as a code owner June 21, 2026 13:19
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e8e399f5-4596-4501-ae87-3c6492a5a72c

📥 Commits

Reviewing files that changed from the base of the PR and between 195a24e and e21585a.

📒 Files selected for processing (2)
  • .github/workflows/initiative-driver.yml
  • tests/test_initiative_driver.bats

📝 Walkthrough

Walkthrough

The initiative-driver.yml workflow gains an optional target_repo dispatch input. Concurrency is rekeyed per target repo (initiative-driver-<target_repo-or-github.repository>), and the REPO environment variable is resolved to the selected target. A new Bats test validates that all gh API calls and label writes are routed to the non-self target repo.

Changes

Cross-repo targeting in initiative-driver

Layer / File(s) Summary
workflow_dispatch input, concurrency rekeying, and REPO resolution
.github/workflows/initiative-driver.yml
Adds optional target_repo input (required: false, default: ""), changes concurrency.group to initiative-driver-${{ github.event.inputs.target_repo || github.repository }}, and updates REPO env var to resolve to the selected target repo.
Cross-repo sweep Bats test
tests/test_initiative_driver.bats
New cross-repo test sets EPIC="" and REPO="other/repo", mocks gh to expect repos/other/repo/... paths, and asserts issue edit ... --repo other/repo --add-label dev-lead is called while no calls touch petry-projects/.github-private.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

  • petry-projects/.github-private#507: This PR extends the initiative-driver.yml orchestration introduced in PR #507 by adding workflow_dispatch support for a non-self target_repo and adjusting REPO/concurrency handling.
  • petry-projects/.github-private#683: The new cross-repo EPIC-empty sweep test builds on the sweep-mode behavior for empty EPIC validated in PR #683.
  • petry-projects/.github-private#827: Both PRs implement workflow_dispatch-driven target_repo support with REPO-scoped behavior and tests asserting --repo-qualified operations.

Suggested labels

enhancement, initiative

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: parameterizing initiative-driver.yml on target_repo with corresponding test coverage, directly addressing issue #883 Phase 1.
Linked Issues check ✅ Passed All five acceptance criteria from issue #883 are met: workflow input added [AC1], concurrency keyed per repo [AC2], PAT guard retained [AC3], script unchanged [AC4], and bats test added for non-self sweep [AC5].
Out of Scope Changes check ✅ Passed All changes align with issue #883 Phase 1 scope: workflow input, concurrency keying, and test coverage for cross-repo sweep behavior as specified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-883-20260621-1315

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new BATS test case to tests/test_initiative_driver.bats to verify cross-repository sweep behavior. The test ensures that when a non-self target repository is specified, all GitHub API queries and label operations are correctly qualified to that target repository. There are no review comments, and I have no feedback to provide.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 21, 2026 13:24
@don-petry
don-petry disabled auto-merge June 21, 2026 15:00
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) June 21, 2026 15:01
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-21T16:05:44Z.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry disabled auto-merge June 21, 2026 16:16

@donpetry-bot donpetry-bot 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.

Automated review — APPROVED ✓

Risk: MEDIUM
Reviewed commit: 558b49627233b225fc6c311958f3c8fb35245872
Review mode: triage-approved (single reviewer)

Summary

Workflow-only parameterization of .github/workflows/initiative-driver.yml to accept an optional target_repo workflow_dispatch input (REPO = target_repo || github.repository) with concurrency keyed per target repo, plus a bats case asserting a non-self sweep. Mirrors the already-merged initiative-planner.yml pattern; scripts/initiative-driver.sh is correctly left untouched.

Linked issue analysis

Closes #883. All five acceptance criteria are met: (1) target_repo input added and REPO resolves to target_repo || github.repository; (2) concurrency.group rekeyed to initiative-driver-${{ ... target_repo || github.repository }}, removing the single global lane; (3) the Drive step's GH_PAT_WORKFLOWS guard is unchanged (not touched by the diff); (4) scripts/initiative-driver.sh is unchanged; (5) tests/test_initiative_driver.bats gains a non-self target_repo case asserting every gh read and the release 'gh issue edit --repo other/repo --add-label dev-lead' target the foreign repo and that .github-private is never touched.

Findings

No blocking issues.

  • target_repo is a workflow_dispatch input (requires write access to trigger) and flows only into env: REPO and the concurrency: key — not interpolated into any run: shell block — so there is no Actions template-injection sink. The script consumes it as a quoted "$REPO" env var. Pattern matches the proven initiative-planner.yml.
  • New bats test is well-scoped: positively asserts target-repo-qualified reads/labeling and negatively asserts no self-repo leakage.
  • Secret-scanning MCP tool not exposed in this environment; relied on gitleaks CI (passed). Diff contains no credentials.
  • Advisory bots CodeRabbit and Codex were rate-limited (no substantive review); gemini-code-assist reviewed with no feedback and SonarCloud Quality Gate passed. Rate-limit reset (16:05Z) has elapsed.

CI status

All required checks green. SUCCESS: CI (Lint, ShellCheck, bats, gh-aw-compile, Agent Security Scan, Secret scan/gitleaks, Compile agentic workflows), CodeQL (actions + python), SonarCloud, AgentShield, holdout-guard, Test-Deletion Guard, unit-tests, validate-agent-profiles, review/review. SKIPPED: dependency-audit ecosystems, dependabot-automerge (expected). mergeStateStatus is BLOCKED pending the required org-leads team review (human gate), not a failing check.


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — waiting on PR blockers (intent: review-changes)

PR: #893
No changes were committed, but the PR still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews). The retry cron will re-attempt automatically. Next attempt after: 2026-06-21T16:46:52Z

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I reviewed this PR and no code changes were needed, but it still has blocking checks or reviews (failing or cancelled checks, or changes-requested reviews), so I cannot mark it done yet. I'll re-check automatically.
Next attempt after: 2026-06-21T16:46:52Z

@don-petry
don-petry enabled auto-merge (squash) June 21, 2026 16:16
@don-petry
don-petry merged commit f362afe into main Jun 21, 2026
28 of 32 checks passed
@don-petry
don-petry deleted the dev-lead/issue-883-20260621-1315 branch June 21, 2026 16:17
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-06-21T17:23:29Z.

@donpetry-bot donpetry-bot 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.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: e21585a841a9b70f1fa1b6016c753e54adca202f
Review mode: triage-approved (single reviewer)

Summary

Phase-1 parameterization of initiative-driver.yml on an optional target_repo input (REPO = target_repo || github.repository), with concurrency keyed per target repo, plus a bats test asserting a non-self cross-repo sweep. +55/-4 across 2 files (workflow + test). Scope matches issue #883 exactly; the orchestration script is left unchanged as required.

Linked issue analysis

Closes #883. All 5 acceptance criteria are met: (1) optional target_repo workflow_dispatch input added; REPO env resolves to target_repo when set else github.repository (workflow L62); (2) concurrency.group keyed per target repo (initiative-driver-${target_repo||github.repository}), mirroring initiative-planner.yml; (3) Drive step still uses GH_PAT_WORKFLOWS as GH_TOKEN and the PAT-present guard is retained (L90-93); (4) scripts/initiative-driver.sh untouched; (5) new bats case verifies that a REPO=other/repo sweep repo-qualifies every gh read and the release 'gh issue edit --repo other/repo --add-label dev-lead', and asserts nothing leaks to .github-private.

Findings

No blocking findings. Schedule/close (non-dispatch) events leave target_repo empty, so REPO and the concurrency group fall back to github.repository — self/dogfood behavior is preserved. The test mocks gh and exercises the script's REPO plumbing directly; the workflow→script wiring is straightforward env passing. gemini-code-assist reviewed with no feedback. MCP secret scanning tool unavailable in this environment; gitleaks CI check passed and the diff introduces no secrets/credentials.

CI status

All required checks green: shellcheck, bats, unit-tests, CodeQL (actions+python), gitleaks, SonarCloud, agent-shield/AgentShield, holdout-guard, validate-agent-profiles, gh-aw-compile, and more. The CANCELLED/SKIPPED entries are superseded duplicate runs whose successful re-runs are present. reviewDecision=APPROVED (donpetry-bot).


Reviewed automatically by the PR-review agent (single-reviewer mode: fable 5). Reply if you need a human review.

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.

[Phase 1] Parameterize initiative-driver.yml on target_repo + bats for a non-self sweep

2 participants