From f3b72037c291fdb46a34547cc2b0e99b2d0de447 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 13 Sep 2023 11:27:12 +0200 Subject: [PATCH 01/12] buf workspace config --- buf.work.yaml | 4 ++++ lib/vector-core/proto/buf.yaml | 7 +++++++ proto/buf.yaml | 9 +++++++++ 3 files changed, 20 insertions(+) create mode 100644 buf.work.yaml create mode 100644 lib/vector-core/proto/buf.yaml create mode 100644 proto/buf.yaml diff --git a/buf.work.yaml b/buf.work.yaml new file mode 100644 index 0000000000000..b7dc0a0792557 --- /dev/null +++ b/buf.work.yaml @@ -0,0 +1,4 @@ +version: v1 +directories: + - proto + - lib/vector-core/proto \ No newline at end of file diff --git a/lib/vector-core/proto/buf.yaml b/lib/vector-core/proto/buf.yaml new file mode 100644 index 0000000000000..1a5194568a90a --- /dev/null +++ b/lib/vector-core/proto/buf.yaml @@ -0,0 +1,7 @@ +version: v1 +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/proto/buf.yaml b/proto/buf.yaml new file mode 100644 index 0000000000000..47af8191cb75a --- /dev/null +++ b/proto/buf.yaml @@ -0,0 +1,9 @@ +version: v1 +breaking: + use: + - FILE + ignore: + - google +lint: + use: + - DEFAULT From 02ea5db4f6ca2a2536d9d1558a43bcbf3134e528 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 13 Sep 2023 11:32:37 +0200 Subject: [PATCH 02/12] remove ignore dir --- proto/buf.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/proto/buf.yaml b/proto/buf.yaml index 47af8191cb75a..1a5194568a90a 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -2,8 +2,6 @@ version: v1 breaking: use: - FILE - ignore: - - google lint: use: - DEFAULT From fd980fd6d27114d104c90715eeac5517ffdee0be Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 13 Sep 2023 11:37:39 +0200 Subject: [PATCH 03/12] add workflow --- .github/workflows/proto.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/proto.yml diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml new file mode 100644 index 0000000000000..316e79a721d4c --- /dev/null +++ b/.github/workflows/proto.yml @@ -0,0 +1,27 @@ +name: Protobuf Compatibility + +on: + pull_request: + 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 }} + 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@v0.5.0 + # Perform breaking change detection against the `master` branch + - uses: bufbuild/buf-breaking-action@v1 + with: + against: "https://github.com/acme/weather.git#branch=master" \ No newline at end of file From e0fc583dab0f1e8402c47214ac6a406634362ee8 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 13 Sep 2023 11:44:29 +0200 Subject: [PATCH 04/12] update action versions --- .github/workflows/proto.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 316e79a721d4c..dcee5e7287dce 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -20,8 +20,8 @@ jobs: # Run `git checkout` - uses: actions/checkout@v3 # Install the `buf` CLI - - uses: bufbuild/buf-setup-action@v0.5.0 + - uses: bufbuild/buf-setup-action@v1.26.1 # Perform breaking change detection against the `master` branch - - uses: bufbuild/buf-breaking-action@v1 + - uses: bufbuild/buf-breaking-action@v1.1.3 with: against: "https://github.com/acme/weather.git#branch=master" \ No newline at end of file From 9a4d68fed055564a932bb1c974298e426d126928 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 13 Sep 2023 11:45:43 +0200 Subject: [PATCH 05/12] correct repo --- .github/workflows/proto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index dcee5e7287dce..78a9aece550e9 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -24,4 +24,4 @@ jobs: # Perform breaking change detection against the `master` branch - uses: bufbuild/buf-breaking-action@v1.1.3 with: - against: "https://github.com/acme/weather.git#branch=master" \ No newline at end of file + against: "https://github.com/vectordotdev/vector.git#branch=master" \ No newline at end of file From eec7e2f5ba37c35568bdae399143c3890c935a6b Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 13 Sep 2023 11:48:37 +0200 Subject: [PATCH 06/12] temporarily remove proto.yml --- .github/workflows/proto.yml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 .github/workflows/proto.yml diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml deleted file mode 100644 index 78a9aece550e9..0000000000000 --- a/.github/workflows/proto.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Protobuf Compatibility - -on: - pull_request: - 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 }} - 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=master" \ No newline at end of file From 43a74032f42e3608053b6c64b7c93271a76ed8f0 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 13 Sep 2023 12:24:14 +0200 Subject: [PATCH 07/12] feature(ci): protobuf compatibility check pt 2 --- .github/workflows/protobuf.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/protobuf.yml diff --git a/.github/workflows/protobuf.yml b/.github/workflows/protobuf.yml new file mode 100644 index 0000000000000..8991e81665285 --- /dev/null +++ b/.github/workflows/protobuf.yml @@ -0,0 +1,27 @@ +name: Protobuf Compatibility + +on: + pull_request: + 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 }} + 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" \ No newline at end of file From 986a8de69b3d834ad7bb6be0839b348a081a86ad Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 13 Sep 2023 12:29:01 +0200 Subject: [PATCH 08/12] example proto change --- lib/vector-core/proto/event.proto | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/vector-core/proto/event.proto b/lib/vector-core/proto/event.proto index 7444334ea7b3e..91bf709792018 100644 --- a/lib/vector-core/proto/event.proto +++ b/lib/vector-core/proto/event.proto @@ -69,6 +69,18 @@ message Value { } } +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; @@ -95,7 +107,7 @@ message Metric { } string namespace = 11; uint32 interval_ms = 18; - Value metadata = 19; + Metadata metadata = 19; } message TagValues { @@ -210,4 +222,4 @@ message Sketch { oneof sketch { AgentDDSketch agent_dd_sketch = 1; } -} +} \ No newline at end of file From 084359a98dfb6607e68232157ff2d259b859ba5e Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 13 Sep 2023 12:33:52 +0200 Subject: [PATCH 09/12] example compatible change --- lib/vector-core/proto/event.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vector-core/proto/event.proto b/lib/vector-core/proto/event.proto index 91bf709792018..dc51847d61057 100644 --- a/lib/vector-core/proto/event.proto +++ b/lib/vector-core/proto/event.proto @@ -107,7 +107,7 @@ message Metric { } string namespace = 11; uint32 interval_ms = 18; - Metadata metadata = 19; + Value metadata = 19; } message TagValues { From 86ae7a44b16b1b6593ec072ddf4c5a6baf59bb45 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 13 Sep 2023 12:35:18 +0200 Subject: [PATCH 10/12] revert proto file --- lib/vector-core/proto/event.proto | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/vector-core/proto/event.proto b/lib/vector-core/proto/event.proto index dc51847d61057..7444334ea7b3e 100644 --- a/lib/vector-core/proto/event.proto +++ b/lib/vector-core/proto/event.proto @@ -69,18 +69,6 @@ message Value { } } -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; @@ -222,4 +210,4 @@ message Sketch { oneof sketch { AgentDDSketch agent_dd_sketch = 1; } -} \ No newline at end of file +} From 9ab7c50b4ae24c2cd396eead32ec1c7e946ba6e2 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Thu, 14 Sep 2023 17:36:23 +0200 Subject: [PATCH 11/12] change ref branch to master --- .github/workflows/protobuf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/protobuf.yml b/.github/workflows/protobuf.yml index 8991e81665285..78a9aece550e9 100644 --- a/.github/workflows/protobuf.yml +++ b/.github/workflows/protobuf.yml @@ -24,4 +24,4 @@ jobs: # 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" \ No newline at end of file + against: "https://github.com/vectordotdev/vector.git#branch=master" \ No newline at end of file From 69351c0cba9d792341ba4b45ec7abe957c03c072 Mon Sep 17 00:00:00 2001 From: Doug Smith Date: Wed, 20 Sep 2023 14:02:24 -0400 Subject: [PATCH 12/12] fmt --- .github/workflows/protobuf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/protobuf.yml b/.github/workflows/protobuf.yml index 78a9aece550e9..bfe0066480ec6 100644 --- a/.github/workflows/protobuf.yml +++ b/.github/workflows/protobuf.yml @@ -24,4 +24,4 @@ jobs: # 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=master" \ No newline at end of file + against: "https://github.com/vectordotdev/vector.git#branch=master"