-
Notifications
You must be signed in to change notification settings - Fork 83
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 #36814 - add content counts to capsule content info #913
Fixes #36814 - add content counts to capsule content info #913
Conversation
Issues: #36814 |
Requires this Katello PR: Katello/katello#10765 |
aef0835
to
ac95e6a
Compare
The test failures appear to be occurring against master as well. Looks like the failures are deprecation warnings from Mocha. |
I'll take a look tomorrow and see what is going on. I swear the wind blows and the test fails lol. |
@ianballou It looks like this test is failing:
I am guessing the changes you made to the sync status command, made it unhappy |
ac95e6a
to
c35ecc7
Compare
Tests should be fixed now! |
Code looks fine, starting to test |
When I try to do the
I don't see any traceback on the production.log |
@chris1984 can I see your debug output? Wondering if you have a CV without any repositories. I don't think I tried that. |
@ianballou Here is the debug output: hammer -d capsule content info --id 2
[ INFO 2023-10-16T14:48:38 API] Server: https://centos8-katello-devel.area51.example.com
[ INFO 2023-10-16T14:48:38 API] GET /katello/api/capsules/2/content/sync
[DEBUG 2023-10-16T14:48:38 API] Params: {}
[DEBUG 2023-10-16T14:48:38 API] Headers: {
:params => {}
}
[DEBUG 2023-10-16T14:48:38 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[DEBUG 2023-10-16T14:48:40 API] Response: {
"last_sync_time" => "2023-10-12 18:52:32 UTC",
"download_policy" => "inherit",
"active_sync_tasks" => [],
"last_failed_sync_tasks" => [],
"lifecycle_environments" => [
[0] {
"library" => false,
"id" => 2,
"name" => "Foo",
"label" => "Foo",
"description" => nil,
"organization_id" => 1,
"organization" => {
"name" => "Default Organization",
"label" => "Default_Organization",
"id" => 1
},
"syncable" => false,
"counts" => {
"content_views" => 1
},
"content_views" => [
[0] {
"id" => 2,
"label" => "Zoo",
"name" => "Zoo",
"composite" => false,
"last_published" => "2023-10-12 18:50:47 UTC",
"default" => false,
"up_to_date" => true,
"counts" => {
"repositories" => 7
},
"content_counts" => {
"content_view_versions" => {
"2" => {
"repositories" => {
"24" => {
"file" => 3
},
"25" => {
"ansible.collection_version" => 14
},
"26" => {
"rpm" => 35,
"erratum" => 4,
"package_group" => 2,
"rpm.packagecategory" => 1,
"rpm.packagelangpacks" => 1
},
"27" => {
"ostree_ref" => 2,
"ostree.commit" => 2,
"ostree.config" => 1,
"ostree.object" => 3,
"ostree.summary" => 1
},
"28" => {
"python_package" => 2
},
"29" => {
"rpm" => 22,
"erratum" => 7,
"module_stream" => 14,
"package_group" => 2,
"rpm.packagecategory" => 1,
"rpm.distribution_tree" => 1,
"rpm.modulemd_defaults" => 3
},
"30" => {
"docker_tag" => 3,
"container.blob" => 27,
"docker_manifest" => 9,
"docker_manifest_list" => 3
}
},
"cv_version_content_counts" => {
"rpm" => 57,
"file" => 3,
"erratum" => 11,
"docker_tag" => 3,
"ostree_ref" => 2,
"module_stream" => 14,
"ostree.commit" => 2,
"ostree.config" => 1,
"ostree.object" => 3,
"package_group" => 4,
"container.blob" => 27,
"ostree.summary" => 1,
"python_package" => 2,
"docker_manifest" => 9,
"rpm.packagecategory" => 2,
"docker_manifest_list" => 3,
"rpm.packagelangpacks" => 1,
"rpm.distribution_tree" => 1,
"rpm.modulemd_defaults" => 3,
"ansible.collection_version" => 14
}
}
}
}
}
]
}
],
"unsyncable_content_types" => []
} |
Ah @chris1984 I think you may be missing this PR: Katello/katello#10745 |
One corner case I need to check is what happens if two environments share one repository, and both envs are linked to the smart proxy, but only one is actually synced. |
I had to reinstall my smart-proxy, did you want to test and see if this needs an update before I test it again? I was going to test it today. Since yesterday was a dumpster fire with meetings etc. |
I'm starting to build my code off of Samir's Katello PR: Katello/katello#10766 It stops errors from occurring when calculating smart proxy counts for LCEs that haven't been synced yet. Here's an example for what I have currently:
There is a warning if the repository isn't up to date on the smart proxy. |
efbae78
to
0afb3a7
Compare
* Add capsule content update-counts command
0afb3a7
to
614b41d
Compare
@chris1984 this is ready for another review. Grab @sjha4 's other PR first: Katello/katello#10766 An extra thing to test is the warning that pops up for repositories in LCEs that haven't been synced yet. It's easier to test this if you disable the setting that syncs capsules after promotion. Example:
|
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.
First part works and I get the warning :)
Lifecycle Environments:
1) Name: Capsule
Organization: Default Organization
Content Views:
1) Name: Everything
Composite: no
Last Published: 2023/10/24 17:47:40
Repositories:
1) Repository ID: 9
Repository Name: Dockah
Content Counts:
Warning: Content view must be synced to see content counts
2) Repository ID: 13
Repository Name: Partha-Modules
Content Counts:
Warning: Content view must be synced to see content counts
3) Repository ID: 12
Repository Name: Medium
Content Counts:
Warning: Content view must be synced to see content counts
4) Repository ID: 11
Repository Name: OSTree-James
Content Counts:
Warning: Content view must be synced to see content counts
5) Repository ID: 10
Repository Name: Files
Content Counts:
Warning: Content view must be synced to see content counts
6) Repository ID: 15
Repository Name: Ansible
Content Counts:
Warning: Content view must be synced to see content counts
7) Repository ID: 14
Repository Name: Python
Content Counts:
Warning: Content view must be synced to see content counts
8) Repository ID: 16
Repository Name: Debian
Content Counts:
Warning: Content view must be synced to see content counts
After syncing I can get see everything:
Lifecycle Environments:
1) Name: Capsule
Organization: Default Organization
Content Views:
1) Name: Everything
Composite: no
Last Published: 2023/10/24 17:47:40
Repositories:
1) Repository ID: 9
Repository Name: Dockah
Content Counts:
Container Tags: 3
Container Manifests: 9
Container Manifest Lists: 3
2) Repository ID: 13
Repository Name: Partha-Modules
Content Counts:
Packages: 22
Module Streams: 14
Package Groups: 2
Errata: 7
3) Repository ID: 12
Repository Name: Medium
Content Counts:
Packages: 403
Errata: 2
4) Repository ID: 11
Repository Name: OSTree-James
Content Counts:
OSTree Refs: 2
5) Repository ID: 10
Repository Name: Files
Content Counts:
Files: 3
6) Repository ID: 15
Repository Name: Ansible
Content Counts:
Ansible Collections: 14
7) Repository ID: 14
Repository Name: Python
Content Counts:
Python Packages: 2
8) Repository ID: 16
Repository Name: Debian
Content Counts:
Debian Packages: 5
ACK nice work @ianballou
Let me know if you need me to merge it if you don't have perms, otherwise ship it
... and
...update-counts
Content counts for every indexed content type should be available.
To test:
hammer capsule content info --id <id>
hammer capsule content update-counts --id <id>
--async
.