NullPointerException when connecting the project, Possibly "Field 'ref' doesn't exist on type 'Pipeline'"
It looks like I figured this one out already on my own: The gitlab changelog says: https://gitlab.com/gitlab-org/gitlab-foss/blob/master/CHANGELOG.md#1410-2021-07-21
Add ref to pipeline graphql schema (merge request)
So it looks like for gitlab versions older than this we will get this error. Could be worth to add a check of the version to this plugin, or at least specify this requirement in the readme. Perhaps the ref is not needed though?
We are using a self hosted GitLab Community Edition 13.12.1
I attempted to use this plugin for the first time. I entered my data in the "Choose how to handle this remote" dialog and clicked ok and get a connection error:
Link to source code of NullPointerException: https://gitlab.com/ppiag/intellij_gitlab_pipeline_monitor/-/blob/master/src/main/java/de/sist/gitlab/pipelinemonitor/gitlab/GraphQl.java#L55
Relevant Logs
2021-11-23 14:53:39,604 [ 425287] INFO - nemonitor.gitlab.GitlabService - Error reading project data using URL http://gitlab_hostname/api/graphql and query {"query": "{ project(fullPath: \"slobbenmeier/project-name-censored\") { name id jobsEnabled mergeRequests(sourceBranches:[], state:opened, sort:CREATED_DESC) { edges { node { sourceBranch webUrl title headPipeline { ref } } } } }}"} with response {"errors":[{"message":"Field 'ref' doesn't exist on type 'Pipeline'","locations":[{"line":1,"column":295}],"path":["query","project","mergeRequests","edges","node","headPipeline","ref"],"extensions":{"code":"undefinedField","typeName":"Pipeline","fieldName":"ref"}}]}
java.lang.RuntimeException: java.lang.NullPointerException
at de.sist.gitlab.pipelinemonitor.gitlab.GraphQl.parse(GraphQl.java:62)
at de.sist.gitlab.pipelinemonitor.gitlab.GraphQl.makeCall(GraphQl.java:108)
at de.sist.gitlab.pipelinemonitor.gitlab.GitlabService.createMappingWithProjectNameAndId(GitlabService.java:216)
at de.sist.gitlab.pipelinemonitor.ui.UnmappedRemoteDialog.lambda$tryAndCreateMapping$4(UnmappedRemoteDialog.java:183)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:308)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:450)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:117)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressSynchronously$8(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:81)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:243)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:183)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:170)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:243)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NullPointerException
at de.sist.gitlab.pipelinemonitor.gitlab.GraphQl.parse(GraphQl.java:55)
... 23 more