Skip to content

feat: implement issue #393 — Compliance: missing-permissions-issue-triage-runner.yml - #485

Merged
don-petry merged 4 commits into
mainfrom
dev-lead/issue-393-20260608-0055
Jun 8, 2026
Merged

don-petry merged 4 commits into
mainfrom
dev-lead/issue-393-20260608-0055

Conversation

@don-petry

@don-petry don-petry commented Jun 8, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #393

Implemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • Tests

    • Added integration testing to verify secure GitHub Actions workflow configurations.
  • Chores

    • Enhanced security by implementing least-privilege permissions for automated workflows, restricting token access at the top level while maintaining scoped permissions for individual jobs.

Copilot AI review requested due to automatic review settings June 8, 2026 00:59
@don-petry
don-petry requested a review from a team as a code owner June 8, 2026 00:59
@coderabbitai

coderabbitai Bot commented Jun 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

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 38 minutes and 47 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: d43dabae-b058-48e3-8d98-2978f271c139

📥 Commits

Reviewing files that changed from the base of the PR and between 00b7892 and 288b863.

📒 Files selected for processing (2)
  • .github/workflows/test-dev-lead.yml
  • tests/dev-lead/integration/test_workflow_toplevel_permissions.py
📝 Walkthrough

Walkthrough

This PR addresses a compliance finding by adding a top-level permissions: {} declaration to the issue-triage-runner workflow to enforce least-privilege token access. It also introduces automated validation to prevent future regression: a new test job runs a Python script that checks for the required declaration.

Changes

Workflow Permissions Compliance

Layer / File(s) Summary
Top-level permissions declaration for issue-triage-runner
.github/workflows/issue-triage-runner.yml
Adds permissions: {} at the workflow root to clear default token permissions, leaving only job-level permissions blocks (issues: read for triage, issues: write for apply) in effect.
Compliance validation test job and script
.github/workflows/test-dev-lead.yml, tests/dev-lead/integration/test_workflow_toplevel_permissions.py
Introduces a toplevel-permissions job that installs PyYAML and runs a new test script. The script loads the workflow YAML, validates the required top-level permissions: key exists, and reports structured failure messages with remediation guidance.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • petry-projects/.github-private#284: Introduced the original issue-triage-runner.yml workflow and its job-level permissions configuration that this PR now complements with a top-level permissions reset.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly references issue #393 and accurately describes the main change: adding a top-level permissions declaration to the issue-triage-runner.yml workflow file for compliance.
Linked Issues check ✅ Passed The pull request successfully implements the compliance requirement from issue #393 by adding a top-level permissions declaration to the issue-triage-runner.yml workflow, along with a test to validate the requirement.
Out of Scope Changes check ✅ Passed All changes are directly related to resolving issue #393: the workflow modification adds the required permissions declaration, the test workflow validates it, and the integration test ensures the requirement is met.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-393-20260608-0055

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 introduces a new integration test script, test_workflow_toplevel_permissions.py, to verify that the issue-triage-runner.yml workflow includes a top-level permissions: declaration in accordance with the organization's least-privilege policy. The reviewer pointed out a minor issue where double curly braces {{}} are used in a non-f-string literal, which will cause them to be printed literally instead of as {}.

Comment thread tests/dev-lead/integration/test_workflow_toplevel_permissions.py Outdated

@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: 50a28214ab

ℹ️ 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 tests/dev-lead/integration/test_workflow_toplevel_permissions.py

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — rate-limited (intent: review-changes)

PR: #485
The retry cron will re-attempt automatically.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Note

@don-petry I received your request but all AI engines are currently rate-limited. I'll retry automatically once the rate limit clears.
Rate limit resets at: unknown

@don-petry
don-petry enabled auto-merge (squash) June 8, 2026 01:32
@don-petry
don-petry disabled auto-merge June 8, 2026 05:00
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry
don-petry enabled auto-merge (squash) June 8, 2026 05:02
@don-petry
don-petry disabled auto-merge June 8, 2026 05:02

@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: 00b7892dc6

ℹ️ 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 .github/workflows/test-dev-lead.yml
@don-petry

Copy link
Copy Markdown
Collaborator Author

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

PR: #485
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-08T05:34:42Z

@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-08T05:34:42Z

@don-petry
don-petry enabled auto-merge (squash) June 8, 2026 05:04

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test-dev-lead.yml:
- Line 103: The checkout step currently using "uses:
actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10" should explicitly
disable credential persistence; modify that step to include the key
"persist-credentials: false" so the action does not keep the workflow token in
the workspace and aligns with least-privilege hardening.
- Around line 98-107: The validation job "toplevel-permissions" isn't triggered
for changes to .github/workflows/issue-triage-runner.yml because the workflow's
on.push.paths and on.pull_request.paths exclude that file; update the workflow
trigger filters so the guard runs when the validated workflow changes — either
add ".github/workflows/issue-triage-runner.yml" to the on.push.paths and
on.pull_request.paths lists or remove/relax the path filters entirely so the
"toplevel-permissions" validation step executes for commits/PRs that modify that
workflow file.

In `@tests/dev-lead/integration/test_workflow_toplevel_permissions.py`:
- Around line 36-43: The current check only ensures the top-level "permissions"
key exists but doesn't validate its value; change the guard so that in addition
to checking "permissions" in doc it verifies the value is the least-privilege
form (e.g., an empty mapping or explicit none/read-only entries as your policy
requires) instead of permissive forms like "write-all". Update the conditional
around doc and WORKFLOW to reject non-empty or broad permission values and log
the same failure message when doc["permissions"] is not the approved minimal
structure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b0751a38-2892-40a3-b7d7-75b1fb1b6a5f

📥 Commits

Reviewing files that changed from the base of the PR and between 395c3ad and 00b7892.

📒 Files selected for processing (3)
  • .github/workflows/issue-triage-runner.yml
  • .github/workflows/test-dev-lead.yml
  • tests/dev-lead/integration/test_workflow_toplevel_permissions.py

Comment thread .github/workflows/test-dev-lead.yml
Comment thread .github/workflows/test-dev-lead.yml
Comment thread tests/dev-lead/integration/test_workflow_toplevel_permissions.py
@don-petry
don-petry disabled auto-merge June 8, 2026 05:07
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 8, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@don-petry

Copy link
Copy Markdown
Collaborator Author

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

PR: #485
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-08T05:43:36Z

@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-08T05:43:36Z

@don-petry
don-petry enabled auto-merge (squash) June 8, 2026 05:13
@don-petry
don-petry disabled auto-merge June 8, 2026 05:23
@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

@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 8, 2026 05:26

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

Summary

This PR brings issue-triage-runner.yml into compliance with the org least-privilege policy by adding a top-level permissions: {} reset, and adds a regression-guard integration test (test_workflow_toplevel_permissions.py) wired into the test-dev-lead.yml CI job. The change is small (3 files, +74/-0), purely a security/compliance hardening, and does not alter runtime behavior of the triage workflow — each job already declares its own scoped permissions: block.

Linked issue analysis

Closes #393 (Compliance: missing-permissions-issue-triage-runner.yml). The remediation requested by the weekly compliance audit — adding a top-level permissions: declaration so GitHub's default write-all grant is not silently inherited — is implemented exactly as the standard prescribes (permissions: {} before jobs:). The added test additionally enforces the exact empty-mapping value, so future regressions to write-all/read-all would also fail CI.

Findings

All prior review feedback on this PR has been addressed on the head commit:

  • gemini-code-assist ({{}} vs {} in a non-f-string error message): fixed.
  • chatgpt-codex / CodeRabbit (validation job not triggered by changes to the workflow it validates): .github/workflows/issue-triage-runner.yml is now included in both on.pull_request.paths and on.push.paths filters of test-dev-lead.yml.
  • CodeRabbit (persist-credentials: false missing on new checkout): added to the toplevel-permissions job checkout step.
  • CodeRabbit (key-presence check accepts write-all/other broad values): now also asserts doc.get("permissions") == {}, rejecting any non-empty mapping.

No new issues identified. No secrets, credentials, migrations, or risky surface touched. New Python test is small, self-contained, and uses yaml.safe_load.

CI status

All required checks green: Lint, ShellCheck, bats, unit-tests, validate-agent-profiles, Compile agentic workflows, gh-aw-compile, Agent Security Scan, Secret scan (gitleaks), CodeQL (actions + python), SonarCloud, AgentShield, dependency-audit, CodeRabbit. Dependabot and unrelated audits correctly SKIPPED. mergeStateStatus: BLOCKED reflects only the outstanding human review-team request, not a failing check.


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

@don-petry
don-petry merged commit 8f55465 into main Jun 8, 2026
27 checks passed
@don-petry
don-petry deleted the dev-lead/issue-393-20260608-0055 branch June 8, 2026 05:32
don-petry added a commit that referenced this pull request Jun 12, 2026
…iage-runner.yml (#485)

* feat: implement issue #393 — Compliance: missing-permissions-issue-triage-runner.yml

* chore: apply manual instructions [skip ci-relay]

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 14, 2026
…iage-runner.yml (#485)

* feat: implement issue #393 — Compliance: missing-permissions-issue-triage-runner.yml

* chore: apply manual instructions [skip ci-relay]

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 18, 2026
…iage-runner.yml (#485)

* feat: implement issue #393 — Compliance: missing-permissions-issue-triage-runner.yml

* chore: apply manual instructions [skip ci-relay]

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 25, 2026
…iage-runner.yml (#485)

* feat: implement issue #393 — Compliance: missing-permissions-issue-triage-runner.yml

* chore: apply manual instructions [skip ci-relay]

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 25, 2026
…iage-runner.yml (#485)

* feat: implement issue #393 — Compliance: missing-permissions-issue-triage-runner.yml

* chore: apply manual instructions [skip ci-relay]

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
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.

Compliance: missing-permissions-issue-triage-runner.yml

3 participants