fix PR matching code for both directory and no directory cases #10224
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 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