Repository navigation
Fix PR link regexes after the move to react/react-native - #59128
Closed
TheSeydiCharyyev wants to merge 1 commit into
Closed
TheSeydiCharyyev wants to merge 1 commit into
TheSeydiCharyyev wants to merge 1 commit into
Conversation
Two regexes still look only for github.com/facebook/react-native: - close-pr.yml does not find "Pull Request resolved: https://github.com/react/react-native/pull/N" in the commit message, so react-native-bot stopped leaving the "This pull request was successfully merged" comment after the move. - checkForReproducer.js does not accept a link to a pull request as a reproducer. The pattern is a template literal, so "\d" became "d", and it only allowed "facebook". Issues with such a link got "Needs: Repro". Both regexes now accept "facebook" and "react", because people still write links with "facebook". Add a test for pull request links in checkForReproducer.
|
@cortinico has imported this pull request. If you are a Meta employee, you can view this in D125650549. |
Collaborator
|
This pull request was successfully merged by @TheSeydiCharyyev in 9ae68b5 When will my fix make it into a release? | How to file a pick request? |
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:
Two workflows stopped working after the move to
react/react-native, because their regexes only allowgithub.com/facebook/react-native:react-native-botposted "This pull request was successfully merged by @author in sha" with links to "When will my fix make it into a release?" and "How to file a pick request?". The last one is on feat(ios): honor textDecorationStyle on Text decorations #56769 (June 9). Pull requests merged on October 15 (Combine the 0.88 RC sections into v0.88.0 #59122, Skip empty text decoration draws (#59050) #59050, Read only the drawn child's mix-blend-mode in Android drawChild #59016) only have themeta-codesynccomment.Needs: Repro. Examples: iOS: Text drops its last line when its box crosses y = 2048 on a 3x screen (Yoga float rounding) #58970, normalize-color accepts functional colors with surrounding junk #58495, TextInput claims the responder on every selection change, even with no active touch #58445, VirtualizedSectionList passes incorrect leading/trailingItem to ItemSeparatorComponent #55708. The bot's message forNeeds: Reproasks for a pull request that editsRNTesterPlayground.js, but the bot does not accept a link to one.Why
.github/workflows/close-pr.ymllooks forPull Request resolved: https://github.com/facebook/react-native/pull/Nin the commit message. Commits now sayhttps://github.com/react/react-native/pull/N, sogetClosedPrIfExistsreturnsundefinedand the script stops beforecreateComment. Update repository references from facebook/react-native to react/react-native #57167 changed theif:line in this file toreact/react-native, but not the regex. The regex is written with escaped slashes (facebook\/react-native)..github/workflow-scripts/checkForReproducer.jsbuilds the pull request pattern in a template literal with single backslashes. In a template literal,\dis justd, so the pattern ishttps?://github.com/facebook/react-native/pull/d+/?. It did not match real links even before the move (the line was added in Update the reproducer message #50848). The other two patterns in the same function use\\and work.In the whole repo,
facebook\/react-nativeappears only in these two lines.Fix
Both regexes now accept
facebookandreact. People still write links withfacebook: the four issues above all do. IncheckForReproducer.js, the pattern now uses\\like the other two patterns.(?:...)does not capture, so the group numbers inclose-pr.ymldo not change.The new test file is
checkForReproducer-links-test.js, so it does not conflict withcheckForReproducer-test.jsfrom #58429. That PR fixes a different problem in the same script: the bot treats its ownNeeds: Reprolabel as a maintainer change. Because of that, an issue that already has the label keeps it after an edit, also with this PR. New issues with a pull request link do not get the label.Changelog:
[INTERNAL] [FIXED] - Fix pull request link regexes in the close-pr and check-for-reproducer workflows after the move to react/react-native
Test Plan:
Windows 11, Node 22.17.1, Yarn 1.22.22.
New Jest test for
checkForReproducerwith 4 cases: a link to a pull request inreact/react-native, the same link withfacebook/react-native, a pull request in another repository, and no link.main(e04aaf6)Each part of the fix is needed:
facebook|reactwith single backslashes: both link tests fail.facebook: thereactlink test fails.close-pr.ymlruns an inline script, so it has no Jest test. I tookprClosingRegexfrom the file and rangetClosedPrIfExists(copied from the file) on real commit messages frommain:mainPull Request resolved: https://github.com/react/react-native/pull/59016undefined59016Pull Request resolved: https://github.com/facebook/react-native/pull/567695676956769undefinedundefinednpx prettier --checkpasses for the 3 files.Not covered:
mainand on issue events in this repository.yarn lintdoes not check these files, because ESLint skips the.githubfolder.