Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix PR matching code for both directory and no directory cases #10224

Merged
merged 4 commits into from
Jul 16, 2024

Conversation

jakecoffman
Copy link
Member

@jakecoffman jakecoffman commented Jul 16, 2024

What are you trying to accomplish?

I took this change out of #10195 to make it easier to review.

This fixes rebases not working in the absence of directories in the existing PR job data, but also keeps the behavior for PRs that do have directories. Rather than considering the state of the experiment, we instead consider whether the directory is in the data we're about to compare. This way the data will work in either state.

Additionally I found that the tests for grouped updates were invalid as they had the wrong shape. The dependency array was wrapped in another redundant array. A proper type with Sorbet enforcement would be helpful here.

Anything you want to highlight for special attention from reviewers?

By treating the data itself as the feature flag, we can handle older PRs as well as new ones.

How will you know you've accomplished your goal?

There's no way to validate with directory in the PR data yet because that data isn't propagated yet, however I will manually test a rebase to validate it still works without.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@jakecoffman jakecoffman marked this pull request as ready for review July 16, 2024 16:32
@jakecoffman jakecoffman requested a review from a team as a code owner July 16, 2024 16:32
@jakecoffman jakecoffman merged commit 243c481 into main Jul 16, 2024
121 checks passed
@jakecoffman jakecoffman deleted the smarter-existing-pr-detection branch July 16, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants