Gemfile: pin graphql version to < 2.1.0
What does this MR do and why?
Resolves #338 (closed)
We are incompatible with GraphQL 2.1.0 until a fix is released, this ensures that our version never hits this
# Workaround - pin graphql version
# see: https://github.com/github/graphql-client/issues/310
# see: https://github.com/rmosolgo/graphql-ruby/pull/4577
# see: https://github.com/github/graphql-client/pull/314
# We can remove this check once PR 314 is merged and released
spec.add_dependency 'graphql', '< 2.1.0'
Problem Scope
Given a policy file of (not sure if this matters, it should be the case for any GraphQL rule):
resource_rules:
issues:
rules:
- name: Name
conditions:
discussions:
attribute: threads
condition: less_than
threshold: 1
Then, running bin/gitlab-triage --token "glpat-XXXXX" --source-id 50778621 --policies-file repro/policy.yml
You will receive:
$ bundle exec repro/repro *****************************************
Executing policies from repro/policy.yml.
*****************************************
===============================
Triaging the `50778621` project
===============================
---------------------------------------
Processing summaries & rules for issues
---------------------------------------
--------------------------------------
Gathering resources for rule: **Name**
--------------------------------------
../home/zarthus/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/graphql-client-0.18.0/lib/graphql/client/query_typename.rb:30:in `add_typename': undefined method `[]' for nil:NilClass (NoMethodError)
With the merge request changes, you will receive:
*****************************************
Executing policies from repro/policy.yml.
*****************************************
===============================
Triaging the `50778621` project
===============================
---------------------------------------
Processing summaries & rules for issues
---------------------------------------
--------------------------------------
Gathering resources for rule: **Name**
--------------------------------------
...
* Found 1 resources...
* Filtering resources...
* Total after filtering: 1 resources
* Limiting resources...
* Total after limiting: 1 resources
...
Testing
Feel free to fork https://gitlab.com/zerotea-h1/reproduction-gitlab-triage - you will need a valid PAT added.
Alternatively, running
bundle exec bin/gitlab-triage --token "glpat-PAT" --source-id 50778621 --policies-file policy.yml
with the above policy should also be enough.
Make sure you have the right bundle installed and such!
Request to maintainers
Please consider releasing the Gem post-merge so people can benefit from this fix :)
Edited by Jos Ahrens