Skip to content

Fix api-spec no-change detection for oasdiff v0.1.x - #61

Merged
turegjorup merged 2 commits into
developfrom
ci/api-spec-no-change-detection
Jul 9, 2026
Merged

Fix api-spec no-change detection for oasdiff v0.1.x#61
turegjorup merged 2 commits into
developfrom
ci/api-spec-no-change-detection

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Fixes the misleading "⚠️ API specification — non-breaking changes" comment on PRs that don't touch the spec (e.g. #60, the Elasticsearch bump — the comment body literally read "No changelog changes").

Root cause

The detect-breaking-changes job's "Determine whether the spec changed" step:

if [ -s changelog.md ] &&! grep -qi 'no changes' changelog.md;then has_changes=true

oasdiff v0.1.x (adopted in #49) emits "No changelog changes" for an unchanged spec. The grep looks for the substring no changes, which doesn't occur in "No changelog changes", so has_changes was always true → the ⚠️ comment fired with an empty/no-change body. (The pre-v0.1 wording was "No changes", which matched — so this regressed with the version bump, undetected until a no-spec-change PR ran.)

Fix

Match both wordings: grep -qiE 'no (changelog )?changes'. Verified it flags "No changelog changes" and "No changes" as no-change, while a real changelog (e.g. ### GET /api/v2/events\n- added …) still counts as a change.

With this, a no-spec-change PR takes the no-change path: the ⚠️ comment no longer posts, and any prior comment self-heals to ✅ (via #55's resolve step).

The changelog step's "spec changed?" guard grepped for the literal
"no changes", but oasdiff v0.1.x emits "No changelog changes" when the
spec is unchanged — the substring never matched, so has_changes was
always true and a "⚠️ non-breaking changes" comment posted (body: "No
changelog changes") even for PRs that don't touch the spec (e.g. the
Elasticsearch bump #60). Match both wordings with a regex so the
no-change path is taken and the sticky comment resolves to ✅.
@turegjorup
turegjorupforce-pushed the ci/api-spec-no-change-detection branch from 3f3b30b to 4e3dcfcCompareJuly 9, 2026 09:00
@turegjorupturegjorup self-assigned this Jul 9, 2026
@turegjorup
turegjorup merged commit c323c7b into developJul 9, 2026
12 checks passed
@turegjorup
turegjorup deleted the ci/api-spec-no-change-detection branch July 9, 2026 09:02
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.89%. Comparing base (63839c8) to head (4e3dcfc).
⚠️ Report is 12 commits behind head on develop.

Additional details and impacted files
@@ Coverage Diff @@## develop #61 +/- ##
==========================================
Coverage 72.89% 72.89% Complexity 232 232 ==========================================
Files 29 29 Lines 653 653 ==========================================
Hits 476 476 Misses 177 177 
FlagCoverage Δ
unittests72.89% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@turegjorup@codecov-commenter