-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update Commit.id
to not validate as a UUID
#45
Conversation
`Commit.id` <=> `RepositoryCommit.name`, which is a dashless UUID. This also implies that `ResourceRef.value.id` is not a UUID. TODO: - [ ] Should we drop the UUID validation on all IDs? Ideally our IDs are opaque to users and we are not expressing their shape in the API.
Commit.id
is not a UUIDCommit.id
to not validate as a UUID
The inconsistency between some IDs are UUIDs and other aren’t is a bit unfortunate. I think we should leverage Protovalidate for basic sanity checking of input as much as possible, so I don't think we should remove For fields that can't use the build-in |
Are we sure we want to go down that path? We are exposing the shape of our IDs, and we cannot change this later. In the meantime, I'll update the validation rules to validate a dashless UUID. |
@@ -95,7 +95,7 @@ message ResourceRef { | |||
oneof value { | |||
option (buf.validate.oneof).required = true; | |||
// The id of the resource. | |||
string id = 1 [(buf.validate.field).string.uuid = true]; |
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.
I assume we could write a CEL expression that essentially validates this field is either a UUID or whatever the validation is for a commit id (sounds like it is a UUID without dashes).
This is an interesting philosophical question. My two arguments in favor are:
Therefore might as well put it in the schema and accept that if we are compelled to change this later it would be a breaking change in that sense. |
Discussed in person. Consistently using UUIDs is important enough that we should first consider what work we would need to do to make the implementation consistent so commits use UUIDs. |
Closing this PR, the BSR will take care to translate |
Commit.id
<=>RepositoryCommit.name
, which is a dashless UUID.This also implies that
ResourceRef.value.id
is not a UUID.TODO:
Commit.name
back andCommit.id
<=>RepositoryCommit.id
andCommit.name
<=>RepositoryCommit.name
.