-
Task
-
Resolution: Done
-
Major
-
None
-
None
-
5
-
False
-
-
True
-
-
Currently, when quantity changes on a subscription, we terminate the current subscription record and create a new record with the same ID but with the updated quantity, a start date of the current time, and an end date of the original subscription record.
Rather than using changes as they come in as authoritative, we should use the entitlement gateway as authoritative (for contract or paygo subscriptions) on the history and rewrite our history based on information provided by the entitlement gateway.
The quantity updating code is in SubscriptionSyncController.syncSubscription.
Partner Gateway API Information:
- https://gitlab.corp.redhat.com/it-partner-integration/ibm-entitlement-gateway/-/blob/master/server/src/main/resources/IBMEntitlementGatewaySpec.openapi.yaml?ref_type=heads
- https://ibm-entitlement-gateway.dev.api.redhat.com/swagger-ui/index.html?configUrl=/api-docs/swagger-config
Done Criteria
- For subscriptions coming from the IT Partner Gateway, history of changes as represented in the Partner Gateway records is used as the authoritative source of history for a subscription in subscription-watch.
- If a subscription has data from both the Subscription Service and the IT Partner Gateway, then the data from the Partner Gateway is considered canonical.
- After a sync the full history in subscription-watch matches the history from the IT Partner Gateway
- Automation tests that cover the above cases in ephemeral environments. Some prior work around automation of this type of test was done in https://github.com/RedHatInsights/rhsm-subscriptions/pull/2841
The internal contracts api /api/swatch-contracts/internal/contracts/ properly reflects the proper quantity based on dates before the change & after the change. This is specified with the timestamp parameter on the api endpoint (https://github.com/RedHatInsights/rhsm-subscriptions/blob/fd2af75cdb4e05cf2ec44cad99b0bc593e9cfcac/swatch-contracts/src/main/resources/META-INF/openapi.yaml#L146)
-
- This should be done using helpers. There is an existing python library for working with wiremock (https://github.com/wiremock/python-wiremock)
- Test that when the start date of a subscription is moved later, it is accurately represented for a contract/payg subscription.
- Test that when the start date of a subscription is moved earlier, it is accurately represented for a contract/payg subscription.
- When a subscription is sourced from the entitlement gateway, and they increase a dimension (eg 100 vcpu hours to 200 vcpu hours), the change is recorded properly & is reflected in the capacity API responses based on the day queried.
- blocks
-
SWATCH-2660 Stop maintaining quantity change information on traditional subscriptions capacity line
-
- Backlog
-
- clones
-
SWATCH-2660 Stop maintaining quantity change information on traditional subscriptions capacity line
-
- Backlog
-