From 4f8f94667f9d1bfbb00690d0bdfea23a1049ce48 Mon Sep 17 00:00:00 2001 From: Reuven Harrison Date: Sun, 14 Jun 2026 23:32:48 +0300 Subject: [PATCH] fix(review): read the --open review URL from stderr (oasdiff >= v1.19.1) oasdiff v1.19.1 (#1011) moved the "Opening " 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 --- breaking/entrypoint.sh | 17 +++++++++-------- changelog/entrypoint.sh | 17 +++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/breaking/entrypoint.sh b/breaking/entrypoint.sh index fc43542..1a63510 100755 --- a/breaking/entrypoint.sh +++ b/breaking/entrypoint.sh @@ -230,14 +230,15 @@ if [ "$changes_exit" -eq 1 ]; then # "couldn't upload" warning below. echo "::notice::oasdiff: the side-by-side review isn't available in composed mode (-c). The breaking-change report above is unaffected." else - # --open prints the review URL on stdout; in CI the browser-open - # step soft-fails. We grep the /review/e/ URL out by its stable path - # shape (not by surrounding prose). Tolerate a non-zero exit / no - # match so `set -e` doesn't abort the run. --template= overrides a - # 'template' set in .oasdiff.yaml, which would otherwise error this - # render (templates are rejected for the default text format) and - # yield no URL. - free_review_url=$(oasdiff breaking "$base" "$revision" $flags --open --template= 2>/dev/null \ + # --open prints the review URL to stderr (oasdiff >= v1.19.1 moved it + # off stdout so it can't corrupt piped --format output); in CI the + # browser-open step soft-fails. Merge stderr into the pipe (2>&1) and + # grep the /review/e/ URL out by its stable path shape (not by + # surrounding prose). Tolerate a non-zero exit / no match so `set -e` + # doesn't abort the run. --template= overrides a 'template' set in + # .oasdiff.yaml, which would otherwise error this render (templates + # are rejected for the default text format) and yield no URL. + free_review_url=$(oasdiff breaking "$base" "$revision" $flags --open --template= 2>&1 \ | grep -oE 'https://[^[:space:]]+/review/e/[^[:space:]]+' | head -n 1) || true if [ -n "$free_review_url" ]; then echo "### 📋 [View these breaking changes in a side-by-side review](${free_review_url})" >> "$GITHUB_STEP_SUMMARY" diff --git a/changelog/entrypoint.sh b/changelog/entrypoint.sh index 77fce43..ba41f09 100755 --- a/changelog/entrypoint.sh +++ b/changelog/entrypoint.sh @@ -227,14 +227,15 @@ if [ "$changes_exit" -eq 1 ]; then # "couldn't upload" warning below. echo "::notice::oasdiff: the side-by-side review isn't available in composed mode (-c). The changelog above is unaffected." else - # --open prints the review URL on stdout; in CI the browser-open - # step soft-fails. We grep the /review/e/ URL out by its stable path - # shape (not by surrounding prose). Tolerate a non-zero exit / no - # match so `set -e` doesn't abort the run. --template= overrides a - # 'template' set in .oasdiff.yaml, which would otherwise error this - # render (templates are rejected for the default text format) and - # yield no URL. - free_review_url=$(oasdiff changelog "$base" "$revision" $flags --open --template= 2>/dev/null \ + # --open prints the review URL to stderr (oasdiff >= v1.19.1 moved it + # off stdout so it can't corrupt piped --format output); in CI the + # browser-open step soft-fails. Merge stderr into the pipe (2>&1) and + # grep the /review/e/ URL out by its stable path shape (not by + # surrounding prose). Tolerate a non-zero exit / no match so `set -e` + # doesn't abort the run. --template= overrides a 'template' set in + # .oasdiff.yaml, which would otherwise error this render (templates + # are rejected for the default text format) and yield no URL. + free_review_url=$(oasdiff changelog "$base" "$revision" $flags --open --template= 2>&1 \ | grep -oE 'https://[^[:space:]]+/review/e/[^[:space:]]+' | head -n 1) || true if [ -n "$free_review_url" ]; then echo "### 📋 [View these API changes in a side-by-side review](${free_review_url})" >> "$GITHUB_STEP_SUMMARY"