Skip to content

feat: Display deprecation and sunset date in changelogs#771

Merged
reuvenharrison merged 6 commits intooasdiff:mainfrom
grid-x:main
Jan 25, 2026
Merged

feat: Display deprecation and sunset date in changelogs#771
reuvenharrison merged 6 commits intooasdiff:mainfrom
grid-x:main

Conversation

@wwerner
Copy link
Contributor

@wwerner wwerner commented Nov 5, 2025

Add optional display of sunset date and stability level for deprecated
endpoints and parameters in changelogs. Details are only shown when
values are present.

Changes:

  • Add formatDeprecationDetails() helper to conditionally format
    deprecation metadata (sunset date, stability level)
  • Update deprecation checkers to pass formatted details via Comment field
  • Update changelog templates (markdown and HTML) to display comments
  • Update formatters to preserve formatted comments without localization
  • Update localization messages to work with new comment-based approach
  • Update tests to use Contains() assertions for flexible text matching

Example outputs:

  • Without details: "endpoint deprecated"
  • With sunset: "endpoint deprecated (sunset: 2025-11-10)"
  • With both: "endpoint deprecated (sunset: 2025-11-10, stability: alpha)"

  Add optional display of sunset date and stability level for deprecated
  endpoints and parameters in changelogs. Details are only shown when
  values are present, avoiding empty parentheses.

  Changes:
  - Add formatDeprecationDetails() helper to conditionally format
    deprecation metadata (sunset date, stability level)
  - Fix bug where deprecations without sunset dates were not appearing
    in changelogs when no deprecation policy is defined
  - Update deprecation checkers to pass formatted details via Comment field
  - Update changelog templates (markdown and HTML) to display comments
  - Update formatters to preserve formatted comments without localization
  - Update localization messages to work with new comment-based approach
  - Update tests to use Contains() assertions for flexible text matching

  Example outputs:
  - Without details: "endpoint deprecated"
  - With sunset: "endpoint deprecated (sunset: 2025-11-10)"
  - With both: "endpoint deprecated (sunset: 2025-11-10, stability: alpha)"
@codecov-commenter
Copy link

codecov-commenter commented Jan 2, 2026

Codecov Report

❌ Patch coverage is 87.32394% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.73%. Comparing base (635bec4) to head (13475c1).

Files with missing lines Patch % Lines
checker/check_api_deprecation.go 91.89% 1 Missing and 2 partials ⚠️
formatters/changes.go 40.00% 2 Missing and 1 partial ⚠️
formatters/changes_by_endpoint.go 75.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #771      +/-   ##
==========================================
- Coverage   88.73%   88.73%   -0.01%     
==========================================
  Files         246      246              
  Lines       12144    12201      +57     
==========================================
+ Hits        10776    10826      +50     
- Misses        930      932       +2     
- Partials      438      443       +5     
Flag Coverage Δ
unittests 88.73% <87.32%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

reuvenharrison added a commit that referenced this pull request Jan 6, 2026
@reuvenharrison
Copy link
Collaborator

Hi @wwerner,

  1. As you can see in the codecov report above, some tests are missing
  2. There seems to be a formatting problem in the output:
❯ oasdiff changelog data/deprecation/base.yaml  data/deprecation/deprecated-future.yaml
1 changes: 0 error, 0 warning, 1 info
info	[endpoint-deprecated] at data/deprecation/deprecated-future.yaml
	in API GET /api/test
		endpoint deprecated
		 (sunset: 9999-08-10)
  1. Please merge main into your branch and push again

@wwerner
Copy link
Contributor Author

wwerner commented Jan 16, 2026

Hey @reuvenharrison, thanks a ton for having a look. Will get back to you with proper tests. 🙏

@nd291195
Copy link
Contributor

nd291195 commented Jan 19, 2026

Hey @reuvenharrison. I just pushed the tests. But it seems like the codecov-commenter does not get retriggered. Can you help me out here? Thanks a lot!

@reuvenharrison reuvenharrison merged commit 13475c1 into oasdiff:main Jan 25, 2026
8 checks passed
Sign up for free to 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.

4 participants