action #96510
closed`job_groups/id` DELETE call can't really work
0%
Description
Observation¶
from api documentation
DELETE +/job_groups/<group_id:num> Deletes a job group. Verifies that it is not empty before attempting to remove
with yaml definition of job_groups isn't possible to have empty job_group, so verification always stops call with error 400
openqa-cli api --osd -X DELETE job_groups/390
400 Bad Request
{"error":"Job group 390 is not empty","error_status":400}
empty template contains "products: {}\nscenarios: {}\"
string ...
Workaround¶
- Alternative 1: Delete job group over database SQL commands
- Alternative 2: To be confirmed: Empty the template document before trying to delete the job group
Updated by livdywan over 3 years ago
I assume the job template needs to be set to "" first? That's what we cover in unit tests as well
Updated by okurz over 3 years ago
- Description updated (diff)
- Category set to Regressions/Crashes
- Target version set to future
Your observation is valid. I noted down the potential workaround and another one. With the workaround documented I will not add it to the backlog right now.
Updated by osukup over 3 years ago
cdywan wrote:
I assume the job template needs to be set to "" first? That's what we cover in unit tests as well
but this isn't possible with the current interface? for an empty page, it sets the default dictionary {products: {}, scenarios: {}
Updated by osukup about 3 years ago
cdywan wrote:
I assume the job template needs to be set to "" first? That's what we cover in unit tests as well
and it shows this unit test is invalid
Updated by mkittler about 3 years ago
Note that one gets an error like Job group 390 is not empty
if the there is at last one job within that job group. So you'll need to delete all jobs within that job group first. I suppose we could add a flag to do that as part of the job group deletion.
That means the error message is about concrete jobs, not about job templates. However, it could be that job templates would also get in the way later (and you would even get an SQL error).
Updated by osukup about 3 years ago
- Status changed from New to Rejected
@mkittler , you're right :D thx for explanation
--> so I used small script to remove invalid groups - gitlab.suse.de/osukup/scripts