Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v5

uses: actions/checkout@v6
- name: Buf build/lint/format/breaking/push
uses: bufbuild/buf-action@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/bufbuild/buf
rev: v1.57.2
rev: v1.65.0
hooks:
- id: buf-lint
- id: buf-format
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ Protocol Buffers used by [Tilebox](https://tilebox.com), a lightweight space dat

### Pre-commit hooks

We use [pre-commit](https://pre-commit.com/) to run linters before committing. Run the following command once to install the hooks:
We use [prek](https://prek.j178.dev/) to run linters before committing. Run the following command once to install the hooks:

```bash
pre-commit install
uvx prek install
````

### Updating buf dependencies
Expand Down
54 changes: 38 additions & 16 deletions apis/datasets/v1/datasets.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,24 @@ option features.field_presence = IMPLICIT;
// CreateDatasetRequest is used to create a new dataset.
message CreateDatasetRequest {
// name of the dataset to create.
string name = 1 [(buf.validate.field).string.min_len = 1];
string name = 1 [
(buf.validate.field).required = true,
(buf.validate.field).string.min_len = 1,
(buf.validate.field).string.max_len = 100
];
// message type of the dataset to create.
DatasetType type = 2 [(buf.validate.field).required = true];
// short text summary of the dataset to create.
string summary = 3;
string summary = 3 [(buf.validate.field).string.max_len = 50000];
// normalized snake case name of the dataset to create.
string code_name = 4 [(buf.validate.field).string.min_len = 1];
string code_name = 4 [
(buf.validate.field).required = true,
(buf.validate.field).string.min_len = 1,
(buf.validate.field).string.max_len = 100,
(buf.validate.field).string.pattern = "^[a-z][a-z0-9_]*$"
];
// optional description of the dataset, in markdown format
string description = 5 [(buf.validate.field).string.max_len = 1000000];
}

// GetDatasetRequest is the request message for the GetDataset RPC method for fetching a single dataset
Expand All @@ -40,16 +51,36 @@ message GetDatasetRequest {
tilebox.v1.ID id = 2;
}

// UpdateDatasetRequest is used to update a dataset.
// UpdateDatasetRequest updates a dataset, by updating all fields that are set to their new values.
// If a field is not set, it will not be updated.
message UpdateDatasetRequest {
// id of the dataset to update.
tilebox.v1.ID id = 1 [(buf.validate.field).required = true];
// updated name of the dataset.
string name = 2 [(buf.validate.field).string.min_len = 1];
string name = 2 [
features.field_presence = EXPLICIT,
(buf.validate.field).string.min_len = 1,
(buf.validate.field).string.max_len = 100
];
// updated type of the dataset.
DatasetType type = 3 [(buf.validate.field).required = true];
DatasetType type = 3 [features.field_presence = EXPLICIT];
// updated summary of the dataset.
string summary = 4 [features.field_presence = EXPLICIT];
string summary = 4 [
features.field_presence = EXPLICIT,
(buf.validate.field).string.max_len = 50000
];
// updated code name of the dataset.
string code_name = 5 [
features.field_presence = EXPLICIT,
(buf.validate.field).string.min_len = 1,
(buf.validate.field).string.max_len = 100,
(buf.validate.field).string.pattern = "^[a-z][a-z0-9_]*$"
];
// updated description of the dataset, in markdown format
string description = 6 [
features.field_presence = EXPLICIT,
(buf.validate.field).string.max_len = 1000000
];
}

// ClientInfo contains information about the client requesting datasets, useful for us to gather usage data
Expand All @@ -70,14 +101,6 @@ message Package {
string version = 2;
}

// UpdateDatasetDescriptionRequest is used to update a dataset description
message UpdateDatasetDescriptionRequest {
// dataset id
tilebox.v1.ID id = 1 [(buf.validate.field).required = true];
// description of the dataset, in markdown format
string description = 2;
}

// DeleteDatasetRequest is used to delete a dataset
message DeleteDatasetRequest {
// id of the dataset to delete.
Expand Down Expand Up @@ -116,7 +139,6 @@ service DatasetService {
rpc CreateDataset(CreateDatasetRequest) returns (Dataset) {}
rpc GetDataset(GetDatasetRequest) returns (Dataset) {}
rpc UpdateDataset(UpdateDatasetRequest) returns (Dataset) {}
rpc UpdateDatasetDescription(UpdateDatasetDescriptionRequest) returns (Dataset) {}
rpc DeleteDataset(DeleteDatasetRequest) returns (DeleteDatasetResponse) {}
rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse) {}
}
8 changes: 4 additions & 4 deletions buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
version: v2
deps:
- name: buf.build/bufbuild/protovalidate
commit: 6c6e0d3c608e4549802254a2eee81bc8
digest: b5:a7ca081f38656fc0f5aaa685cc111d3342876723851b47ca6b80cbb810cbb2380f8c444115c495ada58fa1f85eff44e68dc54a445761c195acdb5e8d9af675b6
commit: 80ab13bee0bf4272b6161a72bf7034e0
digest: b5:1aa6a965be5d02d64e1d81954fa2e78ef9d1e33a0c30f92bc2626039006a94deb3a5b05f14ed8893f5c3ffce444ac008f7e968188ad225c4c29c813aa5f2daa1
- name: buf.build/googleapis/googleapis
commit: 61b203b9a9164be9a834f58c37be6f62
digest: b5:7811a98b35bd2e4ae5c3ac73c8b3d9ae429f3a790da15de188dc98fc2b77d6bb10e45711f14903af9553fa9821dff256054f2e4b7795789265bc476bec2f088c
commit: 004180b77378443887d3b55cabc00384
digest: b5:e8f475fe3330f31f5fd86ac689093bcd274e19611a09db91f41d637cb9197881ce89882b94d13a58738e53c91c6e4bae7dc1feba85f590164c975a89e25115dc