Project

General

Profile

action #96510

`job_groups/id` DELETE call can't really work

Added by osukup over 1 year ago. Updated about 1 year ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Concrete Bugs
Target version:
Start date:
2021-08-03
Due date:
% Done:

0%

Estimated time:
Difficulty:

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

History

#1 Updated by osukup over 1 year ago

  • Description updated (diff)

#2 Updated by cdywan over 1 year ago

I assume the job template needs to be set to "" first? That's what we cover in unit tests as well

#3 Updated by okurz over 1 year ago

  • Description updated (diff)
  • Category set to Concrete Bugs
  • 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.

#4 Updated by osukup over 1 year 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: {}

#5 Updated by osukup about 1 year 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

#6 Updated by mkittler about 1 year 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).

#7 Updated by osukup about 1 year 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

Also available in: Atom PDF