Skip to content

feat: implement issue #398 — Compliance audit — 2026-06-05#401

Merged
don-petry merged 9 commits into
mainfrom
dev-lead/issue-398-20260606-1407
Jun 11, 2026
Merged

feat: implement issue #398 — Compliance audit — 2026-06-05#401
don-petry merged 9 commits into
mainfrom
dev-lead/issue-398-20260606-1407

Conversation

@don-petry

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

Copy link
Copy Markdown
Contributor

Part of #398 — addresses the copilot-setup-steps-invalid-job-name finding for petry-projects/.github.\n\nImplemented by dev-lead agent. Please review.

Summary by CodeRabbit

  • Chores
    • Improved CI workflow to run only when relevant setup files change.
    • Added deterministic environment setup steps, including system tooling and pinned Python dependencies.
    • Enhanced environment verification to report repository/ref/runner details and enforce presence of required instructions.

Copilot AI review requested due to automatic review settings June 6, 2026 14:15
@don-petry don-petry requested a review from a team as a code owner June 6, 2026 14:15
@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b798d7cd-c843-4006-b362-662b618614bc

📥 Commits

Reviewing files that changed from the base of the PR and between c77b7dc and 4fe9871.

📒 Files selected for processing (3)
  • .github/workflows/copilot-setup-steps.yml
  • scripts/copilot-requirements.txt
  • standards/workflows/copilot-setup-steps.yml

📝 Walkthrough

Walkthrough

Narrow Copilot workflow PR trigger to include scripts/copilot-requirements.txt, add a pinned hashed requirements file, replace commented templates with deterministic apt and pip installs in the job, and update environment verification to print runtime env vars.

Changes

Copilot Setup Workflow and Dependencies

Layer / File(s) Summary
Workflow trigger and header
.github/workflows/copilot-setup-steps.yml
pull_request.paths now includes .github/workflows/copilot-setup-steps.yml and scripts/copilot-requirements.txt; top-level defensive permissions remain.
Pinned requirements file
scripts/copilot-requirements.txt
New --require-hashes-style requirements listing attrs, jsonschema==4.23.0, jsonschema-specifications, referencing, rpds-py, typing-extensions with SHA-256 hashes and file header comments explaining regeneration.
Job dependency installs and verification
.github/workflows/copilot-setup-steps.yml, standards/workflows/copilot-setup-steps.yml
Job replaces commented stack templates with deterministic installs: apt packages (bats, shellcheck, jq) and a hashed pip install -r scripts/copilot-requirements.txt; verify step now echoes GITHUB_REPOSITORY, GITHUB_REF, RUNNER_OS, RUNNER_ARCH and retains AGENTS.md hard-fail and optional instruction file checks.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title references issue #398 and mentions 'Compliance audit' but the actual changes focus on narrowing workflow triggers, pinning transitive dependencies, and hardening CI steps—not a general compliance audit. Consider a more specific title that reflects the concrete changes, such as 'fix: pin transitive dependencies and harden copilot-setup-steps workflow' or 'fix: resolve unpinned transitive dependencies causing CI failures'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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-398-20260606-1407

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

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.

@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
Files changed: none
Skipped (informational): 0
Notes: No actionable issues found. All CI checks pass (Agent Security Scan, CodeQL,
Lint, ShellCheck, SonarCloud, Secret scan all green). No open review threads from
the bot. No Tier 1 blockers present. PR is clean.
```

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

Summary

Adds .github/workflows/copilot-setup-steps.yml (81 lines, single new file) derived from the org standards template at standards/workflows/copilot-setup-steps.yml. The job is named exactly copilot-setup-steps (the GitHub-required name that issue #398 flagged as missing), the language-stack blocks are correctly deleted because the .github repo is shell-only, and the verify step retains the env-validation safeguards from the template.

Linked issue analysis

Closes #398 — the umbrella 2026-06-05 compliance audit. This PR specifically addresses the copilot-setup-steps-invalid-job-name (error) finding for the petry-projects/.github repo. Other .github-repo findings in #398 (check-suite auto-trigger app_ids 1236702/347564, secret_scanning_ai_detection, secret_scanning_non_provider_patterns) are API-level repository settings and are handled out-of-band via apply-repo-settings.sh and a direct PATCH call, as documented in the implementation comment on the issue. CODEOWNERS findings were verified stale (catch-all and org-leads ordering already correct).

Findings

Security: No concerns.

  • Top-level permissions: {} (defense-in-depth reset).
  • Job-level permissions: contents: read (minimum required).
  • actions/checkout pinned to SHA de0fac2e4500dabe0009e67214ff5f5447ce83dd (v6.0.2).
  • Fork-PR guard on github.event.pull_request.head.repo.fork correctly prevents secret exposure for external forks while allowing direct pushes and workflow_dispatch.
  • No use of pull_request_target, no script injection vectors, no untrusted input interpolation.

Correctness: Looks good.

  • Job name copilot-setup-steps matches GitHub's hard requirement for Copilot cloud-agent recognition.
  • Path-scoped push/pull_request triggers (.github/workflows/copilot-setup-steps.yml) keep this off the standard CI hot path — correct per the template's inline warning.
  • timeout-minutes: 30 is within the 59-minute hard maximum.
  • Verify step uses set-less bash but each command is guarded with || echo "... not installed"; only the AGENTS.md check intentionally exit 1s, which is the correct fail-loud semantic.
  • Stack-specific install blocks are deleted (not commented out) per the template's instruction #4 — appropriate for this shell-only repo.

Maintainability: Clean.

  • File is a faithful subset of the standards template; no drift introduced.
  • Comments retained from the template explain non-obvious choices (fork guard rationale, timeout cap, top-level permissions reset).

CI status

All required checks green:

  • AgentShield — SUCCESS
  • CodeQL (actions) — SUCCESS
  • Lint, ShellCheck, Agent Security Scan, Secret scan (gitleaks) — SUCCESS
  • SonarCloud / SonarCloud Code Analysis — SUCCESS (Quality Gate passed, 0 new issues)
  • Copilot Setup Steps (self-run) — SUCCESS
  • Dependency audit ecosystem detection — SUCCESS (other ecosystem jobs correctly SKIPPED for this shell-only repo)

No open review threads. CodeRabbit was rate-limited and did not comment; Gemini skipped due to unsupported file types. Neither blocks approval given clean static-analysis coverage from CodeQL, SonarCloud, and AgentShield.


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

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

Adds a copilot-setup-steps.yml workflow so Copilot cloud agent sessions can run standardized pre-flight setup/verification in this standards repository, aligning with the compliance audit’s agent-setup requirements.

Changes:

  • Added .github/workflows/copilot-setup-steps.yml with the required copilot-setup-steps job.
  • Included a minimal setup (checkout) plus a “Verify environment” step that validates presence of AGENTS.md and prints key tool versions.

Comment thread .github/workflows/copilot-setup-steps.yml
donpetry-bot
donpetry-bot previously approved these changes Jun 6, 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: e4452174821181098127b866a125b85aca05b964
Review mode: triage-approved (single reviewer)

Summary

Adds a single new file, .github/workflows/copilot-setup-steps.yml (81 lines), derived from the org standards template. The job is named exactly copilot-setup-steps (the GitHub-required name for Copilot cloud-agent recognition that issue #398 flagged as missing), stack-specific install blocks are deleted because this is a shell-only repo, and the verify step retains the template's env-validation safeguards. Triage tier already cleared this PR as low-risk; this confirmation pass agrees.

Linked issue analysis

Closes #398 — the 2026-06-05 compliance audit umbrella issue. This PR specifically addresses the copilot-setup-steps-invalid-job-name (error) finding for the petry-projects/.github repo. Other .github-repo findings in #398 (secret_scanning_ai_detection, secret_scanning_non_provider_patterns, check-suite auto-trigger app_ids, CODEOWNERS items) are API-level repository settings handled out-of-band via apply-repo-settings.sh, as expected for the audit's remediation breakdown.

Findings

Security: No concerns.

  • Top-level permissions: {} (defense-in-depth reset).
  • Job-level permissions: contents: read (minimum required for checkout).
  • actions/checkout SHA-pinned to de0fac2e4500dabe0009e67214ff5f5447ce83dd (v6.0.2).
  • Fork-PR guard on github.event.pull_request.head.repo.fork == false correctly prevents secret exposure on external forks while allowing direct pushes and workflow_dispatch.
  • No pull_request_target, no untrusted-input interpolation, no script-injection vectors.

Correctness: Looks good.

  • Job name copilot-setup-steps matches GitHub's hard requirement (the exact finding from #398).
  • push/pull_request triggers are path-scoped to this file only, so the workflow stays off the standard CI hot path — correct per the template's inline warning.
  • timeout-minutes: 30 is within the 59-minute hard maximum.
  • Verify step uses per-command || echo "... not installed" guards; only the AGENTS.md check intentionally exit 1s, which is the right fail-loud semantic for a required file.
  • Language-stack install blocks are deleted (not commented-out) — appropriate for this shell-only repo and consistent with the template's instructions.

Maintainability: Clean.

  • File is a faithful subset of the standards template; no drift introduced.
  • Comments retained from the template explain non-obvious choices (fork guard rationale, timeout cap, top-level permissions reset).

CI status

All required checks green:

  • AgentShield, CodeQL (actions), Lint, ShellCheck, Agent Security Scan, Secret scan (gitleaks) — SUCCESS
  • SonarCloud / SonarCloud Code Analysis — SUCCESS (Quality Gate passed, 0 new issues)
  • Copilot Setup Steps (self-run) — SUCCESS
  • Dependency audit ecosystem detection — SUCCESS (npm/pnpm/pip/cargo/govulncheck correctly SKIPPED for this shell-only repo)

No open review threads. CodeRabbit was rate-limited and did not comment; Gemini skipped due to unsupported file types — neither blocks approval given clean coverage from CodeQL, SonarCloud, and AgentShield. Copilot's reviewer left a descriptive (COMMENTED, non-blocking) overview with no change requests.


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 6, 2026 14:22

Superseded by automated re-review at e445217.

@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: 837f5b3561

ℹ️ 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/copilot-setup-steps.yml
@don-petry

Copy link
Copy Markdown
Contributor Author

@dev-lead please process and advance this PR — fix any failing CI, resolve outstanding review threads, and enable auto-merge once it's green and approvable.

@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: e387f02043

ℹ️ 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/copilot-setup-steps.yml
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

Comment thread .github/workflows/copilot-setup-steps.yml Fixed
Comment thread .github/workflows/copilot-setup-steps.yml Fixed
@don-petry don-petry disabled auto-merge June 8, 2026 21:54
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — review-changes (applied)

Changes committed and pushed.

@don-petry don-petry enabled auto-merge (squash) June 8, 2026 21:57
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 8, 2026

@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: f890f7482f

ℹ️ 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/copilot-setup-steps.yml Outdated
@don-petry don-petry disabled auto-merge June 8, 2026 22:00
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

Comment thread .github/workflows/copilot-setup-steps.yml Fixed
@don-petry don-petry disabled auto-merge June 8, 2026 22:06
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@don-petry

Copy link
Copy Markdown
Contributor Author

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

No changes were needed for this PR.

@don-petry don-petry enabled auto-merge (squash) June 11, 2026 12:18
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@don-petry don-petry disabled auto-merge June 11, 2026 12:24
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
**Bot:** SonarCloud Quality Gate  
**Issues addressed:** 0
**Status:**
- ✅ SonarCloud quality gate: **PASSED** (0 new issues, 0 security hotspots)
- ✅ CodeRabbit findings: **ALREADY FIXED** (review marked DISMISSED)
  - `persist-credentials: false` is present
  - Environment variables use safe shell expansion, not GitHub Actions expressions
- ✅ No Tier 1 blockers: No failed checks, no `CHANGES_REQUESTED` reviews
- ⏳ Other CI checks: Still queued, no failures
**Files:** No changes needed — the PR already contains all required fixes.

@don-petry don-petry enabled auto-merge (squash) June 11, 2026 12:24
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@don-petry don-petry disabled auto-merge June 11, 2026 12:37
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
Issues addressed: 0
- Codex usage limits notification: Not an actionable code issue (informational only)
- CodeRabbit findings: Already fixed in prior commits
Files changed: None
Skipped (informational): 1 (Codex usage limit notification)
```
**Conclusion**: No code changes needed. The PR is clean with no outstanding Tier 1 blockers. All prior review findings from CodeRabbit have been resolved, and the PR is approved with low risk.

@don-petry don-petry enabled auto-merge (squash) June 11, 2026 12:38
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@don-petry don-petry disabled auto-merge June 11, 2026 12:48
@don-petry

Copy link
Copy Markdown
Contributor Author

Dev-Lead — fix-bot-comment (no-changes)

Agent reasoning
## Result
**No action needed.** All code issues have been addressed and verified:
| Issue | Status |
|-------|--------|
| Persist-credentials hardening | ✅ Fixed & thread resolved |
| Script injection (env vars) | ✅ Fixed & thread resolved |
| Test dependencies missing | ✅ Fixed & thread resolved |
| Unverified Python dependencies | ✅ Fixed & thread resolved |
**Files verified:** `.github/workflows/copilot-setup-steps.yml`, `standards/workflows/copilot-setup-steps.yml`, `scripts/copilot-requirements.txt`
The PR is ready for merge pending any remaining GitHub requirements or process checks.

@don-petry don-petry enabled auto-merge (squash) June 11, 2026 12:49
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@don-petry don-petry disabled auto-merge June 11, 2026 13:06
@don-petry

Copy link
Copy Markdown
Contributor Author

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

No changes were needed for this PR.

@don-petry don-petry enabled auto-merge (squash) June 11, 2026 13:07

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

Summary

Cleans up the Copilot setup-steps workflow: removes commented-out optional installer blocks, adds the repo's bats/shellcheck/jq/jsonschema test dependencies (Python deps SHA-pinned with --require-hashes), and tightens checkout (persist-credentials: false) plus shell echo (env vars instead of ${{ github.* }} expressions). Standards mirror updated. Part of compliance-audit #398.

Linked issue analysis

PR body references #398 ("Part of #398") for the copilot-setup-steps-invalid-job-name finding. closingIssuesReferences is empty (intentional — the umbrella audit issue is already closed). Diff is consistent with the agent-standards remediation category in #398. No deviation from scope.

Findings

  • Net security improvement: persist-credentials: false on checkout, GitHub context interpolation replaced with environment variable expansion in echo (avoids shell-context expression injection).
  • Python deps pinned with SHA-256 hashes and installed with --require-hashes --only-binary :all: — satisfies supply-chain integrity, matches SonarCloud verified-versions requirement.
  • The prior chatgpt-codex-connector advisory (P2, 2026-06-07: "install repo test dependencies before verification") is directly addressed by the new bats/shellcheck/jq apt step and Python jsonschema pip step. Gemini's note ("file types unsupported") and Codex's quota message are non-actionable.
  • Other advisory bots: SonarCloud Quality Gate passed (0 new issues). CodeQL, AgentShield, gitleaks, Agent Security Scan all SUCCESS.
  • Minor observation (not blocking): no actions/setup-python pinning the interpreter before the pip install — relies on the runner's default Python. Acceptable because --only-binary :all: requires wheels, but worth flagging if the runner Python ever drifts.

CI status

All required checks green. Skipped checks (dependabot-automerge, npm/pnpm/cargo/pip/govulncheck audits, dev-lead ci-relay) are skipped by design for non-matching ecosystems / non-Dependabot PRs. mergeStateStatus is BLOCKED only because reviewDecision is REVIEW_REQUIRED — this approval clears it.


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

@sonarqubecloud

Copy link
Copy Markdown

@don-petry don-petry merged commit 082c4c0 into main Jun 11, 2026
23 of 25 checks passed
@don-petry don-petry deleted the dev-lead/issue-398-20260606-1407 branch June 11, 2026 13:20
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.

4 participants