Repository navigation
feat(pr-checks): frozen-files fails a pull request that changes a file frozen on the base branch - #63
Draft
PiquelChips wants to merge 1 commit into
Draft
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
…e frozen on the base branch frozen-files (PQ2) matches the changed files against the globs of the new frozen-files input, such as applied migrations: modifying, renaming or deleting one needs the owner's approval or the approved-exception label, as a lint exception does. The approval moves to PullRequest, which both checks share.
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.
What and why
An applied migration must never change: piqueld and sourceorigin both say so in prose, and an edited migration breaks every database that already ran it. A repository check can't enforce this. On
mainit would compare HEAD with itself, and a shallow checkout lacks the merge base. A pull request has exactly the comparison needed, so this addsfrozen-files(PQ2) to the pull request checks of #21.frozen-filesinput, such ascrates/*/migrations/*.sql, that exists on the base branch must not be modified, have its mode changed, be renamed or be deleted.pulls.listFiles.**,*,?,{a,b}and[…]/[!…].lint-exceptions: an approver's approval of the latest commit, or theapproved-exceptionlabel. That logic moves fromlint-exceptionstoPullRequest.approval, so both checks share it.frozen-filesinput passes.frozen-files: crates/*/migrations/*.sql.Testing
5 new Node tests (52 in all):
The existing
lint-exceptionsapproval tests now cover the sharedPullRequest.approval.just check-changed feat/pr-check-lint-exceptionspasses.Dogfood: this pull request's own
PRrun. This repository freezes nothing, so the check passes trivially there.Checklist
frozen-fileswith their migration globs.)just check-changedpasses.Note
Written by Claude Opus 5.5 in Claude Code (via T3 Code)