Project

General

Profile

Actions

action #66427

closed

openqa-cli cant trigger single job

Added by ybonatakis almost 4 years ago. Updated almost 4 years ago.

Status:
Rejected
Priority:
Urgent
Assignee:
Category:
Regressions/Crashes
Target version:
-
Start date:
2020-05-05
Due date:
% Done:

0%

Estimated time:

Description

I used

openqa-cli api --pretty --osd -X POST isos ISO=SLE-15-SP2-Online-x86_64-Build188.1-Media1.iso DISTRI=sle VERSION=15-SP2 FLAVOR=Online ARCH=x86_64 BUILD=188.1 TEST=autoyast_home_encrypted

to trigger a single job named autoyast_home_encrypted but it wound up running all the jobs for the Online medium. The corresponding command with openqa-client was

openqa-client isos post --host=http://openqa.suse.de ISO=SLE-15-SP2-Online-x86_64-Build188.1-Media1.iso DISTRI=sle VERSION=15-SP2 FLAVOR=Online ARCH=x86_64 BUILD=188.1 TEST=autoyast_home_encrypted

Expected:
To run only the test job with name autoyast_home_encrypted from the TEST variable

Actual:
Seems to ignore the TEST variable and match all the others with reasult to trigger many jobs

Actions #1

Updated by okurz almost 4 years ago

  • Category set to Regressions/Crashes
  • Assignee set to kraih
  • Priority changed from Normal to Urgent

please look into this, new client seems to behave different for the above use case. If more users do this mistake then we will end up with many invalid jobs as has happened yesterday evening for ybonatakis

Actions #2

Updated by tinita almost 4 years ago

One difference is that the new client puts the parameters into the body, while the old put it into the query string:

old:

POST /api/v1/isos?FLAVOR=Online&BUILD=188.1&TEST=autoyast_home_encrypted&ISO=SLE-15-SP2-Online-x86_64-Build188.1-Media1.iso&DISTRI=sle&VERSION=15-SP2&ARCH=x86_64 HTTP/1.1

new:

POST /api/v1/isos HTTP/1.1\x0d
...

ARCH=x86_64&BUILD=188.1&DISTRI=sle&FLAVOR=Online&ISO=SLE-15-SP2-Online-x86_64-Build188.1-Media1.iso&TEST=autoyast_home_encrypted&VERSION=15-SP2                                                                                            

Tested with MOJO_CLIENT_DEBUG=1 ...

Actions #3

Updated by kraih almost 4 years ago

Submitting the parameters application/x-www-form-urlencoded encoded in a POST is definitely more correct. But it shouldn't really make a difference. The submitted data looks the same in both cases. Maybe the endpoint uses $c->req->url->query directly somewhere, instead of the higher level parameter/validation methods?

Actions #4

Updated by kraih almost 4 years ago

I've also looked at input validation for both cases. And once the my $scheduled_jobs = $scheduled_product->schedule_iso(\%params); call happens %params looks identical.

# openqa-client
{
  "ARCH" => "x86_64",
  "BUILD" => "188.1",
  "DISTRI" => "sle",
  "FLAVOR" => "Online",
  "ISO" => "SLE-15-SP2-Online-x86_64-Build188.1-Media1.iso",
  "TEST" => "autoyast_home_encrypted",
  "VERSION" => "15-SP2"
}

# openqa-cli api
{
  "ARCH" => "x86_64",
  "BUILD" => "188.1",
  "DISTRI" => "sle",
  "FLAVOR" => "Online",
  "ISO" => "SLE-15-SP2-Online-x86_64-Build188.1-Media1.iso",
  "TEST" => "autoyast_home_encrypted",
  "VERSION" => "15-SP2"
}
Actions #5

Updated by okurz almost 4 years ago

I also crosschecked with e.g.

$ script/openqa-cli api --o3 -X post isos DISTRI=openqa VERSION=Tumbleweed FLAVOR=dev BUILD=okurz_experiment ARCH=x86_64 TEST=openqa_from_git
{"count":1,"failed":[],"ids":[1255956],"scheduled_product_id":167379}
$ script/openqa-cli api --o3 -X post isos DISTRI=openqa VERSION=Tumbleweed FLAVOR=dev BUILD=okurz_experiment ARCH=x86_64
{"count":2,"failed":[],"ids":[1255957,1255958],"scheduled_product_id":167380}

so one job scheduled in the first case with test filtering and all jobs for the product, i.e. two, without

Actions #6

Updated by kraih almost 4 years ago

And to be absolutely sure i compared the scalar values of $params{TEST}.

# openqa-client
SV = PVMG(0x55c45a465eb0) at 0x55c45a7634f8
  REFCNT = 1
  FLAGS = (POK,IsCOW,pPOK,UTF8)
  IV = 0
  NV = 0
  PV = 0x55c45a779520 "autoyast_home_encrypted"\0 [UTF8 "autoyast_home_encrypted"]
  CUR = 23
  LEN = 25
  COW_REFCNT = 4

# openqa-cli api
SV = PVMG(0x55c45a4657f0) at 0x55c45a7270e0
  REFCNT = 1
  FLAGS = (POK,IsCOW,pPOK,UTF8)
  IV = 0
  NV = 0
  PV = 0x55c453990190 "autoyast_home_encrypted"\0 [UTF8 "autoyast_home_encrypted"]
  CUR = 23
  LEN = 25
  COW_REFCNT = 3

No unexpected encoding differences that might affect a DBD::Pg query either.

Actions #7

Updated by kraih almost 4 years ago

There is no indication that TEST=autoyast_home_encrypted is ever ignored. There must be something missing from the report, or perhaps the was a typo somewhere.

Actions #8

Updated by kraih almost 4 years ago

  • Assignee changed from kraih to ybonatakis
Actions #9

Updated by ybonatakis almost 4 years ago

  • Status changed from New to Rejected

I have to apologize. Indeed the openqa-cli works exactly as expected. My mistake was that i had created an alias but i havent sourced it properly and it executed old script without the TEST variable. Sorry for any inconvenience. i am closing it.

Actions

Also available in: Atom PDF