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

Updates to Buf actions #1770

Merged
merged 24 commits into from
Aug 13, 2024
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
33 changes: 33 additions & 0 deletions .github/workflows/buf-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: buf-push

on:
push:
branches:
- main
paths:
- 'proto/**'

jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# This step sets up the variable steps.buf-version.outputs.v
# to contain the version of Buf (e.g. v1.36.0) from go.mod.
- name: Get Buf version
id: buf-version
run: |
BUF_VERSION=$( go list -m -f '{{.Version}}' github.com/bufbuild/buf )
# remove the leading 'v' in front of the version
BUF_VERSION=${BUF_VERSION#v}
echo "v=$BUF_VERSION" >> "$GITHUB_OUTPUT"
- uses: bufbuild/buf-action@v1
with:
version: ${{ steps.buf-version.outputs.v }}
token: ${{ secrets.BUF_TOKEN }}
input: 'proto'
# The repository already exists.
# If it can be automatically created, that's a sign that it was deleted,
# which is likely a major issue.
push_disable_create: true
33 changes: 33 additions & 0 deletions .github/workflows/buf-validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: buf-validate

on:
pull_request:
# 'labeled' and 'unlabeled' are included so we can use the 'Buf Skip Breaking' label
# and skip a breaking change if that's required.
# See: https://github.com/bufbuild/buf-action?tab=readme-ov-file#skip-the-breaking-change-detection-step
types: [opened, synchronize, reopened, labeled, unlabeled]
paths:
- 'proto/**'

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# This step sets up the variable steps.buf-version.outputs.v
# to contain the version of Buf (e.g. v1.36.0) from go.mod.
- name: Get Buf version
id: buf-version
run: |
BUF_VERSION=$( go list -m -f '{{.Version}}' github.com/bufbuild/buf )
# remove the leading 'v' in front of the version
BUF_VERSION=${BUF_VERSION#v}
echo "v=$BUF_VERSION" >> "$GITHUB_OUTPUT"
- uses: bufbuild/buf-action@v1
with:
version: ${{ steps.buf-version.outputs.v }}
token: ${{ secrets.BUF_TOKEN }}
input: 'proto'
push: false
breaking_against: '${{ github.event.repository.clone_url }}#branch=main,subdir=proto'
38 changes: 0 additions & 38 deletions .github/workflows/buf.yml

This file was deleted.

3 changes: 0 additions & 3 deletions pkg/web/openapi/swagger-ui/api/v1/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2192,9 +2192,6 @@
},
"description": {
"type": "string"
},
"descriptionAgain": {
"type": "string"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion proto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ the [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway).
## Client code

The client code for Conduit's API is available as a [Buf remote package](https://docs.buf.build/bsr/remote-packages/go).
Proto files are pushed to the Buf Schema Registry via a GitHub workflow defined [here](/.github/workflows/buf.yml).
Proto files are pushed to the Buf Schema Registry via a GitHub workflow defined [here](/.github/workflows/buf-validate.yaml).

To use the client code, firstly run:

Expand Down
1,807 changes: 898 additions & 909 deletions proto/api/v1/api.pb.go

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion proto/api/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ message Pipeline {
message Config {
string name = 1;
string description = 2;
string description_again = 3;
}
message DLQ {
// plugin is the connector plugin used for storing DLQ records
Expand Down
3 changes: 0 additions & 3 deletions proto/api/v1/api.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2192,9 +2192,6 @@
},
"description": {
"type": "string"
},
"descriptionAgain": {
"type": "string"
}
}
},
Expand Down
Loading