-
Notifications
You must be signed in to change notification settings - Fork 289
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 #36530 - Fix up /katello/api/sync_plans/:sync_plan_id/product… #10632
Fixes #36530 - Fix up /katello/api/sync_plans/:sync_plan_id/product… #10632
Conversation
…s and /katello/api/repositories/:repository_id/sync API endpoints. Fixed broken ktests
Issues: #36530 |
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.
Works as advertised.
- the two endpoints work
- the removed endpoint fails as expected
- Sync Status page and Tasks tab of product detail page continue to work as expected
[vagrant@centos8-katello-devel-stable katello]$ curl --user admin:changeme --request GET https://centos8-katello-devel-stable.example.com/katello/api/sync_plans/1/products?organization_id=1 | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 800 100 800 0 0 1120 0 --:--:-- --:--:-- --:--:-- 1118
{
"total": 1,
"subtotal": 1,
"selectable": 1,
"page": 1,
"per_page": 20,
"error": null,
"search": null,
"sort": {
"by": "name",
"order": "asc"
},
"results": [
{
"id": 305,
"cp_id": "602111952143",
"name": "EPEL8",
"label": "EPEL8",
"description": null,
"provider_id": 1,
"sync_plan_id": 1,
"sync_summary": {
"pending": 1,
"warning": 1,
"success": 1
},
"gpg_key_id": null,
"ssl_ca_cert_id": null,
"ssl_client_cert_id": null,
"ssl_client_key_id": null,
"sync_state": "Syncing Complete.",
"last_sync": "2023-06-29 13:07:03 UTC",
"last_sync_words": "4 minutes",
"organization_id": 1,
"organization": {
"name": "Default Organization",
"label": "Default_Organization",
"id": 1
},
"sync_plan": {
"id": 1,
"name": "Weekly",
"description": null,
"sync_date": "2023-06-29 13:07:00 UTC",
"interval": "weekly",
"next_sync": "2023-07-06 13:07:00 UTC",
"cron_expression": null
},
"repository_count": 3
}
]
}
[vagrant@centos8-katello-devel-stable katello]$ curl --user admin:changeme --request GET https://centos8-katello-devel-stable.example.com/katello/api/repositories/24/sync | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1949 0 1949 0 0 3492 0 --:--:-- --:--:-- --:--:-- 3486
{
"id": "b87129f4-1993-48ed-ba99-cff14f9eeec7",
"label": "Actions::Katello::Repository::Sync",
"pending": true,
"action": "Synchronize repository 'EPEL8 x86_64'; product 'EPEL8'; organization 'Default Organization'",
"username": "admin",
"started_at": "2023-06-29 13:05:43 UTC",
"ended_at": null,
"state": "running",
"result": "pending",
"progress": 0.63,
"input": {
"repository": {
"id": 24,
"name": "EPEL8 x86_64",
"label": "EPEL8_x86_64"
},
"product": {
"id": 305,
"name": "EPEL8",
"label": "EPEL8",
"cp_id": "602111952143"
},
"provider": {
"id": 1,
"name": "Anonymous"
},
"organization": {
"id": 1,
"name": "Default Organization",
"label": "Default_Organization"
},
"services_checked": [
"pulp3"
],
"id": 24,
"sync_result": {
"class": "Dynflow::ExecutionPlan::OutputReference",
"execution_plan_id": "e7a5823e-e692-43f5-ae32-8ce7a1d405cf",
"step_id": 19,
"action_id": 2,
"subkeys": []
},
"skip_metadata_check": false,
"validate_contents": false,
"contents_changed": {
"class": "Dynflow::ExecutionPlan::OutputReference",
"execution_plan_id": "e7a5823e-e692-43f5-ae32-8ce7a1d405cf",
"step_id": 19,
"action_id": 2,
"subkeys": [
"contents_changed"
]
},
"locale": "en",
"current_request_id": "b7a4e7ae-c635-4c8d-952e-ae47da19654e",
"current_timezone": "America/New_York",
"current_organization_id": 1,
"current_location_id": 2,
"current_user_id": 4
},
"output": {},
"humanized": {
"action": "Synchronize",
"input": [
[
"repository",
{
"text": "repository 'EPEL8 x86_64'",
"link": null
}
],
[
"product",
{
"text": "product 'EPEL8'",
"link": "/products/305/"
}
],
[
"organization",
{
"text": "organization 'Default Organization'",
"link": "/organizations/1/edit"
}
]
],
"output": "Total steps: 13826/13826\n--------------------------------\nAssociating Content: 99/99\nDownloading Artifacts: 70/70\nDownloading Metadata Files: 6/6\nParsed Advisories: 3760/3760\nParsed Comps: 24/24\nParsed Packages: 9761/9761\nSkipping Packages: 0/0\nUn-Associating Content: 106/106",
"errors": []
},
"cli_example": null,
"start_at": "2023-06-29 13:05:43 UTC",
"available_actions": {
"cancellable": false,
"resumable": false
}
}
@evgeni I took a look at https://docs.ansible.com/ansible/latest/collections/theforeman/foreman/organization_module.html#ansible-collections-theforeman-foreman-organization-module and https://docs.ansible.com/ansible/latest/collections/theforeman/foreman/sync_plan_module.html#ansible-collections-theforeman-foreman-sync-plan-module and I don't think removing GET /organizations/:organization_id/products/:product_id/sync
will break FAM, but please correct me if I'm wrong :)
Correct, this one is not used in FAM. What we do use is
|
Nice, then my ACK becomes unqualified! thanks @qcjames53! LGTM 👍 |
…s and /katello/api/repositories/:repository_id/sync API endpoints.
Fixed broken ktests
What are the changes introduced in this pull request?
Fixed the Katello API endpoints for the following URLs:
and removed the endpoint for the following URL:
These endpoints broke when certain Pulp 2 functionality was removed from Foreman and Katello. The removed endpoint should no longer appear in the API documentation.
Considerations taken when implementing this change?
We believe that nothing is querying the removed endpoint (product lookup via candlepin id and organization). If we for some reason need this functionality, I'd be more than happy to fix it as well.
What are the testing steps for this pull request?
<host>/katello/sync_management
. Ensure that running 'Synchronize now' on your repo functions as expected.<host>/apidoc/v2.html
. Ensure that the first two API endpoints are listed and that the third is not.You should expect a big ol' html doc which indicates an invalid route.