Commit c9dbb73
fix(review): format-independent no-change detection; skip --open in composed mode (#164)
* fix(review): format-independent no-change detection; skip --open in composed mode
Two fixes to the free side-by-side review the breaking/changelog actions post.
1. changelog: detect "no changes" independently of --format. The old test
grepped the first output line for "^No ", which only holds for the default
text format. With format: json or yaml an empty changelog renders as "[]",
and with markup it's a header line followed by "No changes detected" -- both
slipped past the test, so every clean PR got a spurious review link (and an
uploaded comparison). Detection now uses a json probe ("[]" == no changes),
which is unambiguous across formats. To make that probe (and the --open
upload) safe, format/template are pulled out of the semantic $flags into a
separate $fmt_flags used only for the user-facing render -- otherwise the
probe would pass --format twice and, worse, error out when a template is set
(--template is rejected for json).
2. breaking + changelog: in composed mode (-c) the action no longer runs
--open. The encrypted review carries exactly two specs and can't represent a
glob of many files, so --open now returns a clear non-fatal message in the
CLI; the action would otherwise surface the generic "couldn't upload, re-run"
warning. Emit a single ::notice:: explaining the review isn't available in
composed mode instead.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* docs(review): drop stale "reuse the same semantic flags" comment
The sentence was a remnant of an abandoned approach and added no information
(passing $flags to the --open run is plain from the code). Keep the part of the
comment that still explains the real subtleties: --open prints the URL on stdout,
the browser-open soft-fails in CI, we grep the URL by its path shape, and the
run is tolerated as non-fatal.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(changelog): detect changes via --fail-on=INFO exit code, not json parsing
Replace the json-render "[]" probe with oasdiff's own changes-present signal:
run changelog with --fail-on=INFO and read the exit code (1 = at least one change
at or above --level, 0 = empty). This is format-proof by construction (no output
parsing) and is the canonical "are there changes" check. --level stays in the
probe so detection matches what the user sees; the explicit --fail-on overrides
any config fail-on for the probe only, and the user-facing render is untouched.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(breaking): detect changes via --fail-on=WARN exit code, not "^No " text
The "^No " first-line heuristic assumed the breaking output is always text, but
.oasdiff.yaml can set 'format' (the CLI flag exists even though the action has no
format input), so a config format=json/html/markup makes an empty result render
as "[]" / "<!DOCTYPE...>" / a header line and the heuristic flags a clean PR as
having changes (spurious review + upload every run). Detect via oasdiff's exit
code with --fail-on=WARN instead (WARN is breaking's display level and the lowest
fail-on it accepts): exit 1 = at least one breaking change, 0 = none. Matches the
changelog approach. The explicit --fail-on overrides any config fail-on for the
probe only; Run 1's authoritative gate exit code is untouched.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(review): harden actions against disruptive .oasdiff config
.oasdiff.yaml can set most oasdiff flags, and the action's control flow assumed
some of them. Override the ones the logic depends on, on the command line (cmd-line
beats config):
- composed: pin --composed=<input> in $flags (all runs). A config composed:true
would otherwise run composed mode while the action's --open guard / flag building
still think it's off, desyncing them (the review run would fail the new CLI
composed check or build a bogus review).
- template: pin --template= on the runs that force/assume a non-template format and
whose output the action depends on -- the changelog/breaking change-probes
(default text), both --open runs (default text), and breaking's githubactions
annotations run. A config 'template' is rejected for those formats and would make
a probe a false negative, drop the review URL, or (via || true) silently suppress
the breaking annotations.
- changelog: treat exit 1 as non-fatal (>=2 are real errors), matching breaking. A
fail-on set in .oasdiff.yaml would otherwise make the changelog main run exit 1
and abort before the review is posted. (--fail-on= can't be pinned: empty is
rejected.)
Note: 'open' cannot be set via config -- it's not in oasdiff's Config struct, so
UnmarshalExact rejects it; no override needed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent dc68976 commit c9dbb73
2 files changed
Lines changed: 111 additions & 63 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
189 | | - | |
190 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
191 | 194 | | |
192 | 195 | | |
193 | 196 | | |
| |||
199 | 202 | | |
200 | 203 | | |
201 | 204 | | |
202 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
203 | 215 | | |
204 | 216 | | |
205 | 217 | | |
| |||
211 | 223 | | |
212 | 224 | | |
213 | 225 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
226 | 232 | | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
233 | 256 | | |
234 | 257 | | |
235 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
139 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
152 | 162 | | |
153 | | - | |
| 163 | + | |
154 | 164 | | |
155 | 165 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 166 | + | |
160 | 167 | | |
161 | | - | |
| 168 | + | |
162 | 169 | | |
163 | 170 | | |
164 | 171 | | |
| |||
172 | 179 | | |
173 | 180 | | |
174 | 181 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
181 | 187 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 188 | + | |
| 189 | + | |
187 | 190 | | |
188 | 191 | | |
189 | 192 | | |
| |||
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
197 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
198 | 212 | | |
199 | 213 | | |
200 | 214 | | |
| |||
206 | 220 | | |
207 | 221 | | |
208 | 222 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
221 | 229 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
228 | 253 | | |
229 | 254 | | |
230 | 255 | | |
| |||
0 commit comments