Skip to content

feat(aw): make CI Failure Analyst org-wide via reusable workflow - #367

Merged
don-petry merged 11 commits into
mainfrom
feat/ci-failure-analyst-reusable
May 23, 2026
Merged

feat(aw): make CI Failure Analyst org-wide via reusable workflow#367
don-petry merged 11 commits into
mainfrom
feat/ci-failure-analyst-reusable

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Summary

The CI Failure Analyst currently only covers .github-private itself — each new org repo would need a full copy of the workflow logic to get diagnostic comments on CI failures. This PR extracts the logic into a workflow_call reusable and provides a ~20-line stub template that any org repo can deploy.

Problem

ci-failure-analyst.lock.yml is a monolithic, hand-written workflow that lives and runs only in this repo. There is no mechanism to share it with other org repos without duplicating the entire 100+ line file — including the Claude invocation, idempotency logic, and prompt template.

Solution

Split into two files following the established dev-lead-reusable.yml pattern:

File Role
ci-failure-analyst-reusable.yml Single source of truth — all logic
ci-failure-analyst.lock.yml Thin 20-line stub for this repo
templates/ci-failure-analyst.yml Copy-paste stub for any other org repo
repo-x (check_run: failure)
  └─ .github/workflows/ci-failure-analyst.yml   ← ~20-line stub (no logic)
      └─ uses: .../.github-private/ci-failure-analyst-reusable.yml@main
          ├─ resolves PR (non-fork only)
          ├─ idempotency check (<!-- ci-analyst sha=... -->)
          ├─ installs Claude Code
          └─ runs analysis → posts comment

Why reusable workflow (not dispatch)

The existing cross-org pattern for dev-lead uses repository_dispatch because dev-lead needs to push commits (requires GH_PAT_WORKFLOWS with write access to the target repo). CI Failure Analyst is read-only — it only posts a comment using the caller's own GITHUB_TOKEN. This means:

  • No GH_PAT_WORKFLOWS needed
  • No relay job needed
  • Simpler deployment — one file, secrets: inherit
  • GitHub token is automatically scoped to the caller's repo

Deploying to a new repo

Copy templates/ci-failure-analyst.yml to .github/workflows/ci-failure-analyst.yml in the target repo. No other changes needed — CLAUDE_CODE_OAUTH_TOKEN is already an org secret granted to all repos.

Coexistence with dev-lead

Both can run in the same repo without conflict:

  • CI Failure Analyst: posts <!-- ci-analyst sha=... --> comment in < 2 min (diagnostic only)
  • dev-lead fix-ci: posts <!-- dev-lead sha=... --> comment + pushes a fix commit (5–10 min)

Different idempotency markers, different comment authors, different run times. Having both gives developers a fast diagnosis while the fix is being prepared.

Changes

  • NEW .github/workflows/ci-failure-analyst-reusable.yml — all logic; workflow_call trigger
  • MODIFIED .github/workflows/ci-failure-analyst.lock.yml — replaced with 20-line stub
  • NEW templates/ci-failure-analyst.yml — adoption template for other org repos
  • MODIFIED docs/aw/ci-failure-analyst.md — updated to reflect new architecture, removed stale gh-aw/ANTHROPIC_API_KEY references

Test plan

  • ci-failure-analyst.lock.yml (this repo) fires on check_run: completed → confirmed working pre-PR
  • After merge, verify reusable is callable from a test repo by deploying the template stub
  • Confirm CI Failure Analyst anti-loop guard prevents self-triggering
  • Verify idempotency: same SHA triggers analyst twice → only one comment posted

Copilot AI review requested due to automatic review settings May 23, 2026 02:04
@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 1 review/hour. Refill in 22 minutes and 47 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8f7acf3e-26c0-4576-b07f-7ff7cb0bc7f4

📥 Commits

Reviewing files that changed from the base of the PR and between 69e9774 and 32cf617.

📒 Files selected for processing (5)
  • .github/workflows/ci-failure-analyst-reusable.yml
  • .github/workflows/ci-failure-analyst.lock.yml
  • docs/aw/ci-failure-analyst.md
  • templates/ci-failure-analyst.yml
  • tests/aw/ci-failure-analyst/scenarios.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ci-failure-analyst-reusable

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.

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@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 transitions the CI Failure Analyst to a reusable workflow model triggered by check_run events, updating documentation and providing a template stub for deployment. Feedback identifies a consistency issue between the documentation and test scenarios regarding idempotency behavior (skipping vs. updating) and suggests pinning the reusable workflow to a specific commit SHA instead of the @main branch to ensure stability.

Comment thread docs/aw/ci-failure-analyst.md
Comment thread templates/ci-failure-analyst.yml Outdated
@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

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

Extracts the CI Failure Analyst workflow into a workflow_call reusable so it can be adopted org-wide via a thin caller stub, mirroring the established reusable-workflow deployment approach used elsewhere in this repo.

Changes:

  • Added a reusable workflow (ci-failure-analyst-reusable.yml) containing the full analysis + commenting logic.
  • Replaced the repo-local workflow with a thin stub (ci-failure-analyst.lock.yml) that calls the reusable.
  • Added an adoption template (templates/ci-failure-analyst.yml) and updated documentation to reflect the new architecture.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.

File Description
templates/ci-failure-analyst.yml New copy/paste stub for other repos to call the reusable workflow.
docs/aw/ci-failure-analyst.md Updated docs for reusable architecture, trigger behavior, and deployment steps.
.github/workflows/ci-failure-analyst.lock.yml Converted to a thin caller stub for this repo.
.github/workflows/ci-failure-analyst-reusable.yml New reusable workflow containing PR resolution, idempotency, analysis, and comment posting.

Comment thread templates/ci-failure-analyst.yml
Comment thread .github/workflows/ci-failure-analyst.lock.yml Outdated
Comment thread templates/ci-failure-analyst.yml Outdated
Comment thread .github/workflows/ci-failure-analyst.lock.yml Outdated
Comment thread .github/workflows/ci-failure-analyst-reusable.yml
Comment thread templates/ci-failure-analyst.yml Outdated
Comment thread .github/workflows/ci-failure-analyst.lock.yml Outdated
Comment thread docs/aw/ci-failure-analyst.md
Comment thread docs/aw/ci-failure-analyst.md
don-petry added 3 commits May 22, 2026 21:09
The idempotency check in ci-failure-analyst-reusable.yml skips when a
comment for the same SHA already exists (does not update in-place).
Update the scenario spec to reflect the actual implementation and add a
note explaining the intentional trade-off for multiple failing checks.


Using a mutable branch ref (@main) exposes consumers to unexpected breaking
changes. Pin to the current main HEAD SHA (69e9774) with a comment
noting it tracks main for easy future updates.
$ENV.REPO inside the single-quoted jq filter string is jq built-in
syntax for reading environment variables — shellcheck incorrectly flags
it as an unexpanded shell variable. Add an inline disable comment to
silence the false positive.
@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

donpetry-bot
donpetry-bot previously approved these changes May 23, 2026

@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: 24b0e5f6fe9391195ef88063c74b7ac1571b9c5b
Review mode: triage-approved (single reviewer)

Summary

This PR refactors the CI Failure Analyst from a monolithic in-repo workflow into a workflow_call reusable + thin caller stub, plus an adoption template for other org repos. It mirrors the established dev-lead-reusable.yml pattern. The analysis logic is moved largely 1:1 (Claude Code invocation, idempotency check, prompt template) with small, reasonable improvements: an explicit anti-loop guard (!startsWith(check_run.name, 'CI Failure Analyst')), a non-fork PR filter in the resolution step, and refreshed docs.

Linked issue analysis

No linked issue; the PR body itself motivates the change (enable org-wide adoption without duplicating ~150 lines per repo). The architecture choice (reusable vs. repository_dispatch) is well-justified in the PR description — read-only diagnostic comment using the caller's own GITHUB_TOKEN, so no GH_PAT_WORKFLOWS relay job is needed.

Findings

No blocking issues.

Nit / follow-up (non-blocking): templates/ci-failure-analyst.yml:43 pins uses: to commit 69e9774818d45846f3a850ca13f31c7e9d6345cc, which is the prior main HEAD (merge of #357). The reusable workflow file does not exist at that SHA — it is introduced by this PR. Anyone who copies the template before the SHA is bumped post-merge would get a workflow that fails to resolve the reusable. Either bump the SHA in a follow-up commit immediately after merge, or accept the slight risk that this template is unused until then. (The in-repo lock.yml correctly uses @main and is unaffected.)

Observations (informational):

  • Anti-loop guard !startsWith(github.event.check_run.name, 'CI Failure Analyst') is a sensible new safeguard. Naming-wise, the reusable workflow is "CI Failure Analyst — Reusable" and the lock workflow is "CI Failure Analyst", so both are caught by the prefix match.
  • Idempotency now intentionally skips (rather than updating) when a <!-- ci-analyst sha=... --> comment already exists. The scenario spec at tests/aw/ci-failure-analyst/scenarios.md was updated in the same PR to match — good consistency.
  • The shellcheck disable=SC2016 comment at .github/workflows/ci-failure-analyst-reusable.yml:33 is legitimate — $ENV.REPO inside a single-quoted jq filter is jq's environment-variable syntax, not a shell expansion.
  • Prompt-injection surface (WORKFLOW_NAME from github.event.check_run.name flows into the Claude prompt with --permission-mode bypassPermissions --allowedTools Bash) is pre-existing behavior, not introduced by this PR. Out of scope for this review, but worth tracking separately if the analyst is ever exposed to checks created by untrusted authors (forks are already filtered out, which mitigates this for now).

CI status

All 26 checks green or appropriately skipped: CodeQL, AgentShield, Lint, ShellCheck, bats, gh-aw-compile, Compile agentic workflows, Validate AW specs, unit-tests, SonarCloud (Quality Gate passed, 0 new issues), Secret scan (gitleaks), Agent Security Scan, PR Review Agent. Dependabot auto-merge and ecosystem-specific dependency-audit jobs correctly skipped (no manifest changes for npm/pnpm/pip/cargo/govulncheck).


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

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 24b0e5f6fe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread templates/ci-failure-analyst.yml
…crets

Declaring required secrets in the reusable's `on: workflow_call: secrets:`
block (as dev-lead-reusable.yml does) gives callers an explicit validation
error instead of a silent failure when the secret is missing.
don-petry added 3 commits May 22, 2026 21:15
- Add `issues: write` — PR comments are posted via the Issues comments
  API and require this permission alongside pull-requests: write.
- Pin the reusable ref to the main HEAD SHA instead of @main to prevent
  unexpected behavior changes.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to minimize secret exposure.
- Add `issues: write` — PR comments use the Issues comments API which
  requires this permission in addition to pull-requests: write.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to limit secret exposure to only what the reusable workflow requires.
- Add `issues: write` to permissions table — PR comments are posted via
  the Issues comments API and require this permission.
- Correct `contents: read` description — it is for the runner environment,
  not a workflow_call requirement per se.
- Update architecture diagram to show the pinned SHA ref instead of @main,
  matching the recommended deployment pattern from templates/.
@sonarqubecloud

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Collaborator Author

No description provided.

@don-petry
don-petry merged commit 121bee8 into main May 23, 2026
46 checks passed
@don-petry
don-petry deleted the feat/ci-failure-analyst-reusable branch May 23, 2026 02:19

@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: 32cf617e221a1c82546cb8a0e4e4a6d46c5d55bc
Review mode: triage-approved (single reviewer)

Summary

This PR extracts the CI Failure Analyst into a workflow_call reusable + thin caller stub, plus a copy-paste adoption template for other org repos. The architecture mirrors the established dev-lead-reusable.yml pattern. The analysis logic moves largely 1:1 (Claude Code invocation, idempotency check, prompt template) with sensible additions: an explicit anti-loop guard (!startsWith(check_run.name, 'CI Failure Analyst')), a non-fork PR filter at the resolution step, explicit workflow_call.secrets declaration in the reusable, and explicit per-secret pass-through (rather than secrets: inherit) from the callers.

This is the second cycle. The prior pass at 24b0e5f6 was dismissed because new commits followed addressing reviewer feedback — declaring CLAUDE_CODE_OAUTH_TOKEN under workflow_call: secrets:, adding issues: write to lock/template, pinning the reusable uses: ref, passing only the required secret explicitly, and refreshing the docs. Confirming triage approval.

Linked issue analysis

No linked issue. The PR body itself motivates the change (enable org-wide adoption without duplicating ~150 lines per repo). The architecture rationale (reusable vs. repository_dispatch) is well-justified — read-only diagnostic comment using the caller's own GITHUB_TOKEN, so no GH_PAT_WORKFLOWS relay is needed.

Findings

⚠️ Important follow-up (post-merge action needed):

Both .github/workflows/ci-failure-analyst.lock.yml:31 and templates/ci-failure-analyst.yml:43 pin uses: to 69e9774818d45846f3a850ca13f31c7e9d6345cc # main. That SHA is the current main HEAD (the merge of #357), and the reusable workflow file ci-failure-analyst-reusable.yml does not exist at that SHA — it is introduced by this PR. Consequences after merge:

  • The in-repo lock workflow will fire on the next check_run: failure, try to resolve …/ci-failure-analyst-reusable.yml@69e9774, fail to find it, and the analyst will not run until the SHA is bumped.
  • Any other repo that adopts the template before the SHA is bumped will see the same failure.

Recommended fix: immediately after merging this PR, push a follow-up commit bumping the pinned SHA in both lock.yml and templates/ci-failure-analyst.yml to the merge commit of this PR. Alternatively, the lock could safely use @main (auto-tracking is fine for the in-repo caller since it lives in the same repo).

The prior dismissed review flagged this for the template only; it now also applies to the lock after commit a96d0e1 ("fix(lock): … pin SHA…"). Flagging more prominently here because the lock is the active workflow in this repo and will silently fail post-merge.

No other blocking issues.

Observations (informational):

  • Anti-loop guard !startsWith(github.event.check_run.name, 'CI Failure Analyst') correctly catches both "CI Failure Analyst" (lock) and "CI Failure Analyst — Reusable" (reusable) via the shared prefix.
  • Idempotency now intentionally skips (rather than updates) when a <!-- ci-analyst sha=… --> comment already exists. tests/aw/ci-failure-analyst/scenarios.md was updated in the same PR to match the new behavior — good consistency, and the trade-off (only first failing check on a given SHA gets diagnosed) is documented in the scenario note.
  • The shellcheck disable=SC2016 comment at .github/workflows/ci-failure-analyst-reusable.yml:33 is legitimate — $ENV.REPO inside a single-quoted jq filter is jq's environment-variable syntax, not a shell expansion.
  • Per-secret pass-through (secrets: { CLAUDE_CODE_OAUTH_TOKEN: … }) instead of secrets: inherit is a deliberate minimization choice mentioned in commit messages — good security hygiene.
  • Prompt-injection surface (WORKFLOW_NAME from github.event.check_run.name flows into the Claude prompt running with --permission-mode bypassPermissions --allowedTools Bash) is pre-existing behavior, not introduced or worsened by this PR. The non-fork PR filter already mitigates the obvious attack vector; worth tracking separately if the analyst is ever exposed to checks from untrusted authors.

CI status

All 26 checks green or appropriately skipped: CodeQL (actions), AgentShield, CI Lint, ShellCheck, bats, validate-agent-profiles, gh-aw-compile, Compile agentic workflows, Validate AW specs, unit-tests, SonarCloud (Quality Gate passed, 0 new issues), Secret scan (gitleaks), Agent Security Scan, PR Review Agent. Dependabot auto-merge and ecosystem-specific dependency-audit jobs correctly skipped (no manifest changes for npm/pnpm/pip/cargo/govulncheck). CodeRabbit and SonarCloud status contexts also success.


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

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32cf617e22

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if: >-
github.event.check_run.conclusion == 'failure' &&
!startsWith(github.event.check_run.name, 'CI Failure Analyst')
uses: petry-projects/.github-private/.github/workflows/ci-failure-analyst-reusable.yml@69e9774818d45846f3a850ca13f31c7e9d6345cc # main

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Pin reusable workflow to a commit that contains the file

The caller stub references petry-projects/.github-private/.github/workflows/ci-failure-analyst-reusable.yml@69e977..., but that commit predates the introduction of ci-failure-analyst-reusable.yml, so this workflow cannot be resolved at runtime and the analyst job will fail to start in this repo. Update the ref to a commit (or local same-repo path) that actually includes the reusable workflow file.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Acknowledged — same root cause as the template comment. The SHA 69e9774 predated this PR and does not contain the reusable. PR #370 updates both ci-failure-analyst.lock.yml and the template to point to the merge commit 121bee881bd13715706d30230b2d5a8d2d78b0b1, which is the first main SHA that includes the reusable workflow file.

don-petry added a commit that referenced this pull request May 23, 2026
The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.
don-petry added a commit that referenced this pull request May 23, 2026
The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.
don-petry added a commit that referenced this pull request May 23, 2026
The SHA 69e9774 in the architecture diagram predated PR #367. Update to
the merge commit (121bee8) which is the first main SHA that
contains the reusable workflow.
don-petry added a commit that referenced this pull request May 23, 2026
* fix(template): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(lock): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(docs): update architecture SHA to post-merge main

The SHA 69e9774 in the architecture diagram predated PR #367. Update to
the merge commit (121bee8) which is the first main SHA that
contains the reusable workflow.
don-petry added a commit that referenced this pull request Jun 7, 2026
* feat(aw): add CI Failure Analyst reusable workflow

* feat(aw): replace ci-failure-analyst.lock.yml with thin stub

* feat(aw): add ci-failure-analyst template for org deployment

* docs(aw): rewrite ci-failure-analyst.md for reusable workflow architecture

* fix(tests): update duplicate-SHA scenario to match skip behavior

The idempotency check in ci-failure-analyst-reusable.yml skips when a
comment for the same SHA already exists (does not update in-place).
Update the scenario spec to reflect the actual implementation and add a
note explaining the intentional trade-off for multiple failing checks.

* fix(templates): pin reusable workflow ref to commit SHA instead of @main

Using a mutable branch ref (@main) exposes consumers to unexpected breaking
changes. Pin to the current main HEAD SHA (69e9774) with a comment
noting it tracks main for easy future updates.

* fix(lint): suppress SC2016 false positive on jq $ENV.REPO filter

$ENV.REPO inside the single-quoted jq filter string is jq built-in
syntax for reading environment variables — shellcheck incorrectly flags
it as an unexpanded shell variable. Add an inline disable comment to
silence the false positive.

* fix(reusable): declare CLAUDE_CODE_OAUTH_TOKEN under workflow_call secrets

Declaring required secrets in the reusable's `on: workflow_call: secrets:`
block (as dev-lead-reusable.yml does) gives callers an explicit validation
error instead of a silent failure when the secret is missing.

* fix(lock): add issues:write, pin SHA, pass secret explicitly

- Add `issues: write` — PR comments are posted via the Issues comments
  API and require this permission alongside pull-requests: write.
- Pin the reusable ref to the main HEAD SHA instead of @main to prevent
  unexpected behavior changes.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to minimize secret exposure.

* fix(template): add issues:write and pass secret explicitly

- Add `issues: write` — PR comments use the Issues comments API which
  requires this permission in addition to pull-requests: write.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to limit secret exposure to only what the reusable workflow requires.

* fix(docs): update permissions table and architecture diagram

- Add `issues: write` to permissions table — PR comments are posted via
  the Issues comments API and require this permission.
- Correct `contents: read` description — it is for the runner environment,
  not a workflow_call requirement per se.
- Update architecture diagram to show the pinned SHA ref instead of @main,
  matching the recommended deployment pattern from templates/.
don-petry added a commit that referenced this pull request Jun 7, 2026
* fix(template): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(lock): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(docs): update architecture SHA to post-merge main

The SHA 69e9774 in the architecture diagram predated PR #367. Update to
the merge commit (121bee8) which is the first main SHA that
contains the reusable workflow.
don-petry added a commit that referenced this pull request Jun 7, 2026
* feat(aw): add CI Failure Analyst reusable workflow

* feat(aw): replace ci-failure-analyst.lock.yml with thin stub

* feat(aw): add ci-failure-analyst template for org deployment

* docs(aw): rewrite ci-failure-analyst.md for reusable workflow architecture

* fix(tests): update duplicate-SHA scenario to match skip behavior

The idempotency check in ci-failure-analyst-reusable.yml skips when a
comment for the same SHA already exists (does not update in-place).
Update the scenario spec to reflect the actual implementation and add a
note explaining the intentional trade-off for multiple failing checks.

* fix(templates): pin reusable workflow ref to commit SHA instead of @main

Using a mutable branch ref (@main) exposes consumers to unexpected breaking
changes. Pin to the current main HEAD SHA (69e9774) with a comment
noting it tracks main for easy future updates.

* fix(lint): suppress SC2016 false positive on jq $ENV.REPO filter

$ENV.REPO inside the single-quoted jq filter string is jq built-in
syntax for reading environment variables — shellcheck incorrectly flags
it as an unexpanded shell variable. Add an inline disable comment to
silence the false positive.

* fix(reusable): declare CLAUDE_CODE_OAUTH_TOKEN under workflow_call secrets

Declaring required secrets in the reusable's `on: workflow_call: secrets:`
block (as dev-lead-reusable.yml does) gives callers an explicit validation
error instead of a silent failure when the secret is missing.

* fix(lock): add issues:write, pin SHA, pass secret explicitly

- Add `issues: write` — PR comments are posted via the Issues comments
  API and require this permission alongside pull-requests: write.
- Pin the reusable ref to the main HEAD SHA instead of @main to prevent
  unexpected behavior changes.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to minimize secret exposure.

* fix(template): add issues:write and pass secret explicitly

- Add `issues: write` — PR comments use the Issues comments API which
  requires this permission in addition to pull-requests: write.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to limit secret exposure to only what the reusable workflow requires.

* fix(docs): update permissions table and architecture diagram

- Add `issues: write` to permissions table — PR comments are posted via
  the Issues comments API and require this permission.
- Correct `contents: read` description — it is for the runner environment,
  not a workflow_call requirement per se.
- Update architecture diagram to show the pinned SHA ref instead of @main,
  matching the recommended deployment pattern from templates/.
don-petry added a commit that referenced this pull request Jun 7, 2026
* fix(template): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(lock): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(docs): update architecture SHA to post-merge main

The SHA 69e9774 in the architecture diagram predated PR #367. Update to
the merge commit (121bee8) which is the first main SHA that
contains the reusable workflow.
don-petry added a commit that referenced this pull request Jun 8, 2026
* feat(aw): add CI Failure Analyst reusable workflow

* feat(aw): replace ci-failure-analyst.lock.yml with thin stub

* feat(aw): add ci-failure-analyst template for org deployment

* docs(aw): rewrite ci-failure-analyst.md for reusable workflow architecture

* fix(tests): update duplicate-SHA scenario to match skip behavior

The idempotency check in ci-failure-analyst-reusable.yml skips when a
comment for the same SHA already exists (does not update in-place).
Update the scenario spec to reflect the actual implementation and add a
note explaining the intentional trade-off for multiple failing checks.

* fix(templates): pin reusable workflow ref to commit SHA instead of @main

Using a mutable branch ref (@main) exposes consumers to unexpected breaking
changes. Pin to the current main HEAD SHA (69e9774) with a comment
noting it tracks main for easy future updates.

* fix(lint): suppress SC2016 false positive on jq $ENV.REPO filter

$ENV.REPO inside the single-quoted jq filter string is jq built-in
syntax for reading environment variables — shellcheck incorrectly flags
it as an unexpanded shell variable. Add an inline disable comment to
silence the false positive.

* fix(reusable): declare CLAUDE_CODE_OAUTH_TOKEN under workflow_call secrets

Declaring required secrets in the reusable's `on: workflow_call: secrets:`
block (as dev-lead-reusable.yml does) gives callers an explicit validation
error instead of a silent failure when the secret is missing.

* fix(lock): add issues:write, pin SHA, pass secret explicitly

- Add `issues: write` — PR comments are posted via the Issues comments
  API and require this permission alongside pull-requests: write.
- Pin the reusable ref to the main HEAD SHA instead of @main to prevent
  unexpected behavior changes.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to minimize secret exposure.

* fix(template): add issues:write and pass secret explicitly

- Add `issues: write` — PR comments use the Issues comments API which
  requires this permission in addition to pull-requests: write.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to limit secret exposure to only what the reusable workflow requires.

* fix(docs): update permissions table and architecture diagram

- Add `issues: write` to permissions table — PR comments are posted via
  the Issues comments API and require this permission.
- Correct `contents: read` description — it is for the runner environment,
  not a workflow_call requirement per se.
- Update architecture diagram to show the pinned SHA ref instead of @main,
  matching the recommended deployment pattern from templates/.
don-petry added a commit that referenced this pull request Jun 8, 2026
* fix(template): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(lock): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(docs): update architecture SHA to post-merge main

The SHA 69e9774 in the architecture diagram predated PR #367. Update to
the merge commit (121bee8) which is the first main SHA that
contains the reusable workflow.
don-petry added a commit that referenced this pull request Jun 12, 2026
* feat(aw): add CI Failure Analyst reusable workflow

* feat(aw): replace ci-failure-analyst.lock.yml with thin stub

* feat(aw): add ci-failure-analyst template for org deployment

* docs(aw): rewrite ci-failure-analyst.md for reusable workflow architecture

* fix(tests): update duplicate-SHA scenario to match skip behavior

The idempotency check in ci-failure-analyst-reusable.yml skips when a
comment for the same SHA already exists (does not update in-place).
Update the scenario spec to reflect the actual implementation and add a
note explaining the intentional trade-off for multiple failing checks.

* fix(templates): pin reusable workflow ref to commit SHA instead of @main

Using a mutable branch ref (@main) exposes consumers to unexpected breaking
changes. Pin to the current main HEAD SHA (69e9774) with a comment
noting it tracks main for easy future updates.

* fix(lint): suppress SC2016 false positive on jq $ENV.REPO filter

$ENV.REPO inside the single-quoted jq filter string is jq built-in
syntax for reading environment variables — shellcheck incorrectly flags
it as an unexpanded shell variable. Add an inline disable comment to
silence the false positive.

* fix(reusable): declare CLAUDE_CODE_OAUTH_TOKEN under workflow_call secrets

Declaring required secrets in the reusable's `on: workflow_call: secrets:`
block (as dev-lead-reusable.yml does) gives callers an explicit validation
error instead of a silent failure when the secret is missing.

* fix(lock): add issues:write, pin SHA, pass secret explicitly

- Add `issues: write` — PR comments are posted via the Issues comments
  API and require this permission alongside pull-requests: write.
- Pin the reusable ref to the main HEAD SHA instead of @main to prevent
  unexpected behavior changes.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to minimize secret exposure.

* fix(template): add issues:write and pass secret explicitly

- Add `issues: write` — PR comments use the Issues comments API which
  requires this permission in addition to pull-requests: write.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to limit secret exposure to only what the reusable workflow requires.

* fix(docs): update permissions table and architecture diagram

- Add `issues: write` to permissions table — PR comments are posted via
  the Issues comments API and require this permission.
- Correct `contents: read` description — it is for the runner environment,
  not a workflow_call requirement per se.
- Update architecture diagram to show the pinned SHA ref instead of @main,
  matching the recommended deployment pattern from templates/.
don-petry added a commit that referenced this pull request Jun 12, 2026
* fix(template): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(lock): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(docs): update architecture SHA to post-merge main

The SHA 69e9774 in the architecture diagram predated PR #367. Update to
the merge commit (121bee8) which is the first main SHA that
contains the reusable workflow.
don-petry added a commit that referenced this pull request Jun 14, 2026
* feat(aw): add CI Failure Analyst reusable workflow

* feat(aw): replace ci-failure-analyst.lock.yml with thin stub

* feat(aw): add ci-failure-analyst template for org deployment

* docs(aw): rewrite ci-failure-analyst.md for reusable workflow architecture

* fix(tests): update duplicate-SHA scenario to match skip behavior

The idempotency check in ci-failure-analyst-reusable.yml skips when a
comment for the same SHA already exists (does not update in-place).
Update the scenario spec to reflect the actual implementation and add a
note explaining the intentional trade-off for multiple failing checks.

* fix(templates): pin reusable workflow ref to commit SHA instead of @main

Using a mutable branch ref (@main) exposes consumers to unexpected breaking
changes. Pin to the current main HEAD SHA (69e9774) with a comment
noting it tracks main for easy future updates.

* fix(lint): suppress SC2016 false positive on jq $ENV.REPO filter

$ENV.REPO inside the single-quoted jq filter string is jq built-in
syntax for reading environment variables — shellcheck incorrectly flags
it as an unexpanded shell variable. Add an inline disable comment to
silence the false positive.

* fix(reusable): declare CLAUDE_CODE_OAUTH_TOKEN under workflow_call secrets

Declaring required secrets in the reusable's `on: workflow_call: secrets:`
block (as dev-lead-reusable.yml does) gives callers an explicit validation
error instead of a silent failure when the secret is missing.

* fix(lock): add issues:write, pin SHA, pass secret explicitly

- Add `issues: write` — PR comments are posted via the Issues comments
  API and require this permission alongside pull-requests: write.
- Pin the reusable ref to the main HEAD SHA instead of @main to prevent
  unexpected behavior changes.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to minimize secret exposure.

* fix(template): add issues:write and pass secret explicitly

- Add `issues: write` — PR comments use the Issues comments API which
  requires this permission in addition to pull-requests: write.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to limit secret exposure to only what the reusable workflow requires.

* fix(docs): update permissions table and architecture diagram

- Add `issues: write` to permissions table — PR comments are posted via
  the Issues comments API and require this permission.
- Correct `contents: read` description — it is for the runner environment,
  not a workflow_call requirement per se.
- Update architecture diagram to show the pinned SHA ref instead of @main,
  matching the recommended deployment pattern from templates/.
don-petry added a commit that referenced this pull request Jun 14, 2026
* fix(template): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(lock): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(docs): update architecture SHA to post-merge main

The SHA 69e9774 in the architecture diagram predated PR #367. Update to
the merge commit (121bee8) which is the first main SHA that
contains the reusable workflow.
don-petry added a commit that referenced this pull request Jun 18, 2026
* feat(aw): add CI Failure Analyst reusable workflow

* feat(aw): replace ci-failure-analyst.lock.yml with thin stub

* feat(aw): add ci-failure-analyst template for org deployment

* docs(aw): rewrite ci-failure-analyst.md for reusable workflow architecture

* fix(tests): update duplicate-SHA scenario to match skip behavior

The idempotency check in ci-failure-analyst-reusable.yml skips when a
comment for the same SHA already exists (does not update in-place).
Update the scenario spec to reflect the actual implementation and add a
note explaining the intentional trade-off for multiple failing checks.

* fix(templates): pin reusable workflow ref to commit SHA instead of @main

Using a mutable branch ref (@main) exposes consumers to unexpected breaking
changes. Pin to the current main HEAD SHA (69e9774) with a comment
noting it tracks main for easy future updates.

* fix(lint): suppress SC2016 false positive on jq $ENV.REPO filter

$ENV.REPO inside the single-quoted jq filter string is jq built-in
syntax for reading environment variables — shellcheck incorrectly flags
it as an unexpanded shell variable. Add an inline disable comment to
silence the false positive.

* fix(reusable): declare CLAUDE_CODE_OAUTH_TOKEN under workflow_call secrets

Declaring required secrets in the reusable's `on: workflow_call: secrets:`
block (as dev-lead-reusable.yml does) gives callers an explicit validation
error instead of a silent failure when the secret is missing.

* fix(lock): add issues:write, pin SHA, pass secret explicitly

- Add `issues: write` — PR comments are posted via the Issues comments
  API and require this permission alongside pull-requests: write.
- Pin the reusable ref to the main HEAD SHA instead of @main to prevent
  unexpected behavior changes.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to minimize secret exposure.

* fix(template): add issues:write and pass secret explicitly

- Add `issues: write` — PR comments use the Issues comments API which
  requires this permission in addition to pull-requests: write.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to limit secret exposure to only what the reusable workflow requires.

* fix(docs): update permissions table and architecture diagram

- Add `issues: write` to permissions table — PR comments are posted via
  the Issues comments API and require this permission.
- Correct `contents: read` description — it is for the runner environment,
  not a workflow_call requirement per se.
- Update architecture diagram to show the pinned SHA ref instead of @main,
  matching the recommended deployment pattern from templates/.
don-petry added a commit that referenced this pull request Jun 18, 2026
* fix(template): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(lock): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(docs): update architecture SHA to post-merge main

The SHA 69e9774 in the architecture diagram predated PR #367. Update to
the merge commit (121bee8) which is the first main SHA that
contains the reusable workflow.
don-petry added a commit that referenced this pull request Jun 25, 2026
* feat(aw): add CI Failure Analyst reusable workflow

* feat(aw): replace ci-failure-analyst.lock.yml with thin stub

* feat(aw): add ci-failure-analyst template for org deployment

* docs(aw): rewrite ci-failure-analyst.md for reusable workflow architecture

* fix(tests): update duplicate-SHA scenario to match skip behavior

The idempotency check in ci-failure-analyst-reusable.yml skips when a
comment for the same SHA already exists (does not update in-place).
Update the scenario spec to reflect the actual implementation and add a
note explaining the intentional trade-off for multiple failing checks.

* fix(templates): pin reusable workflow ref to commit SHA instead of @main

Using a mutable branch ref (@main) exposes consumers to unexpected breaking
changes. Pin to the current main HEAD SHA (69e9774) with a comment
noting it tracks main for easy future updates.

* fix(lint): suppress SC2016 false positive on jq $ENV.REPO filter

$ENV.REPO inside the single-quoted jq filter string is jq built-in
syntax for reading environment variables — shellcheck incorrectly flags
it as an unexpanded shell variable. Add an inline disable comment to
silence the false positive.

* fix(reusable): declare CLAUDE_CODE_OAUTH_TOKEN under workflow_call secrets

Declaring required secrets in the reusable's `on: workflow_call: secrets:`
block (as dev-lead-reusable.yml does) gives callers an explicit validation
error instead of a silent failure when the secret is missing.

* fix(lock): add issues:write, pin SHA, pass secret explicitly

- Add `issues: write` — PR comments are posted via the Issues comments
  API and require this permission alongside pull-requests: write.
- Pin the reusable ref to the main HEAD SHA instead of @main to prevent
  unexpected behavior changes.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to minimize secret exposure.

* fix(template): add issues:write and pass secret explicitly

- Add `issues: write` — PR comments use the Issues comments API which
  requires this permission in addition to pull-requests: write.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to limit secret exposure to only what the reusable workflow requires.

* fix(docs): update permissions table and architecture diagram

- Add `issues: write` to permissions table — PR comments are posted via
  the Issues comments API and require this permission.
- Correct `contents: read` description — it is for the runner environment,
  not a workflow_call requirement per se.
- Update architecture diagram to show the pinned SHA ref instead of @main,
  matching the recommended deployment pattern from templates/.
don-petry added a commit that referenced this pull request Jun 25, 2026
* fix(template): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(lock): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(docs): update architecture SHA to post-merge main

The SHA 69e9774 in the architecture diagram predated PR #367. Update to
the merge commit (121bee8) which is the first main SHA that
contains the reusable workflow.
don-petry added a commit that referenced this pull request Jun 25, 2026
* feat(aw): add CI Failure Analyst reusable workflow

* feat(aw): replace ci-failure-analyst.lock.yml with thin stub

* feat(aw): add ci-failure-analyst template for org deployment

* docs(aw): rewrite ci-failure-analyst.md for reusable workflow architecture

* fix(tests): update duplicate-SHA scenario to match skip behavior

The idempotency check in ci-failure-analyst-reusable.yml skips when a
comment for the same SHA already exists (does not update in-place).
Update the scenario spec to reflect the actual implementation and add a
note explaining the intentional trade-off for multiple failing checks.

* fix(templates): pin reusable workflow ref to commit SHA instead of @main

Using a mutable branch ref (@main) exposes consumers to unexpected breaking
changes. Pin to the current main HEAD SHA (69e9774) with a comment
noting it tracks main for easy future updates.

* fix(lint): suppress SC2016 false positive on jq $ENV.REPO filter

$ENV.REPO inside the single-quoted jq filter string is jq built-in
syntax for reading environment variables — shellcheck incorrectly flags
it as an unexpanded shell variable. Add an inline disable comment to
silence the false positive.

* fix(reusable): declare CLAUDE_CODE_OAUTH_TOKEN under workflow_call secrets

Declaring required secrets in the reusable's `on: workflow_call: secrets:`
block (as dev-lead-reusable.yml does) gives callers an explicit validation
error instead of a silent failure when the secret is missing.

* fix(lock): add issues:write, pin SHA, pass secret explicitly

- Add `issues: write` — PR comments are posted via the Issues comments
  API and require this permission alongside pull-requests: write.
- Pin the reusable ref to the main HEAD SHA instead of @main to prevent
  unexpected behavior changes.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to minimize secret exposure.

* fix(template): add issues:write and pass secret explicitly

- Add `issues: write` — PR comments use the Issues comments API which
  requires this permission in addition to pull-requests: write.
- Pass only CLAUDE_CODE_OAUTH_TOKEN explicitly rather than secrets: inherit
  to limit secret exposure to only what the reusable workflow requires.

* fix(docs): update permissions table and architecture diagram

- Add `issues: write` to permissions table — PR comments are posted via
  the Issues comments API and require this permission.
- Correct `contents: read` description — it is for the runner environment,
  not a workflow_call requirement per se.
- Update architecture diagram to show the pinned SHA ref instead of @main,
  matching the recommended deployment pattern from templates/.
don-petry added a commit that referenced this pull request Jun 25, 2026
* fix(template): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(lock): pin reusable ref to post-merge main SHA

The SHA 69e9774 predated PR #367 and did not contain the reusable workflow.
Update the pinned ref to the merge commit (121bee8) which is the
first commit on main that includes ci-failure-analyst-reusable.yml.

* fix(docs): update architecture SHA to post-merge main

The SHA 69e9774 in the architecture diagram predated PR #367. Update to
the merge commit (121bee8) which is the first main SHA that
contains the reusable workflow.
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.

3 participants