Skip to content
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

Make dep commit ids unique #77

Closed
wants to merge 1 commit into from
Closed

Conversation

unmultimedio
Copy link
Member

No description provided.

@@ -86,7 +86,10 @@ message UploadRequest {
//
// Commits should be unique by Module, that is no two dep_commit_ids should have the same Module but
// different Commit IDs.
repeated string dep_commit_ids = 2 [(buf.validate.field).repeated.items.string.uuid = true];
repeated string dep_commit_ids = 2 [
(buf.validate.field).repeated.unique = true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't use the unique validation throughout the API because it could be expensive - there's lot of other places we'd want to use it if we were going to be consistent. It's not actually enforcing the uniqueness we really need anyways - we need commits to be unique by module. A duplicate commit isn't actually an issue.

Copy link
Member Author

@unmultimedio unmultimedio Feb 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I know the uniqueness is across modules (not commits), and I thought of making it at the code level, since I'm already looping through them anyway, but more of a conceptual question, is passing the same commit multiple times an error? May be not but I'm not sure how strict we want to be.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so - I think it's fine, we don't enforce this in other places, I'm not worried about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants