Skip to content

Commit

Permalink
Merge branch 'master' into fix/protobuuf-component-evidence-optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jkowalleck authored Nov 6, 2024
2 parents d88ded1 + f2f4c2d commit afd1a0e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 26 deletions.
Empty file added config
Empty file.
6 changes: 3 additions & 3 deletions tools/src/test/proto/buf_breaking-remote.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is the config for "Buf" - a ProtocolBuffer linter/checker/more
# see https://buf.build/docs/configuration/v1/buf-yaml
version: v1
breaking: # https://buf.build/docs/configuration/v1/buf-yaml#breaking
# see https://buf.build/docs/configuration/v2/buf-yaml
version: v2
breaking: # https://buf.build/docs/configuration/v2/buf-yaml#breaking
use: # see https://buf.build/docs/breaking/overview#rules-and-categories
- WIRE
6 changes: 3 additions & 3 deletions tools/src/test/proto/buf_breaking-version.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is the config for "Buf" - a ProtocolBuffer linter/checker/more
# see https://buf.build/docs/configuration/v1/buf-yaml
version: v1
breaking: # https://buf.build/docs/configuration/v1/buf-yaml#breaking
# see https://buf.build/docs/configuration/v2/buf-yaml
version: v2
breaking: # https://buf.build/docs/configuration/v2/buf-yaml#breaking
use: # see https://buf.build/docs/breaking/overview#rules-and-categories
- WIRE
except:
Expand Down
18 changes: 11 additions & 7 deletions tools/src/test/proto/buf_lint.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# This is the config for "Buf" - a ProtocolBuffer linter/checker/more
# see https://buf.build/docs/configuration/v1/buf-yaml
version: v1
lint: # https://buf.build/docs/configuration/v1/buf-yaml#lint
# see https://buf.build/docs/configuration/v2/buf-yaml
version: v2
lint: # https://buf.build/docs/configuration/v2/buf-yaml#lint
use: # see https://buf.build/docs/lint/rules
- DEFAULT # https://buf.build/docs/lint/rules#default
- STANDARD # https://buf.build/docs/lint/rules/#standard
# - COMMENTS # https://buf.build/docs/lint/rules/#comments
except:
# directory/file layout does not match the recommendation/framework of the tool
- DIRECTORY_SAME_PACKAGE # https://buf.build/docs/lint/rules#directory_same_package
Expand All @@ -14,9 +15,12 @@ lint: # https://buf.build/docs/configuration/v1/buf-yaml#lint
- PACKAGE_VERSION_SUFFIX # https://buf.build/docs/lint/rules#package_version_suffix
- FIELD_LOWER_SNAKE_CASE # https://buf.build/docs/lint/rules#field_lower_snake_case
ignore_only:
DEFAULT: # https://buf.build/docs/lint/rules#default
# legacy schema files may NOT stick to the rules -- this is acknowledged.
# legacy schema files may NOT stick to the rules -- this is acknowledged.
STANDARD:
- "schema/bom-1.5.proto"
- "schema/bom-1.4.proto"
- "schema/bom-1.3.proto"
COMMENTS:
- "schema/bom-1.5.proto"
- "schema/bom-1.4.proto"
- "schema/bom-1.3.proto"
allow_comment_ignores: true # the so-called "baseline" is done by annotating exceptions
23 changes: 10 additions & 13 deletions tools/src/test/proto/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -ue
set -uex

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

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

BUF_IMAGE_VERSION='1.30.1'
BUF_IMAGE_VERSION='1.46.0'


## ----
Expand All @@ -32,7 +32,6 @@ function schema-lint () {
--workdir '/workspace' \
bufbuild/buf:"$BUF_IMAGE_VERSION" \
lint --path "$SCHEMA_DIR" \
--config 'buf.yaml' \
--error-format "$LOG_FORMAT"

echo '>> OK.' >&2
Expand All @@ -57,14 +56,13 @@ function schema-breaking-version () {
echo ">> compare new:${NEW} -VS- old:${OLD}" >&2
# stick with the original path of "$NEW", so the reporting makes sense...
docker run --rm \
--volume "${ROOT_PATH}/${SCHEMA_DIR}/${NEW}:/workspace/${SCHEMA_DIR}/${NEW}:ro" \
--volume "${ROOT_PATH}/${SCHEMA_DIR}/${OLD}:/workspace/${SCHEMA_DIR_OLD}/${NEW}:ro" \
--volume "${THIS_PATH}/buf_breaking-version.yaml:/workspace/buf.yaml:ro" \
--workdir '/workspace' \
--volume "${ROOT_PATH}/${SCHEMA_DIR}/${OLD}:/workspaces/old/${NEW}:ro" \
--volume "${ROOT_PATH}/${SCHEMA_DIR}/${NEW}:/workspaces/new/${NEW}:ro" \
--volume "${THIS_PATH}/buf_breaking-version.yaml:/workspaces/new/buf.yaml:ro" \
--workdir '/workspaces' \
bufbuild/buf:"$BUF_IMAGE_VERSION" \
breaking "$SCHEMA_DIR" \
--against "$SCHEMA_DIR_OLD" \
--config 'buf.yaml' \
breaking new \
--against old \
--error-format "$LOG_FORMAT"
}

Expand All @@ -90,9 +88,8 @@ function schema-breaking-remote () {
--volume "${THIS_PATH}/buf_breaking-remote.yaml:/workspace/buf.yaml:ro" \
--workdir '/workspace' \
bufbuild/buf:"$BUF_IMAGE_VERSION" \
breaking "$SCHEMA_DIR" \
--against "${REMOTE}#subdir=${SCHEMA_DIR}" \
--config 'buf.yaml' \
breaking --path "$SCHEMA_DIR" \
--against "${REMOTE}" \
--error-format "$LOG_FORMAT"

echo '>> OK.' >&2
Expand Down

0 comments on commit afd1a0e

Please sign in to comment.