Skip to content
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

Add filter to exclude groupless jobs to API/V1 #5837

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

r-richardson
Copy link
Contributor

t/api/04-jobs.t Show resolved Hide resolved
t/ui/02-list-group.t Outdated Show resolved Hide resolved
t/ui/02-list-group.t Outdated Show resolved Hide resolved
t/ui/02-list-group.t Outdated Show resolved Hide resolved
t/ui/02-list-group.t Outdated Show resolved Hide resolved
t/ui/02-list-group.t Outdated Show resolved Hide resolved
t/ui/02-list-group.t Outdated Show resolved Hide resolved
t/api/04-jobs.t Show resolved Hide resolved
t/ui/02-list-group.t Outdated Show resolved Hide resolved
@r-richardson r-richardson marked this pull request as draft August 9, 2024 13:01
@r-richardson
Copy link
Contributor Author

r-richardson commented Aug 9, 2024

When trying to only exclude a specific group, it will still exclude all groupless jobs (this is why the second test i added still fails).
Is this maybe due to the comparison behaviour @perlpunk mentioned ?

Just a note, as we do not have groups with id 0, but null: this is turned into

WHERE ( me.group_id NOT IN ( 0 ) )

which works because in SQL, comparing something with null is always false, so any random number would work.

If i understand correctly then this should not be the issue here.
In the test data are 14 Jobs with the groupid 1001, one with groupid 1002 and three groupless jobs, so i would expect to get 4 jobs when excluding group 1001, though it returns only 1

@perlpunk
Copy link
Contributor

perlpunk commented Aug 9, 2024

Comparing somthing with null, even if it is a negative comparison, will always be false:

openqa=> select id, group_id from jobs where id = 4389101;
   id    | group_id 
---------+----------
 4389101 |         
(1 row)

openqa=> select id, group_id from jobs where id = 4389101 and group_id not in (23);
 id | group_id 
----+----------
(0 rows)

openqa=> select id, group_id from jobs where id = 4389101 and group_id != 23;
 id | group_id 
----+----------
(0 rows)

An additional or group_id is null would be necessary.

lib/OpenQA/Schema/ResultSet/Jobs.pm Outdated Show resolved Hide resolved
@r-richardson r-richardson force-pushed the feature_not_groupid branch 2 times, most recently from 8668e87 to 4cd0d06 Compare August 9, 2024 16:10
@r-richardson r-richardson marked this pull request as ready for review August 12, 2024 08:55
@perlpunk
Copy link
Contributor

The circleci codecov problem still exists, it just doesn't run, and it's not possible to restart the workflow.
https://app.circleci.com/pipelines/github/os-autoinst/openQA/14269/workflows/c0550356-11a0-4dd0-a7a3-3b856edbdd63
I will merge manually now.

@perlpunk perlpunk merged commit c375b2a into os-autoinst:master Aug 12, 2024
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants