Skip to content

Commit ae934fd

Browse files
fix(review): read the --open review URL from stderr (oasdiff >= v1.19.1)
oasdiff v1.19.1 (#1011) moved the "Opening <url>" line from stdout to stderr so it can't corrupt piped --format json/yaml output. The action's --open run greps the URL from stdout with `2>/dev/null`, so against v1.19.1 it found no URL, emitted the misleading "couldn't upload, re-run" warning, and posted NO review comment -- a silent break of the whole free-review link. Caught by the w3 encrypted-review e2e run against tufin/oasdiff:latest. Merge stderr into the pipe (2>&1) so the URL is captured regardless of which stream oasdiff prints it on. Works with both old (stdout) and new (stderr) oasdiff. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 6b86343 commit ae934fd

2 files changed

Lines changed: 18 additions & 16 deletions

File tree

breaking/entrypoint.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,15 @@ if [ "$changes_exit" -eq 1 ]; then
230230
# "couldn't upload" warning below.
231231
echo "::notice::oasdiff: the side-by-side review isn't available in composed mode (-c). The breaking-change report above is unaffected."
232232
else
233-
# --open prints the review URL on stdout; in CI the browser-open
234-
# step soft-fails. We grep the /review/e/ URL out by its stable path
235-
# shape (not by surrounding prose). Tolerate a non-zero exit / no
236-
# match so `set -e` doesn't abort the run. --template= overrides a
237-
# 'template' set in .oasdiff.yaml, which would otherwise error this
238-
# render (templates are rejected for the default text format) and
239-
# yield no URL.
240-
free_review_url=$(oasdiff breaking "$base" "$revision" $flags --open --template= 2>/dev/null \
233+
# --open prints the review URL to stderr (oasdiff >= v1.19.1 moved it
234+
# off stdout so it can't corrupt piped --format output); in CI the
235+
# browser-open step soft-fails. Merge stderr into the pipe (2>&1) and
236+
# grep the /review/e/ URL out by its stable path shape (not by
237+
# surrounding prose). Tolerate a non-zero exit / no match so `set -e`
238+
# doesn't abort the run. --template= overrides a 'template' set in
239+
# .oasdiff.yaml, which would otherwise error this render (templates
240+
# are rejected for the default text format) and yield no URL.
241+
free_review_url=$(oasdiff breaking "$base" "$revision" $flags --open --template= 2>&1 \
241242
| grep -oE 'https://[^[:space:]]+/review/e/[^[:space:]]+' | head -n 1) || true
242243
if [ -n "$free_review_url" ]; then
243244
echo "### 📋 [View these breaking changes in a side-by-side review](${free_review_url})" >> "$GITHUB_STEP_SUMMARY"

changelog/entrypoint.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,15 @@ if [ "$changes_exit" -eq 1 ]; then
227227
# "couldn't upload" warning below.
228228
echo "::notice::oasdiff: the side-by-side review isn't available in composed mode (-c). The changelog above is unaffected."
229229
else
230-
# --open prints the review URL on stdout; in CI the browser-open
231-
# step soft-fails. We grep the /review/e/ URL out by its stable path
232-
# shape (not by surrounding prose). Tolerate a non-zero exit / no
233-
# match so `set -e` doesn't abort the run. --template= overrides a
234-
# 'template' set in .oasdiff.yaml, which would otherwise error this
235-
# render (templates are rejected for the default text format) and
236-
# yield no URL.
237-
free_review_url=$(oasdiff changelog "$base" "$revision" $flags --open --template= 2>/dev/null \
230+
# --open prints the review URL to stderr (oasdiff >= v1.19.1 moved it
231+
# off stdout so it can't corrupt piped --format output); in CI the
232+
# browser-open step soft-fails. Merge stderr into the pipe (2>&1) and
233+
# grep the /review/e/ URL out by its stable path shape (not by
234+
# surrounding prose). Tolerate a non-zero exit / no match so `set -e`
235+
# doesn't abort the run. --template= overrides a 'template' set in
236+
# .oasdiff.yaml, which would otherwise error this render (templates
237+
# are rejected for the default text format) and yield no URL.
238+
free_review_url=$(oasdiff changelog "$base" "$revision" $flags --open --template= 2>&1 \
238239
| grep -oE 'https://[^[:space:]]+/review/e/[^[:space:]]+' | head -n 1) || true
239240
if [ -n "$free_review_url" ]; then
240241
echo "### 📋 [View these API changes in a side-by-side review](${free_review_url})" >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)