Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #38055 - Fix future-dated subscriptions #11243

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jeremylenz
Copy link
Member

@jeremylenz jeremylenz commented Dec 2, 2024

What are the changes introduced in this pull request?

Problem 1:
Candlepin's GET owners/{owner_key}/products endpoint, called by Katello::Resources::Candlepin::Product.all, recently added a new param, active. When the param is not included, it apparently causes Candlepin to omit (some?) products with future-dated subscriptions. Sending the param active=include should restore the previous behavior. This affects Candlepin version 4.4.15 and above.

Problem 2:
The "Add Subscriptions" page does not display future-dated subscriptions, e.g. subscriptions whose start date is in the future. Sending the add_future param should fix that.

Considerations taken when implementing this change?

I don't think this should break anything, since the param would just be ignored on previous CP versions.

What are the testing steps for this pull request?

  1. Obtain a manifest with a future-dated subscription and no other subscriptions

  2. Import into a new organization

Without this PR: Manifest import fails with

Validation failed: Subscription can't be blank

From another org with a valid manifest imported, the "Add Subscriptions" page does not show any future-dated subscriptions available to add.

After:
Manifest import succeeds
You can see any future-dated subscriptions on the Add Subscriptions page. Compare with access.redhat.com > Subscription allocations > your manifest > Add subscriptions. The available subscriptions in Satellite should include future-dated ones just like this page does.

@jeremylenz jeremylenz changed the title Fixes #38055 - Send active=include for Product.all Fixes #38055 - Fix future-dated subscriptions Dec 2, 2024
assert_equal 9, @org.product_contents.length
assert_equal 342, @org.products.length
assert_equal 9597, @org.product_contents.length
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what made tests pass locally for me. But I am not sure if this test is correct or not. It does make sense that the number of imported products would vary now that I'm sending include=active, but I wouldn't expect numbers this big. I looked inside the fixture manifest files and didn't see 342 of anything..

@jeremylenz jeremylenz force-pushed the 38055-product-all-active-include-what-now branch from 6d4255f to 2aec5eb Compare December 3, 2024 14:41
@jeremylenz jeremylenz force-pushed the 38055-product-all-active-include-what-now branch from 2aec5eb to 8e2423d Compare December 3, 2024 15:58
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.

1 participant