-
Notifications
You must be signed in to change notification settings - Fork 295
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 #37237 - Allow repairing content view versions #10923
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chris1984
approved these changes
Mar 8, 2024
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.
ACK, code looks fine and it works well.
[2] pry(main)> ForemanTasks.sync_task(::Actions::Katello::ContentViewVersion::VerifyChecksum, cvv)
2024-03-08T13:24:07 [I|bac|] Task {label: , execution_plan_id: 06b84611-06a0-4b2e-9b6a-f19098519a77} state changed: pending
2024-03-08T13:24:07 [I|bac|] Task {label: Actions::Katello::ContentViewVersion::VerifyChecksum, id: 5a3fefd0-3e86-486c-a817-903e84f92133, execution_plan_id: 06b84611-06a0-4b2e-9b6a-f19098519a77} state changed: planning
2024-03-08T13:24:07 [I|bac|] Task {label: Actions::Katello::ContentViewVersion::VerifyChecksum, id: 5a3fefd0-3e86-486c-a817-903e84f92133, execution_plan_id: 06b84611-06a0-4b2e-9b6a-f19098519a77} state changed: planned
2024-03-08T13:24:08 [I|bac|] Task {label: Actions::Katello::Repository::VerifyChecksum, id: d89fb91d-fd00-4a9b-a704-2aee121d86b2, execution_plan_id: 74c8c420-c1b6-4bba-8cfe-4d2ea61f8c6e} state changed: running
2024-03-08T13:24:08 [D|kat|] Calling API: RepositoriesRpmVersionsApi.repair ...
2024-03-08T13:24:08 [D|kat|] HTTP request body param ~BEGIN~
| {"verify_checksums":true}
| ~END~
|
2024-03-08T13:24:08 [D|kat|] HTTP response body ~BEGIN~
| {"task":"/pulp/api/v3/tasks/018e1f4e-e67e-78a1-a683-12688387bf19/"}
| ~END~
|
2024-03-08T13:24:08 [D|kat|] API called: RepositoriesRpmVersionsApi#repair
| Data: #<PulpRpmClient::AsyncOperationResponse:0x000055b3768dda18 @task="/pulp/api/v3/tasks/018e1f4e-e67e-78a1-a683-12688387bf19/">
| Status code: 202
| Headers: {"Date"=>"Fri, 08 Mar 2024 18:24:08 GMT", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"POST, OPTIONS", "X-Frame-Options"=>"DENY", "Content-Length"=>"67", "X-Content-Type-Options"=>"nosniff", "Referrer-Policy"=>"same-origin", "Cross-Origin-Opener-Policy"=>"same-origin", "Correlation-ID"=>"83191a951857413ea803a879fa6e74bc", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"1.1 devel.croberts.io"}
2024-03-08T13:24:08 [D|kat|] Calling API: TasksApi.read ...
2024-03-08T13:24:08 [D|kat|] HTTP response body ~BEGIN~
| {"pulp_href":"/pulp/api/v3/tasks/018e1f4e-e67e-78a1-a683-12688387bf19/","pulp_created":"2024-03-08T18:24:08.318747Z","state":"waiting","name":"pulpcore.app.tasks.repository.repair_version","logging_cid":"83191a951857413ea803a879fa6e74bc","created_by":"/pulp/api/v3/users/1/","started_at":null,"finished_at":null,"error":null,"worker":"/pulp/api/v3/workers/018e1f40-d921-765d-8c4c-975b4de23f6d/","parent_task":null,"child_tasks":[],"task_group":null,"progress_reports":[],"created_resources":[],"reserved_resources_record":["shared:/pulp/api/v3/repositories/rpm/rpm/018df701-badf-7afc-a5e1-2f56f3ef63e4/","shared:/pulp/api/v3/domains/018df1ff-04b9-7ad2-9042-e6585ef93ad7/"]}
| ~END~
|
2024-03-08T13:24:08 [D|kat|] API called: TasksApi#read
| Data: #<PulpcoreClient::TaskResponse:0x000055b3768466b8 @pulp_href="/pulp/api/v3/tasks/018e1f4e-e67e-78a1-a683-12688387bf19/", @pulp_created=Fri, 08 Mar 2024 18:24:08 +0000, @state="waiting", @name="pulpcore.app.tasks.repository.repair_version", @logging_cid="83191a951857413ea803a879fa6e74bc", @created_by="/pulp/api/v3/users/1/", @worker="/pulp/api/v3/workers/018e1f40-d921-765d-8c4c-975b4de23f6d/", @child_tasks=[], @progress_reports=[], @created_resources=[], @reserved_resources_record=["shared:/pulp/api/v3/repositories/rpm/rpm/018df701-badf-7afc-a5e1-2f56f3ef63e4/", "shared:/pulp/api/v3/domains/018df1ff-04b9-7ad2-9042-e6585ef93ad7/"]>
| Status code: 200
| Headers: {"Date"=>"Fri, 08 Mar 2024 18:24:08 GMT", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"GET, PATCH, DELETE, HEAD, OPTIONS", "X-Frame-Options"=>"DENY", "Content-Length"=>"673", "X-Content-Type-Options"=>"nosniff", "Referrer-Policy"=>"same-origin", "Cross-Origin-Opener-Policy"=>"same-origin", "Correlation-ID"=>"a50a801fdd0d4ed6ad09375f375338dc", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"1.1 devel.croberts.io"}
2024-03-08T13:24:09 [D|kat|] Calling API: TasksApi.read ...
2024-03-08T13:24:09 [D|kat|] HTTP response body ~BEGIN~
| {"pulp_href":"/pulp/api/v3/tasks/018e1f4e-e67e-78a1-a683-12688387bf19/","pulp_created":"2024-03-08T18:24:08.318747Z","state":"completed","name":"pulpcore.app.tasks.repository.repair_version","logging_cid":"83191a951857413ea803a879fa6e74bc","created_by":"/pulp/api/v3/users/1/","started_at":"2024-03-08T18:24:08.491098Z","finished_at":"2024-03-08T18:24:08.711121Z","error":null,"worker":"/pulp/api/v3/workers/018e1f40-d921-765d-8c4c-975b4de23f6d/","parent_task":null,"child_tasks":[],"task_group":null,"progress_reports":[{"message":"Repair corrupted units","code":"repair.repaired","state":"completed","total":null,"done":0,"suffix":null},{"message":"Identify corrupted units","code":"repair.corrupted","state":"completed","total":null,"done":0,"suffix":null},{"message":"Identify missing units","code":"repair.missing","state":"completed","total":null,"done":0,"suffix":null}],"created_resources":[],"reserved_resources_record":["shared:/pulp/api/v3/repositories/rpm/rpm/018df701-badf-7afc-a5e1-2f56f3ef63e4/","shared:/pulp/api/v3/domains/018df1ff-04b9-7ad2-9042-e6585ef93ad7/"]}
| ~END~
|
2024-03-08T13:24:09 [D|kat|] API called: TasksApi#read
| Data: #<PulpcoreClient::TaskResponse:0x000055b3761297b8 @pulp_href="/pulp/api/v3/tasks/018e1f4e-e67e-78a1-a683-12688387bf19/", @pulp_created=Fri, 08 Mar 2024 18:24:08 +0000, @state="completed", @name="pulpcore.app.tasks.repository.repair_version", @logging_cid="83191a951857413ea803a879fa6e74bc", @created_by="/pulp/api/v3/users/1/", @worker="/pulp/api/v3/workers/018e1f40-d921-765d-8c4c-975b4de23f6d/", @child_tasks=[], @progress_reports=[#<PulpcoreClient::ProgressReportResponse:0x000055b3761197f0 @message="Repair corrupted units", @code="repair.repaired", @state="completed", @done=0>, #<PulpcoreClient::ProgressReportResponse:0x000055b37610fd40 @message="Identify corrupted units", @code="repair.corrupted", @state="completed", @done=0>, #<PulpcoreClient::ProgressReportResponse:0x000055b37610ec38 @message="Identify missing units", @code="repair.missing", @state="completed", @done=0>], @created_resources=[], @reserved_resources_record=["shared:/pulp/api/v3/repositories/rpm/rpm/018df701-badf-7afc-a5e1-2f56f3ef63e4/", "shared:/pulp/api/v3/domains/018df1ff-04b9-7ad2-9042-e6585ef93ad7/"], @started_at=Fri, 08 Mar 2024 18:24:08 +0000, @finished_at=Fri, 08 Mar 2024 18:24:08 +0000>
| Status code: 200
| Headers: {"Date"=>"Fri, 08 Mar 2024 18:24:09 GMT", "Server"=>"gunicorn", "Content-Type"=>"application/json", "Vary"=>"Accept,Cookie", "Allow"=>"GET, PATCH, DELETE, HEAD, OPTIONS", "X-Frame-Options"=>"DENY", "Content-Length"=>"1080", "X-Content-Type-Options"=>"nosniff", "Referrer-Policy"=>"same-origin", "Cross-Origin-Opener-Policy"=>"same-origin", "Correlation-ID"=>"0c552cc0e52f44b5b184587f3211207a", "Access-Control-Expose-Headers"=>"Correlation-ID", "Via"=>"1.1 devel.croberts.io"}
2024-03-08T13:24:09 [I|bac|] Task {label: Actions::Katello::Repository::VerifyChecksum, id: d89fb91d-fd00-4a9b-a704-2aee121d86b2, execution_plan_id: 74c8c420-c1b6-4bba-8cfe-4d2ea61f8c6e} state changed: stopped result: success
=> #<ForemanTasks::Task::DynflowTask:0x000055b375ce9c20
id: "5a3fefd0-3e86-486c-a817-903e84f92133",
type: "ForemanTasks::Task::DynflowTask",
label: "Actions::Katello::ContentViewVersion::VerifyChecksum",
started_at: Fri, 08 Mar 2024 18:24:07.743000000 UTC +00:00,
ended_at: Fri, 08 Mar 2024 18:24:23.314438000 UTC +00:00,
state: "stopped",
result: "success",
external_id: "06b84611-06a0-4b2e-9b6a-f19098519a77",
parent_task_id: nil,
start_at: Fri, 08 Mar 2024 18:24:07.733017000 UTC +00:00,
start_before: nil,
action: "Verify checksum of repositories in Module 1.0 content view 'Module'; organization 'Default Organization'",
user_id: 2,
state_updated_at: Fri, 08 Mar 2024 18:24:23.325516000 UTC +00:00>
Thanks @chris1984 ! Merging.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the changes introduced in this pull request?
Considerations taken when implementing this change?
This action will only be allowed via API/Hammer.
No UI implementation becuase this is not a regular workflow action users should be running. Only for fixing corrupted content on FS.
What are the testing steps for this pull request?
In foreman console: (Note :id to be replaced with a CV version id)
If Katello/hammer-cli-katello#932 is merged, or you check it out on hammer,
Follow steps there to verify hammer calls to the API.