Closed
Conversation
This was an inadvertant change introduced by my previous PR which refactored the repo deletion flow. Prior to my PR, the code implicitly validated that the provider name was non empty by setting `Valid` to true in the `sql.NullString` used to query repos by provider name. This change restores that behaviour, adds comments, and also adds explicit validation in the controlplane to ensure that provider name is set. Since an empty provider name would always have led to an error, I do not believe that this extra validation constitutes a breaking change. It will however change the response code in this case from a 404 to a 400.
aaac299 to
0acfeea
Compare
Contributor
Author
|
Closing this for now since fixing it may involve breaking the CLI. Will open an issue to track this. |
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.
When handling a request to delete a repository by name, Minder does not enforce that the request contains a non empty provider name. The SQL query used to find the repository will ignore the provider field if the provider name is empty. This leads to a potential bug which could arise if there is more than one repo with the same name in the same project, but with different providers. In this case, one of the repos will get deleted, but it is not deterministic which one will get deleted from the client's viewpoint.
This introduces a slight API compatibility change, but at least avoids the bug described above.
Summary
Provide a brief overview of the changes and the issue being addressed.
Explain the rationale and any background necessary for understanding the changes.
List dependencies required by this change, if any.
Fixes #(related issue)
Change Type
Mark the type of change your PR introduces:
Testing
Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.
Review Checklist: