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 #36807 - UX fixes and add update count action #10766

Merged
merged 5 commits into from
Oct 24, 2023

Conversation

sjha4
Copy link
Member

@sjha4 sjha4 commented Oct 12, 2023

What are the changes introduced in this pull request?

Added task link
Added action on page to refresh counts (Also sets up code to add syncs in the future)
UX fixes

Considerations taken when implementing this change?

What are the testing steps for this pull request?

  1. Go to Capsule> content tab and make sure the new action works.
  2. Also some minor cosmetic changes.

@sjha4 sjha4 force-pushed the count_update_action branch 3 times, most recently from 73af720 to a64615b Compare October 19, 2023 05:34
@sjha4
Copy link
Member Author

sjha4 commented Oct 19, 2023

[test katello]

@ianballou
Copy link
Member

I also noticed that failing content counts updates pauses the task. I think we could just make it stop completely and turn into a warning since the json update is all or nothing.

@sjha4
Copy link
Member Author

sjha4 commented Oct 20, 2023

The latest commit should:

  1. Allow content_counts to be updated even with presence of repositories not synced on capsule.
  2. Use skip over pause as rescue strategy for failed content_count update task.

@sjha4 sjha4 force-pushed the count_update_action branch from 47d98b1 to 5ffd73d Compare October 20, 2023 15:43
@sjha4
Copy link
Member Author

sjha4 commented Oct 20, 2023

[test katello]

@ianballou
Copy link
Member

The updated content count logic seems to be messing up somewhere for me. I have a content view version with a yum repo and a python repo that is promoted to 5 LCEs including Library. All of the LCEs except Library are assigned to my capsule, and only one of those are actually synced.

What I'm seeing is this:

               "content_counts" => {
                    "content_view_versions" => {
                        "2" => {
                            "repositories" => {
                                "2" => {
                                        "rpm" => 32,
                                    "erratum" => 4
                                }
                            }
                        },
                        "8" => {
                            "repositories" => {
                                "62" => {
                                        "rpm" => 32,
                                    "erratum" => 4
                                },
                                "63" => {}
                            }
                        }
                    }

63 is my python repo. For some reason, the counts are completely blank even though the smart proxy repo has python packages. The yum content is being recorded, however.

@sjha4
Copy link
Member Author

sjha4 commented Oct 20, 2023

The updated content count logic seems to be messing up somewhere for me. I have a content view version with a yum repo and a python repo that is promoted to 5 LCEs including Library. All of the LCEs except Library are assigned to my capsule, and only one of those are actually synced.

What I'm seeing is this:

               "content_counts" => {
                    "content_view_versions" => {
                        "2" => {
                            "repositories" => {
                                "2" => {
                                        "rpm" => 32,
                                    "erratum" => 4
                                }
                            }
                        },
                        "8" => {
                            "repositories" => {
                                "62" => {
                                        "rpm" => 32,
                                    "erratum" => 4
                                },
                                "63" => {}
                            }
                        }
                    }

63 is my python repo. For some reason, the counts are completely blank even though the smart proxy repo has python packages. The yum content is being recorded, however.

What did I do now?! Let me look.. 😭 😄

@ianballou
Copy link
Member

ianballou commented Oct 20, 2023

I think I see the issue, latest_content_counts is nil for a repo not yet synced on the smart proxy, so it's replacing the actual content counts that were calculated for a good repo earlier.

For example, it calculated the counts for my "Test" LCE first, which included the python repo. "Test" is synced to the smart proxy. Then, it calculated the counts for my "Prod" LCE, which is not yet synced. The counts for the python repo are {} since the latest_content_counts returned nil.

The fact that we loop through unarchived repositories might be making this difficult. Do you think we could be looping over archived repositories instead?
Never mind this crossed-out bit, we should be looping over the promoted repositories since they exist separately on the smart proxies.

@ianballou
Copy link
Member

So it seems we keep overwriting the content counts as we loop along because we're storing the counts only for the archived repository. However, on the smart proxy, we do sync the promoted repositories separately.

Should we go back to showing counts for all promoted repositories? Those are the ones that users consume from at least... I know it confused something in the UI, but I wonder if now the counts aren't showing enough.

@sjha4 sjha4 force-pushed the count_update_action branch from aaf009c to 870a9da Compare October 20, 2023 19:52
@sjha4
Copy link
Member Author

sjha4 commented Oct 23, 2023

Updated PR to:

  1. Return env_repo id as key in content_counts.
  2. Added metadata section to json to hold env_id of repo and library_instance_id of env_repo.
  3. Updated UI/tests to handle the JSON change.

@sjha4
Copy link
Member Author

sjha4 commented Oct 23, 2023

[test katello]

@sjha4 sjha4 force-pushed the count_update_action branch 2 times, most recently from 80bd242 to 65d2e35 Compare October 23, 2023 15:25
@sjha4 sjha4 force-pushed the count_update_action branch 3 times, most recently from 7edd49c to 15616fa Compare October 23, 2023 17:15
@sjha4 sjha4 force-pushed the count_update_action branch from 15616fa to a5982ec Compare October 23, 2023 18:52
Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

Overall this is looking good! Gonna do some more in-depth testing tomorrow, but I think it should be good soon.

@sjha4 sjha4 force-pushed the count_update_action branch from a5982ec to 46c7d01 Compare October 23, 2023 21:51
Copy link
Member

@ianballou ianballou left a comment

Choose a reason for hiding this comment

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

Looking good to me! Tested some more scenarios with removing LCEs from the smart proxy and the UI handled them well. Only caveat is the issue with the counts not updating if the repo list is completely empty, but that'll be taken care of in #10775

@sjha4 sjha4 merged commit ed38597 into Katello:master Oct 24, 2023
4 of 5 checks passed
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.

2 participants