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

Add annotations on container summary pages that contain labels #9214

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

liu-samuel
Copy link
Contributor

@liu-samuel liu-samuel commented Jun 27, 2024

Add annotations on container summary pages that contain labels, remove custom attributes tab from container nodes summary page

Resolves #9069

Relevant PRs:
Providers-Kubernetes: ManageIQ/manageiq-providers-kubernetes#530
Providers-Openshift: ManageIQ/manageiq-providers-openshift#262
Core ManageIQ: ManageIQ/manageiq#23074

Old:
Screenshot 2024-06-27 at 7 41 03 PM

New:
Screenshot 2024-06-28 at 1 31 38 PM

Cross-Repo Tests:
ManageIQ/manageiq-cross_repo-tests#879
All passing except for known failing test cases in core ManageIQ

@Fryguy
Copy link
Member

Fryguy commented Jun 28, 2024

@GilbertCherrie While looking at this I noticed that Compliance is sort of buried on the left. For consistency, we should move it to the top-right. I'll open a separate issue for that, unless someone wants to tackle it beforehand.

@Fryguy
Copy link
Member

Fryguy commented Jun 28, 2024

@liu-samuel In looking at your example, the annotations look identical to the custom attributes (or maybe a super-set?). Should we pull those out of custom attributes since they have a dedicated panel? The same really goes for labels too.

cc @agrare

@@ -73,6 +73,13 @@ def textual_group_container_labels
TextualGroup.new(_("Labels"), textual_key_value_group(@record.labels.to_a))
end

def textual_group_annotations
if @record && @record.respond_to?(:custom_attributes)
annotations = @record.custom_attributes.select { |attribute| attribute.section == "annotations" }
Copy link
Member

@Fryguy Fryguy Jun 28, 2024

Choose a reason for hiding this comment

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

We have methods at the model level for separating these out, so I think this separation belongs at the model level. See https://github.com/ManageIQ/manageiq/tree/master/app/models/container_group.rb#L20-L27

Copy link
Member

Choose a reason for hiding this comment

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

And I think this is why custom_attributes is showing duplicate information. If you look at the textual_miq_custom_attributes method it looks at everything (the superset).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In that case, should I just remove annotations and labels from the nodes summary page and just leave the custom attributes dropdown? I believe that was the only summary page that had custom attributes instead of annotations and labels separately.

Copy link
Member

Choose a reason for hiding this comment

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

I was actually thinking the other way around - maybe we just remove custom attributes? Side q - maybe for @agrare, can we store custom attributes but for miq purposes? If so, then I would think we'd keep custom attributes but filter out the labels/node_selectors/annoatations

Copy link
Member

Choose a reason for hiding this comment

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

Yeah custom_attributes are used for a bunch of purposes, ":source => "EVM" is for MIQ internal purposes

Copy link
Contributor Author

@liu-samuel liu-samuel Jun 28, 2024

Choose a reason for hiding this comment

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

Sure, I can just remove it from the UI so it only shows annotations and labels

@agrare
Copy link
Member

agrare commented Jul 18, 2024

Looks good but appears you picked up a merge commit pulling from master, recommend pull.rebase=true in your gitconfig (see https://www.manageiq.org/docs/guides/developer_setup/git_workflow)

@liu-samuel
Copy link
Contributor Author

liu-samuel commented Jul 18, 2024

Looks good but appears you picked up a merge commit pulling from master, recommend pull.rebase=true in your gitconfig (see https://www.manageiq.org/docs/guides/developer_setup/git_workflow)

I think I just made it worse, should I just create a new PR?

@liu-samuel
Copy link
Contributor Author

Looks good but appears you picked up a merge commit pulling from master, recommend pull.rebase=true in your gitconfig (see https://www.manageiq.org/docs/guides/developer_setup/git_workflow)

I think I just made it worse, should I just create a new PR?

Nevermind, fixed it

@agrare
Copy link
Member

agrare commented Jul 18, 2024

Looks good now @liu-samuel

@miq-bot
Copy link
Member

miq-bot commented Jul 18, 2024

Checked commit liu-samuel@131f1b1 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
7 files checked, 2 offenses detected

app/helpers/container_summary_helper.rb

@agrare agrare closed this Jul 22, 2024
@agrare agrare reopened this Jul 22, 2024
@agrare agrare merged commit 94f4726 into ManageIQ:master Jul 22, 2024
26 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFE] Show Annotations in Container Summary Pages
5 participants