Label pull requests that add partial implementations - #30385
Draft
caugner wants to merge 3 commits into
Draft
Conversation
Move the remote lookup, `fetchAndResolve()` and the pull request number shorthand out of `diff-flat.js`, so that other scripts can resolve the same base and head references.
Compare the set of `<feature>.<browser>` paths that carry `partial_implementation` between two references, and print the added and removed ones. Unlike grepping the diff for added `partial_implementation` lines, this ignores reformatting and reports nothing when an existing partial implementation is only modified.
Add and remove the "sets partial" label based on `diff:partials`, so that open pull requests adding a partial implementation can be linked on the agenda of the weekly BCD call. The workflow can also be dispatched manually to label all open pull requests, e.g. to backfill the label.
Contributor
|
Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs). |
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.
Summary
Add a "sets partial" label to pull requests that add a
partial_implementationflag, and remove it again when they no longer do.npm run diff:partials -- [base] [head]prints the<feature>.<browser>paths that gain (+) or lose (-) a partial implementation between two references, or for a pull request number.--jsonprints the same as JSON.Partial Implementation Labelerworkflow runs it per pull request and synchronizes the label. It can also be dispatched manually to (re-)label all open pull requests.diff:flat(remote lookup, pull request number shorthand) moved toscripts/lib/git.jsfor reuse, without behavior change.The label needs to be created in the repository before this is merged, and does not exist yet.
Test results and supporting details
diff:partialscompares the set of paths carryingpartial_implementation, rather than grepping the diff for addedpartial_implementationlines. Of the last 300 commits onmain, 17 add such a line, but 4 of those should not be labeled, and the structural comparison gets all 4 right:+/-partial lines in diffdiff:partials+1/-8+ api.PublicKeyCredential.isConditionalMediationAvailable_static.webview_android+ css.properties.mask-image.svg_masks.safari+ css.properties.text-box{,-trim}.inline_elements.safariUnresolved
"mirror"values are ignored, so a partial implementation is only reported for the browser whose data states it.The labeling logic was run locally (with the API calls stubbed out) against #30320 (adds a partial implementation, gets labeled), #30384 and #30353 (no change), and against a pull request with merge conflicts, where the missing
pull/N/mergeref results in a warning and a skip, rather than a failure. Sincepull_request_targetworkflows run from the base branch, the workflow itself cannot run on this pull request; after merging, a manual dispatch labels the open pull requests.Unit tests cover the collection and comparison of partial implementations.
Related issues
Fixes #30261.