-
-
Notifications
You must be signed in to change notification settings - Fork 346
Improve support for multiple blame ranges #1976
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
base: main
Are you sure you want to change the base?
Improve support for multiple blame ranges #1976
Conversation
2201fa2
to
249162a
Compare
Thanks a lot for the follow-up! @cruessler would probably be the one to do the first review, and I will get it merged right after. |
Thanks a lot for the follow-up! Before I start reviewing this PR in detail, I have a few questions regarding the high-level API. In particular, it seems as if the decision to change I think the proposed API can be simplified and stay more insulated from calling code by reducing the number of enum variants to What do you think? |
249162a
to
e1db1b7
Compare
As discussed with @cruessler during a call, we decided to make the API more robust and less error-prone. We've removed the distinction between This means users no longer need to worry about converting between one-based and zero-based ranges. If a non-inclusive range is used during construction, an error will be thrown, helping to prevent subtle bugs. |
This modification introduces changes to the `BlameRanges` struct, converting it into an enum to support both `PartialFile` and `WholeFile`. Internally the range in `BlameRanges` is stored as zero-based-exclusive now.
e1db1b7
to
8484098
Compare
Bit surprised about the CI-error. Any hint for that? |
I restarted the job, and I'd expect it to go through. There is some known flakiness with tests that deal with concurrent IO, and even though it's quite rare, it happens, unfortunately. |
The original failure in the Because the I've rerun the workflow as a whole, and all jobs passed. From context, it looks like the failing tests might have been all that were still blocking this PR form being merged. However, since auto-merge wasn't enabled here and I haven't been following this PR closely, I have refrained from merging it, in case my understanding is not correct. |
Thanks for pointing this out! I remember now that the filesystem probe can have collisions across processes and produce incorrect values due to a race. Thanks also for rerunning CI properly, I will keep that in mind.
Thank you, that's the right call. The plan here is that @cruessler will do the first review, and I take a look once he approves for merging. |
The way I reran it was arguably overkill--when rerunning a whole workflow, one can select "Re-run failed jobs" instead of "Re-run all jobs", which in spite of its name, I think does also rerun canceled jobs from the same matrix as a failed job that were canceled because of it. ("Re-run all jobs" and "Re-run failed jobs" are available at the workflow level, and should not be confused with re-running a single job, which doesn't automatically re-run failed or canceled sibling jobs.)
Thanks--I wasn't sure if the requested review was covered by #1976 (comment) or not. I'm glad I held off from merging. |
That's a great pointer - I definitely thought "Re-run failed jobs" does the trick even for cancelled ones, which means I must have hit a rerun button on the level of the individual failed job. |
This PR implements various improvements suggested in PR #1973.
The main change is converting the
BlameRanges
struct, into an enum to support bothOneBasedInclusive
andZeroBasedExclusive
range formats. TheFullFile
variant, denotes that the entire file is to be blamed, serves as a more explicit substitute for a previously used "empty" range.