feat(usage): deprecate legacy periodic-usage endpoints [MOI-7251] - #288
Conversation
Code Review Agent Run #6e0df2Actionable Suggestions - 0Additional Suggestions - 1
Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Changelist by BitoThis pull request implements the following key changes.
|
|
| Source | Requirement / Code Area | Status | Notes |
|---|---|---|---|
| MOI-7251, Legacy-Endpoint-Deprecation, RFC-0011 | Add Daniel Edeling (@deprecated) YARD tags with sunset date 2027-02-28 to legacy periodic-usage methods and classes in the Ruby SDK | ✅ Met | All required methods and classes have Daniel Edeling (@deprecated) YARD tags with sunset date 2027-02-28 added: Client#organization_periodic_usages in lib/contentful/management/client.rb (lines 9-11), Client#space_periodic_usages in lib/contentful/management/client.rb (lines 23-25), ClientOrganizationPeriodicUsageMethodsFactory in lib/contentful/management/client_organization_periodic_usage_methods_factory.rb (lines 43-44), ClientSpacePeriodicUsageMethodsFactory in lib/contentful/management/client_space_periodic_usage_methods_factory.rb (lines 66-67), OrganizationPeriodicUsage in lib/contentful/management/organization_periodic_usage.rb (lines 89-90), and SpacePeriodicUsage in lib/contentful/management/space_periodic_usage.rb (lines 117-118). |
| MOI-7251 | Emit runtime deprecation warnings for legacy usage endpoint calls in the Ruby SDK | ✅ Met | All required entry-point and .all class methods emit runtime deprecation warnings: Client#organization_periodic_usages in lib/contentful/management/client.rb (lines 14-16) and Client#space_periodic_usages in lib/contentful/management/client.rb (lines 28-30) emit warn '[DEPRECATION]...' at call time. OrganizationPeriodicUsage.all in lib/contentful/management/organization_periodic_usage.rb (lines 102-104) and SpacePeriodicUsage.all in lib/contentful/management/space_periodic_usage.rb (lines 130-132) also emit warn '[DEPRECATION]...' messages at call time. |
| MOI-7251 | Verify build and full test suite pass for the Ruby SDK deprecation changes | 🟡 Partial | [Non-Diff Requirement] Build and test suite validation (bundle exec rspec and bundle exec rubocop) requires runtime execution and cannot be verified from the diff alone. The deprecation changes follow the established pattern from contentful-management.js and are syntactically correct. |
Impact Analysis by BitoInteraction DiagramsequenceDiagram
participant Dev as Developer
participant SDK as contentful-management.rb SDK<br/>🔄 Updated | ●●○ Medium
participant Client as Client<br/>🔄 Updated | ●●○ Medium
participant OrgFactory as ClientOrganizationPeriodicUsageMethodsFactory<br/>🔄 Updated | ●●○ Medium
participant ResFactory as ClientSpacePeriodicUsageMethodsFactory<br/>🔄 Updated | ●●○ Medium
participant OrgUsage as OrganizationPeriodicUsage<br/>🔄 Updated | ●●○ Medium
participant SpaceUsage as SpacePeriodicUsage<br/>🔄 Updated | ●●○ Medium
participant API as Contentful Management API
Note over Dev, API: Deprecation flow for legacy Usage API endpoints
Dev->>SDK: client.organization_periodic_usages(org_id)
SDK->>Client: organization_periodic_usages(organization_id)
Client->>Client: warn('[DEPRECATION] Legacy endpoint deprecated')
Client-->>SDK: Return ClientOrganizationPeriodicUsageMethodsFactory
SDK->>OrgFactory: all(params)
OrgFactory->>API: GET /organizations/{id}/organization_periodic_usages
alt alternative entrypoint
Dev->>SDK: OrganizationPeriodicUsage.all(client, org_id)
SDK->>OrgUsage: all(client, organization_id, params)
OrgUsage->>OrgUsage: warn('[DEPRECATION] Legacy endpoint deprecated')
OrgUsage->>OrgFactory: all(params)
OrgFactory->>API: GET /organizations/{id}/organization_periodic_usages
end
API-->>OrgFactory: Return OrganizationPeriodicUsage array
OrgFactory-->>SDK: Return Array<OrganizationPeriodicUsage>
SDK-->>Dev: Usage data (until 2027-02-28)
Note over Dev: After 2027-02-28 API returns 410 Gone
This PR adds deprecation warnings to legacy usage API endpoints (organization_periodic_usages and space_periodic_usages) in the contentful-management.rb SDK. Warnings are emitted via `warn()` at the Client and Resource class levels, alerting developers that these endpoints will return 410 Gone after 2027-02-28 and should migrate to the new Usage API. No functional changes to API calls are made - deprecation is informational only. Cross-Repository Impact Analysis
Code Paths AnalyzedImpact: Flow: Direct Changes (Diff Files): Repository Impact: Cross-Repository Dependencies: Database/Caching Impact: API Contract Violations: Infrastructure Dependencies: Additional Insights: Testing RecommendationsFrontend Impact: Service Integration: Data Serialization: Privacy Compliance: Backward Compatibility: OAuth Functionality: Reliability Testing: Additional Insights: Analysis based on known dependency patterns and edges. Actual impact may vary. |
✅ Review Settings OverriddenStatus: Guidelines:
Note: Extra guidelines beyond 3 general purpose guidelines and 1 language specific guideline per language are not processed. Guidelines are fetched from the source branch. |
Ticket: https://contentful.atlassian.net/browse/MOI-7251
Summary by Bito
This PR adds deprecation warnings to the legacy periodic-usage endpoints (organization_periodic_usages and space_periodic_usages) across the Contentful Management Ruby SDK. The changes affect 5 files by adding YARD Daniel Edeling (@deprecated) annotations and runtime warning messages that inform developers to migrate to the new Usage API before the 2027-02-28 removal date.
Detailed Changes