Skip to content

ci: address review nits on PR allowlist drift check (ARMO + Rapid7)#37

Merged
matthyx merged 1 commit into
mainfrom
gke-allowlist-drift-pr-fixes
Jul 16, 2026
Merged

ci: address review nits on PR allowlist drift check (ARMO + Rapid7)#37
matthyx merged 1 commit into
mainfrom
gke-allowlist-drift-pr-fixes

Conversation

@slashben

@slashben slashben commented Jul 15, 2026

Copy link
Copy Markdown
Member

Follow-up to #36 (already merged), applying the same review nits @matthyx raised on kubescape/helm-charts #878 to the identical workflow here.

  • Advisory, not required — a paths:-filtered workflow can't be a required status check without deadlocking PRs that don't match the filter (they'd hang on "Expected — waiting for status"). Kept it advisory; the doc now says so and how to convert it to a hard gate.
  • Label events — skip the job for label add/remove other than allowlist-drift-ack (was re-running the full check on every label change).
  • Acked drift UX — on acknowledgement, replace the ⚠️ warning comment with an "acknowledged" note instead of leaving a red warning beside a green check.
  • Output hardening — pass the drift report via base64 rather than a fixed GITHUB_OUTPUT heredoc delimiter, so an arbitrary report line can't break or inject step outputs.

Mirrors kubescape/helm-charts#878.

AI-skills: armosec-shared-rules:writing-docs,schedule,loop | cmds: /model,/login,/compact

Same fixes as kubescape/helm-charts #878 (the identical workflow landed here
via #36); applying them here as a follow-up since #36 already merged:

- Keep the check advisory (not a required status): a path-filtered workflow
  can't be required without deadlocking non-matching PRs. Doc updated.
- Skip the job for label events other than allowlist-drift-ack.
- On acknowledged drift, replace the warning comment with an 'acknowledged'
  note instead of leaving a red warning next to a green check.
- Pass the drift report via base64 instead of a fixed GITHUB_OUTPUT heredoc
  delimiter.
Signed-off-by: Ben <ben@armosec.io>
Copilot AI review requested due to automatic review settings July 15, 2026 07:40
@slashben slashben added the ai-assisted Created through Armosec AI tooling (armosec-shared-rules plugin) label Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 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: CHILL

Plan: Pro

Run ID: c17134c7-5967-47cd-a936-82fcb3224987

📥 Commits

Reviewing files that changed from the base of the PR and between b234cde and 711b69f.

📒 Files selected for processing (2)
  • .github/workflows/pr-allowlist-drift.yaml
  • docs/features/gke-autopilot-allowlist-tooling.md

📝 Walkthrough

Walkthrough

The allowlist drift workflow now documents its advisory behavior, skips unrelated label events, and transports drift reports through base64-encoded outputs. Its notification script handles acknowledged pull requests with a success comment and notice, while unacknowledged drift produces a standardized failure. Documentation covers paths filtering, hard-gate conversion, and fork pull request limitations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DriftCheckJob
  participant NotificationScript
  participant PullRequest
  DriftCheckJob->>NotificationScript: Pass encoded drift report and return code
  NotificationScript->>NotificationScript: Decode drift report
  NotificationScript->>PullRequest: Upsert acknowledged comment when label is present
  NotificationScript->>NotificationScript: Fail workflow for unacknowledged drift
Loading

Suggested reviewers: copilot

Poem

A rabbit hops through workflow lines,
Encoding drift in neat designs.
An acking label earns a cheer,
While fresh drift makes failure clear.
Docs explain the paths ahead—
“Hop wisely,” says the bun, well-read.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the workflow updates to the PR allowlist drift check.
Description check ✅ Passed The description matches the workflow and documentation changes described in the changeset.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gke-allowlist-drift-pr-fixes

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.

Copilot AI 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.

Pull request overview

This PR updates the GKE Autopilot allowlist drift PR workflow and its documentation to incorporate review feedback from the upstream kubescape/helm-charts implementation, focusing on clearer guidance (advisory vs required checks), reduced unnecessary reruns on label changes, improved “acknowledged drift” UX, and safer report handling.

Changes:

  • Document that the PR drift check must remain advisory while a paths: filter is used, and describe how to convert it into a hard gate.
  • Skip reruns for label events unrelated to allowlist-drift-ack, and update the sticky comment UX when drift is acknowledged.
  • Harden step output handling by passing the drift report via base64 rather than a fixed heredoc delimiter.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/features/gke-autopilot-allowlist-tooling.md Clarifies advisory vs required-status behavior for the path-filtered PR drift workflow and notes fork limitations.
.github/workflows/pr-allowlist-drift.yaml Adjusts workflow behavior for label events, acknowledged drift messaging, and output hardening for the drift report.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 70 to +71
echo "rc=$rc" >> "$GITHUB_OUTPUT"
{
echo "report<<DRIFT_EOF"
echo "$OUT"
echo "DRIFT_EOF"
} >> "$GITHUB_OUTPUT"
echo "report_b64=$(printf '%s' "$OUT" | base64 -w0)" >> "$GITHUB_OUTPUT"
@matthyx
matthyx merged commit 58ff57d into main Jul 16, 2026
3 checks passed
@matthyx
matthyx deleted the gke-allowlist-drift-pr-fixes branch July 16, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Created through Armosec AI tooling (armosec-shared-rules plugin)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants