Skip to content

feat(checks): warn-only Service Policy pull request check - #42

Draft
aelmhorst wants to merge 2 commits into
mainfrom
feat/service-policy-governance
Draft

aelmhorst wants to merge 2 commits into
mainfrom
feat/service-policy-governance

Conversation

@aelmhorst

Copy link
Copy Markdown

Summary

Adds the warn-only service-policy-check org workflow. On a pull request to the default branch, it reads the repository's Service Policy results and posts or updates one comment and a warning annotation per violated warn-mode policy. It never fails a pull request.

This is one of four draft pull requests that together deliver the Service Policy governance check. Merge order: devrev/bundles first (and deploy), then devrev/apollo, then devrev/security-tools, then devrev/global-gh-tools. The full order, including the setup steps that switch it on, is in the rollout runbook in devrev/apollo (docs/plans/2026-10-19-service-policy-rollout-runbook.md).

What changes

  • .github/workflows/service-policy-check.yml: assumes a read-only AWS role through GitHub OIDC (gh-action-service-policy-read, a placeholder name until it is created), reads the heartbeat and the repository's item, and runs every step with continue-on-error.
  • checks/check_service_policy.py: shows only warn and block results (block is shown as warn in v1). It finds the comment by its marker and edits it in place, minimizes it as resolved when nothing remains, and un-minimizes it when results return. A missing or stale heartbeat (older than six hours), a credential error or a failed comment all end in success with "governance status unknown".
  • checks/service_policy_render.py: standard-library-only rendering, escaping markdown and workflow commands, and rendering a link only when it is https. The producer job in devrev/security-tools vendors this file, and both repos test the same sha256.

Merging puts the workflow on main but runs it nowhere. It runs only where an evaluate-mode org ruleset names it, which the runbook does on three trial repositories first.

Validation

make test passes (38 tests, 17 new).

DevRev

ISS-387320

🤖 Generated with Claude Code

aelmhorst and others added 2 commits October 17, 2026 20:00
New org-level workflow and check that reads the Service Policy projection with
GitHub OIDC and posts or updates one marked comment and a warning annotation
per violated warn-mode policy, with reason, service, team, outcome, owner and
remediation link. Observe-mode results are never shown, block is rendered as
warn, and the comment is minimized as resolved when nothing remains. Every
failure, including a stale or unreadable projection, ends in success with a
note that governance status is unknown. Rendering lives in a standard-library
module the producer vendors.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The producer job in devrev/security-tools vendors service_policy_render.py
byte for byte; both repositories test the same sha256 so drift fails CI.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.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.

1 participant