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.
Normalize PR protected-file policy defaults and changelog handling #56562
新建议题
Have a question about this project? 注册 for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “注册 for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? 登录 to your account
base: main
Are you sure you want to change the base?
Normalize PR protected-file policy defaults and changelog handling #56562
Changes from 2 commits
e3d7554df886ee49d2832922a9b40391c0cc9b8727123bb17f0ba191695180cFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
"default"value is still"request_review"(underscore), but"request_review"was removed from theenumin this PR — only"request-review"(hyphen) is now a valid enum member. A JSON Schema validator will flag this default as invalid.Both occurrences (lines 7714 and 7730) need:
@copilot please address this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the pushed schema update: both canonical
request-reviewand legacyrequest_revieware valid enum values, while the schema default is canonicalrequest-review.Check failure on line 124 in pkg/workflow/create_pull_request.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropping
CHANGELOG.mdfrom the default protected-file set is a behavior change with real security impact, but this PR only adjusts compiler-side tests. I can't find a matching runtime test that proves changelog-only patches are now intentionally allowed while other protected top-level docs still trigger protection. Without that coverage, this is one refactor away from becoming an accidental policy regression.💡 What coverage is missing
The new Go tests only assert the generated config shape. They do not exercise the JS policy evaluator that actually decides whether a patch is blocked / fallback / request-review.
Please add a runtime-level test around
checkFileProtection/checkFileProtectionPostApplyshowing at least:That makes the intended policy change explicit and prevents a future mismatch between compile-time config generation and enforcement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added runtime-level coverage in
actions/setup/js/manifest_file_helpers.test.cjs:CHANGELOG.mdis allowed with the PR handler's filtered protected-file set, whileREADME.mdstill producesrequest_reviewunderrequest-reviewpolicy. The shared manifest list continues to protect changelogs for other handlers.Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.