fix(dataset): prevent deleting branches referenced by tags - #8365
Open
dentiny wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
The reject-on-reference guard preserves user-managed tags and prevents sequential branch deletion from invalidating them, with focused coverage for both rejection and the successful cleanup path.
Tag and branch reference mutations still use independent object-store operations, so concurrent tag creation or retargeting can race deletion. A shared CAS/generation protocol would be needed for a strict no-dangling guarantee; this change is still a worthwhile safety improvement within the current non-atomic reference model.
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.
Closes #8366
Hi team, I found when we delete a branch, we (1) didn't check whether there're referencing tags and reject; nor (2) delete all tags referencing the branch, which leads to dangling tag.
In this PR, I choose to implement the former approach, which is conservative and safe.
For the later (delete all referencing tags), I think it's unsafe, because the tag could be created by another users and cause unintended results.
Update on the bot gatekeeper comment: I think fully preventing this requires a shared CAS or generation protocol across branch and tag metadata, which is outside this PR’s scope, could be a followup though.