feature: Add support for showing changelog for deprecated properties#782
Conversation
| // Track reported properties to avoid duplicates per operation | ||
| reportedProperties := make(map[string]bool) | ||
|
|
There was a problem hiding this comment.
This is a pragmatic solution to the duplicate reporting issue. While #594 outlines a more comprehensive approach with media-type context, this provides immediate user value with low risk.
The deduplication logic is isolated and easy to maintain. When the wider solution from #594 is implemented, this can be cleanly removed without affecting other code.
Suggestion: Consider adding a TODO comment to document the temporary nature:
// TODO(#594): Remove this deduplication when media-type context is added to messages
reportedProperties := make(map[string]bool)|
Some tasks remain before we can merge:
Currently Missing:1. Reactivation Detection ❌
2. Stability Level Handling ❌
3. Sunset Date Validation ❌
Currently Implemented:✅ New Deprecation Detection - Lines 38-48 RecommendationI suggest enhancing this checker to match the completeness of
Note: The same gaps exist in check_response_property_deprecation.go, so both property deprecation checkers would benefit from these enhancements. |
|
Thanks for the detailed feedback! I’ve implemented the suggested changes.
4.Added corresponding unit tests for all new scenarios (reactivation, stability handling, and early sunset). Please review the updates |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #782 +/- ##
==========================================
+ Coverage 88.78% 89.00% +0.21%
==========================================
Files 246 248 +2
Lines 12183 12402 +219
==========================================
+ Hits 10817 11038 +221
+ Misses 928 926 -2
Partials 438 438
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for the feedback! I have Added missing patch coverage for property deprecation. Please review the updates |
- Change deprecated message to not include sunset date in localized text, use WithDetails() for sunset/stability info instead - Add missing INFO-level change when no sunset and no deprecation policy - Fix localization format strings to use %s instead of %d - Rewrite tests to use require assertions instead of t.Logf/t.Errorf - Add MessageWithoutDetails tests for both request and response properties Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add support for detecting deprecated request and response properties in changelogs
Detect when properties in request/response bodies become deprecated, with sunset date validation. This feature also support nested properties, allOf/oneOf/anyOf schemas, and prevent duplicate reports for the same property.
Changes:
New files added
Add function that supports request property deprecation with sunset validation checker/check_request_property_deprecation.go
checker/check_request_property_deprecation_test.go
Add function that supports response property deprecation with sunset validation
checker/check_response_property_deprecation.go
checker/check_response_property_deprecation_test.go
Also some sample files created in data/deprecation
Updated files
Messages updated for oasdiff CLI in checker/localizations_src/en/messages.yaml
Update localization messages to work with new comment-based approach
Updated BackwardCompatibilityRules in checker/rules.go
Example outputs:
Without details: "request-property-deprecated"
With sunset: "request-property-deprecated with sunset date(2026-12-31)"
With Inavalid/Missing sunset: "request-property-deprecated without/missing sunset date"