-
Notifications
You must be signed in to change notification settings - Fork 293
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 #37881 - Update global reg form for multi-env AKs and clean up loose ends #11169
Conversation
@@ -7,7 +7,7 @@ def plugin_data | |||
aks = ActivationKey.authorized(:view_activation_keys) | |||
.where(organization_id: registration_params[:organization_id]) | |||
.order(:name) | |||
.map { |ak| { name: ak.name, lce: ak.environment&.name } } | |||
.map { |ak| { name: ak.name, cves: ak.content_view_environments.map(&:label).join(', ') } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the space after comma necessary ? does it work ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you were copy/pasting to hammer with the spaces you'd need quotes. But this is just for displaying in the web UI, so I thought the spaces just looked nicer.
@@ -26,8 +26,8 @@ child :content_view_environments => :content_view_environments do | |||
lifecycle_environment_library: cve.lifecycle_environment&.library? | |||
} | |||
end | |||
node :candlepin_name do |cve| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I 'd be nervous to do this for an api response. Can we may be have both ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code that introduced this API response node was just merged today IIRC, so I don't think anyone relies on it yet. Thoughts?
Also updated the setting description since multiCV works with both hosts and AKs now. |
4b37ae0
to
7c8b96a
Compare
rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been able to verify that the activation keys dropdown on the global registration form displays the correct lifecycle environment and content view pairs in a variety of circumstances; anything from 0 to 10 pairs seems to work without issue. Selecting and using an activation key while registering a host still works the same as before.
After a host is registered using host registration, the banner on top of the Host Details → Content → Repository Sets tab is able to appropriately describe the repository sets being displayed. All repos, repos from one environment, and repos from more than one environment seem to display well.
I'm going to ACK, but there are still two issues for which I wanted to get your opinion:
1 - The help text still refers to 'Candlepin environment names' instead of labels. Is this intentional? 'le_label/cv_label' is the correct format, but I'm not sure if you wanted to replace this since you replaced a lot of other references to environment name:
$hammer activation-key update --help
...
--content-view-environments LIST Comma-separated list of Candlepin environment names to be associated with the
activation key, in the format of
'lifecycle_environment_label/content_view_label'. Ignored if
content_view_environment_ids is specified, or if content_view_id and
lifecycle_environment_id are specified. Requires allow_multiple_content_views
setting to be on.
2 - If a user edits the AC or host to contain the Library/Library content view environment (via using activation-key update --content-view-environment-ids 1,...
or host update...
) the banner on the repository sets tab will not render. I don't believe this will be an issue for users since as far as I can tell Library/Library is an invalid CV for a host.
7c8b96a
to
04ffc2c
Compare
Good catch! Updated.
I'm concerned; how did you achieve this? When you do this you should get an error:
(side note: When a host is associated with |
I was able to use |
Can you show me that? Its label should be Library, not Library/Library |
You're correct, thank you 🙏. Id 1 is 'Library' |
What are the changes introduced in this pull request?
candlepin_name
andcandlepin_names
methods and method arguments tolabels
throughout the Ruby codebase.Considerations taken when implementing this change?
This resolves the outstanding issues mentioned in #11161 (comment)
It also cleans up the loose end with the setting description, and eliminates a TODO comment.
What are the testing steps for this pull request?
This should affect these places in the UI - make sure everything works ok:
also, the method name changes affect multi-env hosts and AKs, so test some updates and make sure everything still works.