Repository navigation
ci(pr-policy): require verified isolated QA reports on external PRs - #323
Open
TNT-Likely wants to merge 1 commit into
Open
TNT-Likely wants to merge 1 commit into
TNT-Likely wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
PR policypreviously only verified thatAcceptance evidencefields were non-empty text, so external pull requests touching production code could pass the mechanical gate without running the repository's isolated QA skill (.agents/skills/panwatch-local-delivery) or attaching a verifiable offline test report. At the same time, repository owner PRs (TNT-Likely) and docs/test-only PRs should remain frictionless and exempt from the mandatory attachment check.Changes
.github/pr-policy.json: addqaReportconfiguration (required: true,exemptAuthors: ["TNT-Likely"],minSkillVersion: "1.3.0", archive size/entry/timeout limits) and thepr:qa-exemptmaintainer override label..github/scripts/pr-policy.cjs:https://github.com/user-attachments/files/.../*.zip+ZIP SHA256: <64-hex>) for external pull requests withproductionFiles > 0.exemptAuthors(TNT-Likely, case-insensitive), PRs with 0 production files, and PRs carrying a head-boundpr:qa-exemptmaintainer label (revoked automatically on a new push).parseZipEntries+verifyQaReportZip+ SSRF-safedownloadAttachmentZip) that checks ZIP SHA256,index.html,manifest.json(base_shamatching the current PR head, non-emptyrun_id,skill_version >= 1.3.0, no recorded failures),SHA256SUMSintegrity, and redaction/secret-leak rules (rejectingcredentials.json,.env*,*.db, keys, and unredacted tokens)..github/scripts/pr-policy.test.cjs: expand the Node test suite from 39 to 52 tests covering owner exemption, docs/test-only exemption,pr:qa-exempthead-binding and revocation, SSRF URL rejection, stored/deflated ZIP verification, stalebase_sha, tamperedSHA256SUMS, failing summaries, leaked secrets/private files, 404 failures, and transient 503 handling..github/PULL_REQUEST_TEMPLATE.md,docs/pr-policy.md,docs/pr-policy.zh-CN.md,.agents/skills/panwatch-local-delivery/references/delivery.md: document the required### Test reportfields,manifest.jsonkeys (base_sha,run_id,skill_version,summary.failed), and exemption rules.Scope
Audited head SHA:
84b13233b265b49fe8344bd6e5adc493f0642864.Production scale: 2 production files (
.github/pr-policy.json,.github/scripts/pr-policy.cjs), 475 added + deleted production lines (within the 20 files / 800 lines budget). Tests and Markdown docs are excluded from the production budget.Excluded: no changes to application runtime code, frontend code, or other GitHub Actions workflows.
Validation
Tested commit:
84b13233b265b49fe8344bd6e5adc493f0642864Commands and results:
Acceptance evidence
Steps:
node --test .github/scripts/pr-policy.test.cjson commit84b1323.TNT-Likely), docs/test-only exemption, external production PR rejection without ZIP, SSRF rejection for non-GitHub URLs, valid stored/deflated ZIP verification, tamper/stale-head/secret-leak rejection, and head-boundpr:qa-exemptbehavior.python3 -m unittest discover -s .agents/skills/panwatch-local-delivery/scripts -p 'test_*.py' -vto confirm skill isolation tests remain green.Expected:
All 52 PR policy tests and 15 skill isolation tests pass; owner PRs bypass the mandatory QA ZIP gate while external production PRs must pass full read-only ZIP verification unless exempted with
pr:qa-exempt.Observed:
All 52 tests in
.github/scripts/pr-policy.test.cjspassed (0 failed), all 15 tests intest_isolation.pypassed (OK), andgit diff --checkreturned clean.Evidence:
Sanitized command results above; full automated test cases are in
.github/scripts/pr-policy.test.cjsand exercised by thePR policy testsworkflow on this PR. Application UI/backend tests are not applicable because this change touches only repository PR policy tooling and documentation.Boundaries and risks
PR policyprior to merging this change (e.g. open external production PRs) will be asked for an isolated QA report ZIP on their next event or daily sweep unless a maintainer appliespr:qa-exemptfor their current head.zipand Pythonzipfile) up to 20 MB compressed / 50 MB uncompressed and 500 entries; archives using exotic compression methods are rejected.downloadAttachmentZipdownloads unauthenticated public GitHub PR attachments; if the repository is ever made private, unauthenticated fetches would return 404.PR policyexecutes trusted code from the default branch (main), so the new rules take effect only after this PR is merged intomain.Follow-up
None.