Skip to content

Commit f2f4c2d

Browse files
authored
tests: bump docker image from bufbuild/buf:1.30.1 to :1.46.0 (#519)
see https://github.com/bufbuild/buf/releases ## TASKS - [x] bump version - [x] migrate config see https://buf.build/docs/migration-guides/migrate-v2-config-files - [x] migrate CLI calls --------- Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 4df1429 commit f2f4c2d

File tree

5 files changed

+27
-26
lines changed

5 files changed

+27
-26
lines changed

config

Whitespace-only changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This is the config for "Buf" - a ProtocolBuffer linter/checker/more
2-
# see https://buf.build/docs/configuration/v1/buf-yaml
3-
version: v1
4-
breaking: # https://buf.build/docs/configuration/v1/buf-yaml#breaking
2+
# see https://buf.build/docs/configuration/v2/buf-yaml
3+
version: v2
4+
breaking: # https://buf.build/docs/configuration/v2/buf-yaml#breaking
55
use: # see https://buf.build/docs/breaking/overview#rules-and-categories
66
- WIRE

tools/src/test/proto/buf_breaking-version.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This is the config for "Buf" - a ProtocolBuffer linter/checker/more
2-
# see https://buf.build/docs/configuration/v1/buf-yaml
3-
version: v1
4-
breaking: # https://buf.build/docs/configuration/v1/buf-yaml#breaking
2+
# see https://buf.build/docs/configuration/v2/buf-yaml
3+
version: v2
4+
breaking: # https://buf.build/docs/configuration/v2/buf-yaml#breaking
55
use: # see https://buf.build/docs/breaking/overview#rules-and-categories
66
- WIRE
77
except:

tools/src/test/proto/buf_lint.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# This is the config for "Buf" - a ProtocolBuffer linter/checker/more
2-
# see https://buf.build/docs/configuration/v1/buf-yaml
3-
version: v1
4-
lint: # https://buf.build/docs/configuration/v1/buf-yaml#lint
2+
# see https://buf.build/docs/configuration/v2/buf-yaml
3+
version: v2
4+
lint: # https://buf.build/docs/configuration/v2/buf-yaml#lint
55
use: # see https://buf.build/docs/lint/rules
6-
- DEFAULT # https://buf.build/docs/lint/rules#default
6+
- STANDARD # https://buf.build/docs/lint/rules/#standard
7+
# - COMMENTS # https://buf.build/docs/lint/rules/#comments
78
except:
89
# directory/file layout does not match the recommendation/framework of the tool
910
- DIRECTORY_SAME_PACKAGE # https://buf.build/docs/lint/rules#directory_same_package
@@ -14,9 +15,12 @@ lint: # https://buf.build/docs/configuration/v1/buf-yaml#lint
1415
- PACKAGE_VERSION_SUFFIX # https://buf.build/docs/lint/rules#package_version_suffix
1516
- FIELD_LOWER_SNAKE_CASE # https://buf.build/docs/lint/rules#field_lower_snake_case
1617
ignore_only:
17-
DEFAULT: # https://buf.build/docs/lint/rules#default
18-
# legacy schema files may NOT stick to the rules -- this is acknowledged.
18+
# legacy schema files may NOT stick to the rules -- this is acknowledged.
19+
STANDARD:
20+
- "schema/bom-1.5.proto"
21+
- "schema/bom-1.4.proto"
22+
- "schema/bom-1.3.proto"
23+
COMMENTS:
1924
- "schema/bom-1.5.proto"
2025
- "schema/bom-1.4.proto"
2126
- "schema/bom-1.3.proto"
22-
allow_comment_ignores: true # the so-called "baseline" is done by annotating exceptions

tools/src/test/proto/test.sh

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
set -ue
2+
set -uex
33

44
THIS_PATH="$(realpath "$(dirname "$0")")"
55
ROOT_PATH="$(realpath "${THIS_PATH}/../../../..")"
@@ -10,7 +10,7 @@ TEST_RES_DIR='tools/src/test/resources'
1010

1111
REMOTE="https://github.com/${GITHUB_REPOSITORY:-CycloneDX/specification}.git"
1212

13-
BUF_IMAGE_VERSION='1.30.1'
13+
BUF_IMAGE_VERSION='1.46.0'
1414

1515

1616
## ----
@@ -32,7 +32,6 @@ function schema-lint () {
3232
--workdir '/workspace' \
3333
bufbuild/buf:"$BUF_IMAGE_VERSION" \
3434
lint --path "$SCHEMA_DIR" \
35-
--config 'buf.yaml' \
3635
--error-format "$LOG_FORMAT"
3736

3837
echo '>> OK.' >&2
@@ -57,14 +56,13 @@ function schema-breaking-version () {
5756
echo ">> compare new:${NEW} -VS- old:${OLD}" >&2
5857
# stick with the original path of "$NEW", so the reporting makes sense...
5958
docker run --rm \
60-
--volume "${ROOT_PATH}/${SCHEMA_DIR}/${NEW}:/workspace/${SCHEMA_DIR}/${NEW}:ro" \
61-
--volume "${ROOT_PATH}/${SCHEMA_DIR}/${OLD}:/workspace/${SCHEMA_DIR_OLD}/${NEW}:ro" \
62-
--volume "${THIS_PATH}/buf_breaking-version.yaml:/workspace/buf.yaml:ro" \
63-
--workdir '/workspace' \
59+
--volume "${ROOT_PATH}/${SCHEMA_DIR}/${OLD}:/workspaces/old/${NEW}:ro" \
60+
--volume "${ROOT_PATH}/${SCHEMA_DIR}/${NEW}:/workspaces/new/${NEW}:ro" \
61+
--volume "${THIS_PATH}/buf_breaking-version.yaml:/workspaces/new/buf.yaml:ro" \
62+
--workdir '/workspaces' \
6463
bufbuild/buf:"$BUF_IMAGE_VERSION" \
65-
breaking "$SCHEMA_DIR" \
66-
--against "$SCHEMA_DIR_OLD" \
67-
--config 'buf.yaml' \
64+
breaking new \
65+
--against old \
6866
--error-format "$LOG_FORMAT"
6967
}
7068

@@ -90,9 +88,8 @@ function schema-breaking-remote () {
9088
--volume "${THIS_PATH}/buf_breaking-remote.yaml:/workspace/buf.yaml:ro" \
9189
--workdir '/workspace' \
9290
bufbuild/buf:"$BUF_IMAGE_VERSION" \
93-
breaking "$SCHEMA_DIR" \
94-
--against "${REMOTE}#subdir=${SCHEMA_DIR}" \
95-
--config 'buf.yaml' \
91+
breaking --path "$SCHEMA_DIR" \
92+
--against "${REMOTE}" \
9693
--error-format "$LOG_FORMAT"
9794

9895
echo '>> OK.' >&2

0 commit comments

Comments
 (0)