File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed
Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 33version : v2
44breaking : # https://buf.build/docs/configuration/v2/buf-yaml#breaking
55 use : # see https://buf.build/docs/breaking/overview#rules-and-categories
6- - WIRE
7- except :
8- # scope is to detect changes from one version to the other -> so ignore "FILE_SAME_PACKAGE"
9- - FILE_SAME_PACKAGE
6+ - WIRE
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2- set -uex
2+ set -ue
33
44THIS_PATH=" $( realpath " $( dirname " $0 " ) " ) "
55ROOT_PATH=" $( realpath " ${THIS_PATH} /../../../.." ) "
@@ -51,23 +51,29 @@ function schema-breaking-version () {
5151 function compare() {
5252 NEW=" bom-${1} .proto"
5353 OLD=" bom-${2} .proto"
54- SCHEMA_DIR_OLD=" ${SCHEMA_DIR} _old"
54+
55+ NEW_NP=" $( mktemp) "
56+ OLD_NP=" $( mktemp) "
57+
58+ # remove package identifier -> so that the comparisson works as expected
59+ sed ' s/^package .*//' " ${ROOT_PATH} /${SCHEMA_DIR} /${NEW} " > " $NEW_NP "
60+ sed ' s/^package .*//' " ${ROOT_PATH} /${SCHEMA_DIR} /${OLD} " > " $OLD_NP "
5561
5662 echo " >> compare new:${NEW} -VS- old:${OLD} " >&2
5763 # stick with the original path of "$NEW", so the reporting makes sense...
5864 docker run --rm \
59- --volume " ${ROOT_PATH} / ${SCHEMA_DIR} / ${OLD } :/workspaces/old/${NEW} :ro" \
60- --volume " ${ROOT_PATH} / ${SCHEMA_DIR} / ${NEW } :/workspaces/new/${NEW} :ro" \
65+ --volume " ${OLD_NP } :/workspaces/old/${NEW} :ro" \
66+ --volume " ${NEW_NP } :/workspaces/new/${NEW} :ro" \
6167 --volume " ${THIS_PATH} /buf_breaking-version.yaml:/workspaces/new/buf.yaml:ro" \
62- --workdir ' /workspaces' \
68+ --workdir ' /workspaces/new ' \
6369 bufbuild/buf:" $BUF_IMAGE_VERSION " \
64- breaking new \
65- --against old \
70+ breaking \
71+ --against ../ old \
6672 --error-format " $LOG_FORMAT "
6773 }
6874
69- compare ' 1.6' ' 1.5'
70- compare ' 1.5' ' 1.4'
75+ # compare '1.6' '1.5' # <-- possible breaks are acknowledged
76+ # compare '1.5' '1.4' # <-- possible breaks are acknowledged
7177 compare ' 1.4' ' 1.3'
7278
7379 echo ' >> OK.' >&2
You can’t perform that action at this time.
0 commit comments