-
Notifications
You must be signed in to change notification settings - Fork 210
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
Filter settings by result and groupid #5497
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,18 @@ sub jobs ($self) { | |
my $validation = $self->validation; | ||
$validation->required('key')->like(qr/^[\w\*]+$/); | ||
$validation->required('list_value')->like(qr/^\w+$/); | ||
$validation->optional('results')->like(qr/^\w+$/); | ||
$validation->optional('list_groupids')->like(qr/^[\w\*]+$/); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For other queries we support "group_glob" and "not_group_globs". Introduing "list_groupids" here looks like a new, inconsistent approach. Also see the second suggestion in https://progress.opensuse.org/issues/131279#Suggestions How about extending the current group_glob support into here? As alternative, potentially even simpler, see https://progress.opensuse.org/issues/131279#Suggestions number 3 stating There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont see a straight way to invoke group_glob inside the lib/OpenQA/WebAPI/Controller/API/V1/JobSettings.pm. That is because the variables are tight inside _compose_job_overview_search_args. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the code cannot be reused it would at least make sense to keep the design/usage consistent from a user perspective. (And I think this is also mainly what @okurz was asking for.) |
||
return $self->reply->validation_error({format => 'json'}) if $validation->has_error; | ||
|
||
my $key = $validation->param('key'); | ||
my $list_value = $validation->param('list_value'); | ||
my $jobs = $self->schema->resultset('JobSettings')->jobs_for_setting({key => $key, list_value => $list_value}); | ||
my $filter_result = $validation->param('results') // undef; | ||
my $gids = $validation->param('list_groupids') // undef; | ||
my $jobs = $self->schema->resultset('JobSettings')->jobs_for_setting({key => $key, | ||
list_value => $list_value, | ||
filter_results => $filter_result, | ||
gids => $gids}); | ||
$self->render(json => {jobs => $jobs}); | ||
} | ||
|
||
|
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.
The jobgroup id is irrelevant at this stage, if a job matches the search, but it is pre-filtered from the list of results, in the end will hide the data from the user.
Also be aware of the discussion on slack about this route not returning all of the information