-
Notifications
You must be signed in to change notification settings - Fork 144
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
feat(repository): disallow duplicate artifact refs #841
Conversation
keel-core/src/main/kotlin/com/netflix/spinnaker/keel/persistence/CombinedRepository.kt
Outdated
Show resolved
Hide resolved
keel-core/src/main/kotlin/com/netflix/spinnaker/keel/persistence/CombinedRepository.kt
Outdated
Show resolved
Hide resolved
Rebased against master |
I agree. In general we've bee using 400 in that case. Take a look at the |
...src/main/kotlin/com/netflix/spinnaker/keel/exceptions/DuplicateArtifactReferenceException.kt
Outdated
Show resolved
Hide resolved
...src/main/kotlin/com/netflix/spinnaker/keel/exceptions/DuplicateArtifactReferenceException.kt
Show resolved
Hide resolved
Enforce that all artifacts in a delivery configuration have a unique reference. Fixes spinnaker#761
Use named function instead of lambda for clarity. Use associate instead of map + toMap
Return a 400 on any validation error
Co-Authored-By: Luis Fernando Pollo <1323478+luispollo@users.noreply.github.com>
rebase against master |
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.
LGTM! Thanks for working on this and congrats on your first Spinnaker PR! 🎉
P.S. It would be nice to add a test case to |
Enforce that all artifacts in a delivery configuration have a unique reference.
Fixes #761.
If a user attempts to submit a delivery configuration that violates this, the response payload looks like this:
(As an aside, I don't think keel should return a 500 error on input that fails validation, but that's the current behavior).(My mistake: returning 500 was not the previous behavior on a validation error)It will also log a similar error message at the ERROR level: