Skip to content

Commit a70f04f

Browse files
authored
chore: add a config check (#14327)
Add a presubmit check to verify library name and version are consistent among `state.yaml` and `librarian.yaml`. Update the version of pubsub and pubsub/v2 since these two libraries are released with an old version of legacylibrarian. Using legacylibrarian v0.9.1 and above will update version in librarian.yaml automatically. For googleapis/librarian#4422
1 parent 9e2b3f5 commit a70f04f

5 files changed

Lines changed: 45 additions & 5 deletions

File tree

.github/workflows/config_check.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: config check
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
permissions:
9+
contents: read
10+
jobs:
11+
config-check:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
# Use this action, rather than a file filter so that we can make this
16+
# mandatory.
17+
# See https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#example-including-branches
18+
# for more details.
19+
- uses: dorny/paths-filter@v4
20+
id: filter
21+
with:
22+
filters: |
23+
librarian:
24+
- 'librarian.yaml'
25+
- '.librarian/**'
26+
- name: Config check
27+
if: steps.filter.outputs.librarian == 'true'
28+
run: |
29+
V="$(sed -n 's/^version: *//p' librarian.yaml)"
30+
go run "github.com/googleapis/librarian/tool/cmd/configcheck@${V}" .
31+
- name: Update library versions and regenerate
32+
if: failure()
33+
run: |
34+
echo "Library version is different between state.yaml and librarian.yaml.
35+
Update versions in the configs according to the error message and
36+
regenerate libraries using:
37+
38+
V=\$(sed -n 's/^version: *//p' librarian.yaml)
39+
go run github.com/googleapis/librarian/cmd/librarian@\${V} generate --all
40+
"

internal/generated/snippets/pubsub/v2/apiv1/snippet_metadata.google.pubsub.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "GO",
1010
"name": "cloud.google.com/go/pubsub/v2/apiv1",
11-
"version": "2.5.0"
11+
"version": "2.5.1"
1212
},
1313
"snippets": [
1414
{

librarian.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,15 +939,15 @@ libraries:
939939
- README.md
940940
- internal/version.go
941941
- name: pubsub
942-
version: 1.50.1
942+
version: 1.50.2
943943
keep:
944944
- README.md
945945
- internal/version.go
946946
skip_release: true
947947
go:
948948
nested_module: v2
949949
- name: pubsub/v2
950-
version: 2.5.0
950+
version: 2.5.1
951951
apis:
952952
- path: google/pubsub/v1
953953
keep:

pubsub/internal/version.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pubsub/v2/internal/version.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)