fix: Allow to delete repos with invalid urls (#20921) (cherry-pick #20975) #21117
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.
Cherry-picked fix: Allow to delete repos with invalid urls (#20921) (#20975)
Fixes #20921
Normalization of repo url is attempted during repo deletion before comparison with existing repos. Before this change, it'd fail on invalid urls and return "", resulting in permission denied. This ended up in a state where people can add repos with invalid urls but couldn't delete them. Return raw repo url if url parsing failed. Add a test to validate the deletion can be performed and make sure it fails without the main change.
This needs to be cherry-picked to v2.11-2.13
Signed-off-by: Andrii Korotkov andrii.korotkov@verkada.com
Signed-off-by: Andrii Korotkov andrii.korotkov@verkada.com
Signed-off-by: Andrii Korotkov andrii.korotkov@verkada.com