Condition `health_status: None` brings no results
GitLag version: 15.11.10-ee
When trying to filter all issues without health_status
,
nothing matches with the below policy.
resource_rules:
issues:
rules:
- name: untyped issues
conditions:
ruby: |
!(resource[:labels]&.grep(/^type::/).any?)
health_status: None
actions:
comment: |
This issue does not have `type::` label, please add one.
/health_status needs_attention
...and in the debug logs i see this error:
$ gitlab-triage -d --token $GITLAB_API_TOKEN --host-url $CI_SERVER_URL --source projects --source-id $CI_PROJECT_PATH
*********************************************
Executing policies from .triage-policies.yml.
*********************************************
=========================================
Triaging the `jrc-legent/sandbox` project
=========================================
---------------------------------------
Processing summaries & rules for issues
---------------------------------------
------------------------------------------------
Gathering resources for rule: **untyped issues**
------------------------------------------------
.[DEBUG] query_api: https://code.europa.eu/api/v4/projects/jrc-legent%2Fsandbox/issues?per_page=100&health_status=None
[DEBUG] rate_limit_infos: Rate limit remaining: 0 (reset at 1970-01-01 00:00:00 +0000)
[DEBUG] Rate limit almost exceeded, sleeping for -1688332034.2018974 seconds
* Found 1 resources...
* Filtering resources...{"error"=>"health_status does not have a valid value", "type"=>"issues"}
* Total after filtering: 0 resources
* Limiting resources...
* Total after limiting: 0 resources
Cleaning up project directory and file based variables
Had to use this ruby expression instead:
...
conditions:
ruby: |
!(resource[:labels]&.grep(/^type::/)&.any?) &&
!(resource[:health_status])
For completeness, this is my pipeline:
run:triage:
stage: triage
tags:
- linux
script:
- gem install gitlab-triage
- gitlab-triage -d --token $GITLAB_API_TOKEN --host-url $CI_SERVER_URL --source projects --source-id $CI_PROJECT_PATH
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
exists:
- .triage-policies.yml
allow_failure: true
- exists:
- .triage-policies.yml
when: manual
Edited by Kostis Anagnostopoulos