You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Suggest organization formatting fixes on pull requests - #1362
Existing data is unchanged after bundle exec script/alphabetize.
Read-only dry run against the original Add Fukushima Lab. #1011 data generates one inline suggestion for line 117, with no fallback needed. No review was posted to that PR.
Workflow trust-boundary checks and git diff --check pass.
Run a trusted-base pull_request_target workflow that reads PR YAML through the GitHub API and posts applyable review suggestions without checking out or executing contributor code. Reuse the canonical formatter, avoid duplicate suggestions, detect stale heads, and provide complete patches for corrections outside reviewable diff ranges.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address review feedback by combining file corrections into one atomic replacement, rejecting unsafe patch paths, including every changed file in fallback patches, and removing the live-data assertion that suppressed actionable formatting diffs. Add regression tests for moves, injected paths, and applying multi-file patches.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Encoding mismatches cause spurious suggestions for non-ASCII group names, while unpinned file retrieval can produce patches that introduce content absent from the captured PR head.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Pin changed-file retrieval to the captured PR head
script/suggest-alphabetize:24
The changed-files request uses the live PR rather than the captured head, so an A→B→A head change during processing can leave blobs and patches from B while passing the final SHA check. The bot can then post a suggestion against A that introduces content absent from A when accepted. Pin file and patch retrieval to the captured commits, or verify each file's blob against the captured head before generating suggestions.
Set decoded group names to UTF-8 before comparison
script/suggest-alphabetize:35
Base64.strict_decode64 returns an ASCII-8BIT string, but YAML emits UTF-8. With a valid non-ASCII group name such as Côte, these strings compare unequal despite identical bytes, so an already canonical file receives a no-op suggestion—or a header-only fallback patch when that line is outside the diff. Set the decoded YAML's encoding to UTF-8 before formatting and comparing it.
Check each changed file's blob SHA at the captured head before generating suggestions, rejecting transient-head data. Decode and validate UTF-8 to avoid no-op suggestions for non-ASCII group names. Add regression coverage for transient heads and Unicode data.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Addressed both newly reported findings in 79f231b: each file blob is verified against the captured head SHA before suggestions are generated, so transient A→B→A head changes cannot introduce B-only content; decoded YAML is explicitly validated as UTF-8 before comparison and formatting. Added regressions for a mismatched blob with an otherwise unchanged head, canonical non-ASCII YAML producing no review, and non-ASCII names surviving actual corrections. All 19 tests (86 assertions), targeted RuboCop, and whitespace checks pass.
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
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.
Summary
Addresses #991 with review suggestions instead of requiring a token that can push to contributors' forks, as attempted in #1011.
Trust boundary
pull_request_targetworkflow checks out only trusted base-branch code, with persisted Git credentials disabled.YAML.safe_load; no PR scripts, dependencies, or workflows are executed.Validation
bundle exec script/alphabetize.git diff --checkpass.