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

feature(ci): protobuf compatibility check (pt 2) #18553

Merged
merged 13 commits into from
Sep 20, 2023
27 changes: 27 additions & 0 deletions .github/workflows/protobuf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Protobuf Compatibility

on:
pull_request:
dsmith3197 marked this conversation as resolved.
Show resolved Hide resolved
paths:
- "proto/**"
- "lib/vector-core/proto/**"
merge_group:
types: [checks_requested]

concurrency:
# `github.event.number` exists for pull requests, otherwise fall back to SHA for merge queue
group: ${{ github.workflow }}-${{ github.event.number || github.event.merge_group.head_sha }}
dsmith3197 marked this conversation as resolved.
Show resolved Hide resolved
cancel-in-progress: true

jobs:
validate-protos:
runs-on: ubuntu-latest
steps:
# Run `git checkout`
- uses: actions/checkout@v3
# Install the `buf` CLI
- uses: bufbuild/buf-setup-action@v1.26.1
# Perform breaking change detection against the `master` branch
- uses: bufbuild/buf-breaking-action@v1.1.3
with:
against: "https://github.com/vectordotdev/vector.git#branch=dougsmith/buf"
Copy link
Contributor

Choose a reason for hiding this comment

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

just flagging to change to the master branch before final merge

4 changes: 4 additions & 0 deletions buf.work.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: v1
directories:
- proto
- lib/vector-core/proto
7 changes: 7 additions & 0 deletions lib/vector-core/proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: v1
breaking:
use:
- FILE
lint:
use:
- DEFAULT
16 changes: 14 additions & 2 deletions lib/vector-core/proto/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@
}
}

message DatadogOriginMetadata {
optional uint32 origin_product = 1;
optional uint32 origin_category = 2;
optional uint32 origin_service = 3;
}

message Metadata {
Value value = 1;
reserved 2,3,4,5,6,7,8;
DatadogOriginMetadata datadog_origin_metadata = 9;
}

message Metric {
string name = 1;
google.protobuf.Timestamp timestamp = 2;
Expand All @@ -95,7 +107,7 @@
}
string namespace = 11;
uint32 interval_ms = 18;
Value metadata = 19;
Metadata metadata = 19;

Check failure on line 110 in lib/vector-core/proto/event.proto

View workflow job for this annotation

GitHub Actions / validate-protos

Field "19" on message "Metric" changed type from "event.Value" to "event.Metadata".
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a breaking proto change as an example to test the workflow. I'll revert these changes before merging.

}

message TagValues {
Expand Down Expand Up @@ -210,4 +222,4 @@
oneof sketch {
AgentDDSketch agent_dd_sketch = 1;
}
}
}
7 changes: 7 additions & 0 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: v1
breaking:
use:
- FILE
lint:
use:
- DEFAULT
Loading