Debugging info shows "1 resources after filtering" when in fact the payload is an error message
Problem
When I tried running gitlab-triage
command with an invalid token, I see the following output in my console:
* Found 1 resources...
* Filtering resources...
* Total after filtering: 1 resources
* Limiting resources...
* Total after limiting: 1 resources
This is misleading as it seems to tell me that I had 1 resource matching my condition. After setting a debugger to inspect the actual value of the resources
variable at https://gitlab.com/gitlab-org/ruby/gems/gitlab-triage/-/blob/master/lib/gitlab/triage/engine.rb#L357, I see
[{"message"=>"404 Project Not Found", "type"=>"issues"}]
This is how I discovered that 1 resource
returned in the output is actually this error message. We should fix this behavior by returning 0 resources
in the output and then explicitly inform that the result contains a invalid payload.
Edited by Jennifer Li