Skip to content

Commit

Permalink
Remove VCSCommit and add Commit.source_control_url (#55)
Browse files Browse the repository at this point in the history
The BSR doesn't need to be in the business of storing source control
information--we don't semantically need a vcs commit hash for example
and we don't care what type of source control is being used.

As a convenience for users, we DO want to store a link back to the
relevant commit in source control so that a user can find relevant info
(e.g. commit description, PR discussion, authors, approvers, etc.).

This change simplifies the data model to only store what we need, which
is a single source control URL per commit.
  • Loading branch information
nicksnyder authored Jan 9, 2024
1 parent 482f8c3 commit e46c321
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 72 deletions.
12 changes: 9 additions & 3 deletions buf/registry/module/v1beta1/commit.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ syntax = "proto3";
package buf.registry.module.v1beta1;

import "buf/registry/module/v1beta1/digest.proto";
import "buf/registry/module/v1beta1/vcs_commit.proto";
import "buf/registry/priv/extension/v1beta1/extension.proto";
import "buf/validate/validate.proto";
import "google/protobuf/timestamp.proto";
Expand Down Expand Up @@ -65,6 +64,13 @@ message Commit {
(buf.validate.field).required = true,
(buf.validate.field).string.uuid = true
];
// VCS commit information.
VCSCommit vcs_commit = 7;
// The URL of the source control commit that is associated with the Commit.
//
// BSR users can navigate to this link to find source control information that is relevant to this Commit
// (e.g. commit description, PR discussion, authors, approvers, etc.).
string source_control_url = 7 [
(buf.validate.field).string.uri = true,
(buf.validate.field).string.max_len = 255,
(buf.validate.field).ignore_empty = true
];
}
16 changes: 11 additions & 5 deletions buf/registry/module/v1beta1/upload_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import "buf/registry/module/v1beta1/commit.proto";
import "buf/registry/module/v1beta1/file.proto";
import "buf/registry/module/v1beta1/label.proto";
import "buf/registry/module/v1beta1/module.proto";
import "buf/registry/module/v1beta1/vcs_commit.proto";
import "buf/validate/validate.proto";

option go_package = "buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1beta1";
Expand Down Expand Up @@ -56,7 +55,7 @@ message UploadRequest {
//
// This will include all transitive dependencies.
repeated DepRef dep_refs = 2;
// The Files of the content.
// The Files of the Content.
//
// This will consist of the .proto files, license files, and documentation files.
repeated File files = 3 [(buf.validate.field).repeated.min_items = 1];
Expand All @@ -73,16 +72,23 @@ message UploadRequest {
// Importantly, this file is *not* used to determine the dependencies of the reference. To
// specify the dependencies, use the dep_refs fields.
File buf_lock_file = 5 [(buf.validate.field).required = true];
// The labels to associate with the Commits created by the upload.
// The labels to associate with the Commit for the Content.
//
// If an id is set, this id must represent a Label that already exists and is
// owned by the Module. The Label will point to the newly-created Commits for the References,
// or will be updated to point to the pre-existing Commit for the Reference.
//
// If no labels are referenced, the default Label for the Module is used.
repeated ScopedLabelRef scoped_label_refs = 6;
// VCS Commit information.
VCSCommit vcs_commit = 7;
// The URL of the source control commit to associate with the Commit for this Content.
//
// BSR users can navigate to this link to find source control information that is relevant to this Commit
// (e.g. commit description, PR discussion, authors, approvers, etc.).
string source_control_url = 7 [
(buf.validate.field).string.uri = true,
(buf.validate.field).string.max_len = 255,
(buf.validate.field).ignore_empty = true
];
}
// The Contents of all references.
repeated Content contents = 1 [(buf.validate.field).repeated.min_items = 1];
Expand Down
64 changes: 0 additions & 64 deletions buf/registry/module/v1beta1/vcs_commit.proto

This file was deleted.

0 comments on commit e46c321

Please sign in to comment.