-
Notifications
You must be signed in to change notification settings - Fork 987
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
Improve error messages when a pending Trusted Publisher's project name already exists #17405
Improve error messages when a pending Trusted Publisher's project name already exists #17405
Conversation
7fc5519
to
e935be1
Compare
Thanks so much for fixing so quickly ❤️ . |
1e208d0
to
882ebe3
Compare
882ebe3
to
025ea4a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coming along nicely, I think we're almost there! A few last bits to consider, and then I think we're ready to go. Let me know when it's ready for re-review by clicking the 🔄 button on my username.
This change improves the error messages when uploading a new project or creating a pending Trusted Publisher, when the new project's name already exists or is too similar to an existing project. Signed-off-by: Facundo Tuesca <[email protected]>
Signed-off-by: Facundo Tuesca <[email protected]>
Fix the check for projects with too-similar names when there is more than one existing project with the same ultranormalized name. Signed-off-by: Facundo Tuesca <[email protected]>
Signed-off-by: Facundo Tuesca <[email protected]>
Signed-off-by: Facundo Tuesca <[email protected]>
Signed-off-by: Facundo Tuesca <[email protected]>
Also change the TooSimilar error to store the conflicting project name instead of a reference to the entire project. Signed-off-by: Facundo Tuesca <[email protected]>
Signed-off-by: Facundo Tuesca <[email protected]>
025ea4a
to
88ffa21
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!
changing from return value to exception was not caught due to stubs. it's unclear to me how the changes in #17405 were expected to work, or if they were intended to be surfaced in the UI.
The problem
There are some cases where we validate the name of a new project, where the error messages could be better:
The implementation
This PR removes the
enum
used for describing the invalid project name errors, replacing it with simple classes that allow including some metadata in each error object. This metadata allows us to tell if the current user is the owner of the existing project, which we then use to display better error messages.Screenshots
Creating a pending Trusted Publisher
Project already exists and user is owner
Project already exists and user is not owner
This fixes #17392
cc @di @woodruffw