Skip to content

fix(workflows): inline add-to-project if-condition (PRs were silently skipped) - #418

Merged
don-petry merged 1 commit into
mainfrom
fix/add-to-project-if-condition
Jun 7, 2026
Merged

don-petry merged 1 commit into
mainfrom
fix/add-to-project-if-condition

Conversation

@don-petry

Copy link
Copy Markdown
Contributor

Summary

The add-to-project.yml workflow's if: on the add-issue-or-pr job uses a YAML folded scalar (>-) for a multi-line ${{ }} expression. On main today, this skips both jobs for every pull_request_target event — even when the author's association is in the allowlist.

Reproduction

PR #417 (the docs PR) was opened by don-petry (author_association: MEMBER, which is in the allowlist ["OWNER","MEMBER","COLLABORATOR"]). Run 27094298629 shows both add-issue-or-pr and reconcile-discussion jobs as skipped. The PR was not added to the Initiatives project (it had to be added manually).

Fix

Inline the if-expression on a single line. The expression is now 197 characters, well under yamllint's 200-character limit.

This is the same expression, just single-line — semantics unchanged.

Test plan

  • Merge with CI green
  • Open a smoke-test issue with dev-lead label → verify it appears on the Initiatives board within ~30s
  • Open a smoke-test PR with dev-lead label → verify it appears on the board

Related

… fires for legitimate PRs

Previously the if: used a YAML folded scalar (>-) for a multi-line
${{ }} expression. On main, that resulted in the job being SKIPPED for
every pull_request_target event — including PRs from a MEMBER author
where the expression should evaluate true. Observed on PR #417 (the
docs PR): run 27094298629 skipped both jobs at 13:44:21Z despite
authorAssociation == MEMBER being in the allowlist.

The fix is to put the if: expression on a single line. Length is 197
chars (yamllint line-length cap is 200, so it fits).
Copilot AI review requested due to automatic review settings June 7, 2026 17:18
@don-petry
don-petry requested a review from a team as a code owner June 7, 2026 17:18
@don-petry don-petry added the dev-lead For dev-lead agent pickup label Jun 7, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@don-petry, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 34 seconds. Learn how PR review limits work.

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

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 179dfff9-d942-4e29-828e-db7b5be24294

📥 Commits

Reviewing files that changed from the base of the PR and between f4107cd and 03eeb7d.

📒 Files selected for processing (1)
  • .github/workflows/add-to-project.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/add-to-project-if-condition

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.

@sonarqubecloud

sonarqubecloud Bot commented Jun 7, 2026

Copy link
Copy Markdown

don-petry added a commit that referenced this pull request Jun 7, 2026
…urrent state

After the original doc was written, we:
- Added a Theme field (Agentic Framework, Fleet Operations, Compliance, Tooling, Ad hoc) above Initiative for two-level taxonomy.
- Expanded Initiative options with dev-lead agent, pr-review agent, GH-AW, Copilot Instructions, Daily Reports, Org Standards, Initiatives Project.
- Bulk-backfilled ~280 merged PRs from .github + .github-private as Verified items, so the board now reflects 3 months of strategic work history.
- Identified a workflow if: bug (PR #418) where the multi-line folded scalar made the job skip every PR; the doc now references the fix.

The doc body is updated to describe:
- The Theme/Initiative two-level model + the Theme→Initiative table
- The Org Standards bucket scope (CI / CODEOWNERS / rulesets / org secrets / org apps)
- That the dev-lead-as-gate signal is transitional; topic labels (#415) is the target

Refs #387, #415, #418

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

This PR fixes the add-to-project.yml workflow so pull_request_target runs are no longer silently skipped due to a multi-line ${{ }} expression under a YAML folded scalar in the add-issue-or-pr job’s if: condition. This aligns with the Initiatives Project pilot requirements by restoring auto-add behavior for trusted PR authors.

Changes:

  • Inlines the add-issue-or-pr job if: expression onto a single line to ensure GitHub Actions evaluates it correctly.
  • Keeps the gating semantics unchanged (issues always allowed; PRs allowed only for trusted author_association values).

@don-petry
don-petry requested a review from donpetry-bot June 7, 2026 17:35
@donpetry-bot

Copy link
Copy Markdown
Contributor

@don-petry assigned me as reviewer — starting a fresh review now. Results will appear in a few minutes.

donpetry-bot
donpetry-bot previously approved these changes Jun 7, 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: 03eeb7df857c2dc6715522f7115d70569eadd026
Review mode: triage-approved (single reviewer)

Summary

One-line YAML fix in .github/workflows/add-to-project.yml: the add-issue-or-pr job's if: is collapsed from a folded-scalar (>-) multi-line ${{ }} expression into a single line. The expression is character-identical to the prior form, so the fork-PR security gate (issues always allowed; pull_request_target allowed only when author_association ∈ {OWNER, MEMBER, COLLABORATOR}) is preserved. The change resolves an observed bug where pull_request_target runs were silently SKIPPED even for trusted authors — consistent with known GitHub Actions evaluator quirks on multi-line folded-scalar if: expressions. Inlined length is 197 chars, under yamllint's 200-char cap.

Linked issue analysis

No Closes references; the PR body links #387 (tracking) and #415 (follow-on for multi-repo + reconciliation parity). The fix is appropriately scoped to a single-line correction and does not attempt to absorb either tracking item.

Findings

None. Diff is 1 addition / 4 deletions across a single workflow file; semantics are byte-for-byte preserved on the gating expression.

CI status

All required checks green: CodeQL, ShellCheck (bats + CI), SonarCloud (Quality Gate passed, 0 issues, 0 hotspots), AgentShield, Lint, Secret scan (gitleaks), Agent Security Scan, Dependency audit, pr-auto-review. The add-issue-or-pr / reconcile-discussion check runs on this PR show as SKIPPED — that is exactly the bug being fixed (the workflow definition that runs for pull_request_target is from main, which still carries the broken folded-scalar form; the fix only takes effect after merge). Copilot left a non-blocking review comment; CodeRabbit was rate-limited; Gemini reported unsupported file types — none indicate a blocker.


Reviewed automatically by the PR-review agent (claude-opus-4-7-single). Reply if you need a human review.

donpetry-bot
donpetry-bot previously approved these changes Jun 7, 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: 03eeb7df857c2dc6715522f7115d70569eadd026
Cascade: triage → deep (triage: haiku 4.5 → deep: sonnet 4.6 + duck: o4-mini → audit: opus 4.7)

Summary

The diff is a pure formatting fix: a YAML folded-scalar (>-) multi-line ${{ }} expression in a pull_request_target workflow if: condition is collapsed to a single 189-character line. The fork-PR security gate (issues always allowed; PRs gated on author_association ∈ {OWNER, MEMBER, COLLABORATOR}) is byte-for-byte identical after the change. All required CI checks pass (CodeQL, ShellCheck, SonarCloud 0 issues/0 hotspots, gitleaks, AgentShield, Lint, Agent Security Scan, Dependency audit); the SKIPPED add-issue-or-pr / reconcile-discussion runs are expected because pull_request_target evaluates the workflow from the base branch (main), which still has the broken folded-scalar form. No new permissions, secrets, or untrusted-input paths are introduced.

Findings

  • INFO: Single-line expression (189 chars) is within the 200-char yamllint line-length cap declared in the PR body.
  • INFO: add-issue-or-pr and reconcile-discussion jobs show SKIPPED on this PR — expected, because pull_request_target workflows execute from the base ref (main), which still carries the broken folded-scalar. The fix only takes effect post-merge.

Reviewed by the PR-review cascade (triage: haiku 4.5 → deep: sonnet 4.6 + duck: o4-mini → audit: opus 4.7). Reply if you need a human review.

@donpetry-bot
donpetry-bot dismissed their stale review June 7, 2026 17:41

Superseded by automated re-review at 03eeb7d.

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

Summary

Pure YAML formatting fix in .github/workflows/add-to-project.yml: the add-issue-or-pr job's if: expression is collapsed from a folded-scalar (>-) multi-line ${{ }} into a single 197-char line. The fork-PR security gate (issues always allowed; pull_request_target gated on author_association ∈ {OWNER, MEMBER, COLLABORATOR}) is character-identical after the change. This resolves an observed bug — run 27094298629 on PR #417 skipped both jobs at 13:44:21Z despite author_association == MEMBER — consistent with known GitHub Actions evaluator quirks on multi-line folded-scalar if: expressions. Triage assessment confirmed.

Linked issue analysis

No Closes references. The PR body cites #387 (tracking) and #415 (multi-repo + reconciliation parity follow-on). Scope is appropriately limited to the single-line correction and does not attempt to absorb either tracking item.

Findings

None blocking.

  • INFO: Inlined expression is 197 chars, under the 200-char yamllint cap declared in the workflow.
  • INFO: The add-issue-or-pr and reconcile-discussion check runs on this PR show SKIPPED — expected, because pull_request_target evaluates the workflow from the base ref (main), which still carries the broken folded-scalar form. The fix only takes effect post-merge; the PR's test plan correctly proposes a post-merge smoke test.

CI status

All required checks green: CodeQL (Analyze actions), ShellCheck (CI + Add to Project Tests bats), SonarCloud (Quality Gate passed, 0 new issues, 0 hotspots, 0% duplication), Secret scan (gitleaks), AgentShield, Lint, Agent Security Scan, Dependency audit (Detect ecosystems), pr-auto-review check-and-dispatch, CodeRabbit status. Copilot left a non-blocking COMMENTED review; CodeRabbit was rate-limited; Gemini reported unsupported file types — none indicate a blocker. A prior cascade review on this same SHA also landed at APPROVED.


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

@donpetry-bot
donpetry-bot dismissed their stale review June 7, 2026 17:43

Superseded by automated re-review at 03eeb7d.

@donpetry-bot

Copy link
Copy Markdown
Contributor

Automated review — human attention needed

This PR has been through 3 automated review cycles (cap: 3) without converging on an approval-and-merge state. Further automated review has been paused to avoid infinite loops.

Please take a look manually, or close this PR if it's no longer needed. Once a human review resolves the situation, remove the needs-human-review label and the cascade can be re-engaged on the next push.

Posted by the donpetry-bot PR-review cascade.

@donpetry-bot
donpetry-bot requested a review from a team June 7, 2026 17:44
@don-petry
don-petry merged commit fba115e into main Jun 7, 2026
36 checks passed
@don-petry
don-petry deleted the fix/add-to-project-if-condition branch June 7, 2026 21:57
don-petry added a commit that referenced this pull request Jun 8, 2026
* docs(standards): add Initiatives Project operator guide

Operator-facing documentation for the Initiatives Project pilot (#387) —
covers what belongs on the board, the noise gate, the discussion state
machine, the field schema, the four views, the auto-add internals, and
the deferred multi-repo work tracked in #415.

Lands in standards/ to match the existing governance-doc pattern
(agent-standards.md, ci-standards.md, codeowners-standard.md, etc.).

Refs #387, addresses the documentation acceptance criterion.

* docs(standards): add Theme field + expanded Initiatives, update for current state

After the original doc was written, we:
- Added a Theme field (Agentic Framework, Fleet Operations, Compliance, Tooling, Ad hoc) above Initiative for two-level taxonomy.
- Expanded Initiative options with dev-lead agent, pr-review agent, GH-AW, Copilot Instructions, Daily Reports, Org Standards, Initiatives Project.
- Bulk-backfilled ~280 merged PRs from .github + .github-private as Verified items, so the board now reflects 3 months of strategic work history.
- Identified a workflow if: bug (PR #418) where the multi-line folded scalar made the job skip every PR; the doc now references the fix.

The doc body is updated to describe:
- The Theme/Initiative two-level model + the Theme→Initiative table
- The Org Standards bucket scope (CI / CODEOWNERS / rulesets / org secrets / org apps)
- That the dev-lead-as-gate signal is transitional; topic labels (#415) is the target

Refs #387, #415, #418

* docs(standards): wrap long lines, language-tag the file-tree code fence, simplify manual-add snippet

Fixes 10 markdownlint errors on the previous push (78088f5):
- MD013/line-length (8 lines >200) — wrap paragraphs and the noise-gate
  blockquote; shorten verbose table cells; format the deferred-work and
  Related lists with line breaks.
- MD040/fenced-code-language — tag the file-tree code fence as 'text'.

Addresses the 3-reviewer consensus (Gemini / Copilot / Codex on PR #417)
that the manual-add snippet's GraphQL 'issue(number)' field only matches
issues, not PRs. Replaced with the REST 'gh api repos/.../issues/<n>'
form which returns the node_id for BOTH issues and PRs (PRs are issues
in GitHub's data model) — simpler and correct.

* docs(standards): use issueOrPullRequest GraphQL for the manual-add node-ID lookup

Codex P2 on PR #417 da33440: REST '/issues/<n>' returns the Issue-typed
node_id even for PRs, which is the wrong content type for
addProjectV2ItemById — that mutation wants the PullRequest-typed
node_id for PRs. issueOrPullRequest returns the correct type-specific
node ID for both, with one query and one round-trip.

This was the original 3-reviewer consensus (Gemini / Copilot / Codex on
the first version of this PR). My da33440 cut a corner with REST that
ended up being subtly wrong for PRs; this commit restores the
canonically-correct GraphQL form.

* docs(standards): use issueOrPullRequest GraphQL for the manual-add node-ID lookup

Codex P2 on PR #417 da33440: REST '/issues/<n>' returns the Issue-typed
node_id even for PRs. addProjectV2ItemById takes a ProjectV2ItemContent
union (Issue OR PullRequest) and wants the content-specific node id —
passing an Issue id for what is actually a PR is the wrong content type.

issueOrPullRequest returns the type-correct id for both with one query.
This was the original 3-reviewer consensus (Gemini / Copilot / Codex on
the first version of this PR).
don-petry added a commit that referenced this pull request Jun 11, 2026
… skipped) (#418)

fix(workflows): inline if-condition on add-issue-or-pr so it actually fires for legitimate PRs

Previously the if: used a YAML folded scalar (>-) for a multi-line
${{ }} expression. On main, that resulted in the job being SKIPPED for
every pull_request_target event — including PRs from a MEMBER author
where the expression should evaluate true. Observed on PR #417 (the
docs PR): run 27094298629 skipped both jobs at 13:44:21Z despite
authorAssociation == MEMBER being in the allowlist.

The fix is to put the if: expression on a single line. Length is 197
chars (yamllint line-length cap is 200, so it fits).
don-petry added a commit that referenced this pull request Jun 11, 2026
* docs(standards): add Initiatives Project operator guide

Operator-facing documentation for the Initiatives Project pilot (#387) —
covers what belongs on the board, the noise gate, the discussion state
machine, the field schema, the four views, the auto-add internals, and
the deferred multi-repo work tracked in #415.

Lands in standards/ to match the existing governance-doc pattern
(agent-standards.md, ci-standards.md, codeowners-standard.md, etc.).

Refs #387, addresses the documentation acceptance criterion.

* docs(standards): add Theme field + expanded Initiatives, update for current state

After the original doc was written, we:
- Added a Theme field (Agentic Framework, Fleet Operations, Compliance, Tooling, Ad hoc) above Initiative for two-level taxonomy.
- Expanded Initiative options with dev-lead agent, pr-review agent, GH-AW, Copilot Instructions, Daily Reports, Org Standards, Initiatives Project.
- Bulk-backfilled ~280 merged PRs from .github + .github-private as Verified items, so the board now reflects 3 months of strategic work history.
- Identified a workflow if: bug (PR #418) where the multi-line folded scalar made the job skip every PR; the doc now references the fix.

The doc body is updated to describe:
- The Theme/Initiative two-level model + the Theme→Initiative table
- The Org Standards bucket scope (CI / CODEOWNERS / rulesets / org secrets / org apps)
- That the dev-lead-as-gate signal is transitional; topic labels (#415) is the target

Refs #387, #415, #418

* docs(standards): wrap long lines, language-tag the file-tree code fence, simplify manual-add snippet

Fixes 10 markdownlint errors on the previous push (78088f5):
- MD013/line-length (8 lines >200) — wrap paragraphs and the noise-gate
  blockquote; shorten verbose table cells; format the deferred-work and
  Related lists with line breaks.
- MD040/fenced-code-language — tag the file-tree code fence as 'text'.

Addresses the 3-reviewer consensus (Gemini / Copilot / Codex on PR #417)
that the manual-add snippet's GraphQL 'issue(number)' field only matches
issues, not PRs. Replaced with the REST 'gh api repos/.../issues/<n>'
form which returns the node_id for BOTH issues and PRs (PRs are issues
in GitHub's data model) — simpler and correct.

* docs(standards): use issueOrPullRequest GraphQL for the manual-add node-ID lookup

Codex P2 on PR #417 da33440: REST '/issues/<n>' returns the Issue-typed
node_id even for PRs, which is the wrong content type for
addProjectV2ItemById — that mutation wants the PullRequest-typed
node_id for PRs. issueOrPullRequest returns the correct type-specific
node ID for both, with one query and one round-trip.

This was the original 3-reviewer consensus (Gemini / Copilot / Codex on
the first version of this PR). My da33440 cut a corner with REST that
ended up being subtly wrong for PRs; this commit restores the
canonically-correct GraphQL form.

* docs(standards): use issueOrPullRequest GraphQL for the manual-add node-ID lookup

Codex P2 on PR #417 da33440: REST '/issues/<n>' returns the Issue-typed
node_id even for PRs. addProjectV2ItemById takes a ProjectV2ItemContent
union (Issue OR PullRequest) and wants the content-specific node id —
passing an Issue id for what is actually a PR is the wrong content type.

issueOrPullRequest returns the type-correct id for both with one query.
This was the original 3-reviewer consensus (Gemini / Copilot / Codex on
the first version of this PR).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-lead For dev-lead agent pickup needs-human-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants