Error in "For current branch" view on self-hosted GitLab

Checklist

Summary

It seems the "For current branch" view is broken for projects on self-hosted GitLab (Free) instances.

Steps to reproduce

  • Connect extension to self-managed GitLab (Free) instance
  • Open cloned repository
  • Open sidebar

What is the current bug behavior?

An unspecific error message appears in the sidebar. I guess it's related to the error in the log (see below).

image

What is the expected correct behavior?

No error message in the sidebar

Relevant logs and/or screenshots

2023-12-01T16:19:24:051 [error]: {
      "userMessage": "Couldn't request Security Report. For more information, review the extension logs.",
      "errorMessage": "ComparableSecurityReportType isn't a defined input type (on $reportType): {\"response\":{\"errors\":[{\"message\":\"ComparableSecurityReportType isn't a defined input type (on $reportType)\",\"locations\":[{\"line\":5,\"column\":5}],\"path\":[\"query getMRSecurityReport\"],\"extensions\":{\"code\":\"variableRequiresValidType\",\"typeName\":\"ComparableSecurityReportType\",\"variableName\":\"reportType\"}},{\"message\":\"Field 'findingReportsComparer' doesn't exist on type 'MergeRequest'\",\"locations\":[{\"line\":10,\"column\":9}],\"path\":[\"query getMRSecurityReport\",\"project\",\"mergeRequest\",\"findingReportsComparer\"],\"extensions\":{\"code\":\"undefinedField\",\"typeName\":\"MergeRequest\",\"fieldName\":\"findingReportsComparer\"}},{\"message\":\"Variable $reportType is declared by getMRSecurityReport but not used\",\"locations\":[{\"line\":2,\"column\":3}],\"path\":[\"query getMRSecurityReport\"],\"extensions\":{\"code\":\"variableNotUsed\",\"variableName\":\"reportType\"}}],\"status\":200,\"headers\":{}},\"request\":{\"query\":\"\\n  query getMRSecurityReport(\\n    $fullPath: ID!\\n    $mergeRequestIid: String!\\n    $reportType: ComparableSecurityReportType!\\n  ) {\\n    project(fullPath: $fullPath) {\\n      mergeRequest(iid: $mergeRequestIid) {\\n        title\\n        findingReportsComparer(reportType: $reportType) {\\n          status\\n          report {\\n            headReportCreatedAt\\n            baseReportCreatedAt\\n            baseReportOutOfDate\\n            added {\\n              uuid\\n              title\\n              description\\n              severity\\n              foundByPipelineIid\\n            }\\n            fixed {\\n              uuid\\n              title\\n              description\\n              severity\\n              foundByPipelineIid\\n            }\\n          }\\n        }\\n      }\\n    }\\n  }\\n\",\"variables\":{\"fullPath\":\"a/project\",\"mergeRequestIid\":\"773\",\"reportType\":\"API_FUZZING\"}}}",
      "stack": [
        "Error: ComparableSecurityReportType isn't a defined input type (on $reportType): {\"response\":{\"errors\":[{\"message\":\"ComparableSecurityReportType isn't a defined input type (on $reportType)\",\"locations\":[{\"line\":5,\"column\":5}],\"path\":[\"query getMRSecurityReport\"],\"extensions\":{\"code\":\"variableRequiresValidType\",\"typeName\":\"ComparableSecurityReportType\",\"variableName\":\"reportType\"}},{\"message\":\"Field 'findingReportsComparer' doesn't exist on type 'MergeRequest'\",\"locations\":[{\"line\":10,\"column\":9}],\"path\":[\"query getMRSecurityReport\",\"project\",\"mergeRequest\",\"findingReportsComparer\"],\"extensions\":{\"code\":\"undefinedField\",\"typeName\":\"MergeRequest\",\"fieldName\":\"findingReportsComparer\"}},{\"message\":\"Variable $reportType is declared by getMRSecurityReport but not used\",\"locations\":[{\"line\":2,\"column\":3}],\"path\":[\"query getMRSecurityReport\"],\"extensions\":{\"code\":\"variableNotUsed\",\"variableName\":\"reportType\"}}],\"status\":200,\"headers\":{}},\"request\":{\"query\":\"\\n  query getMRSecurityReport(\\n    $fullPath: ID!\\n    $mergeRequestIid: String!\\n    $reportType: ComparableSecurityReportType!\\n  ) {\\n    project(fullPath: $fullPath) {\\n      mergeRequest(iid: $mergeRequestIid) {\\n        title\\n        findingReportsComparer(reportType: $reportType) {\\n          status\\n          report {\\n            headReportCreatedAt\\n            baseReportCreatedAt\\n            baseReportOutOfDate\\n            added {\\n              uuid\\n              title\\n              description\\n              severity\\n              foundByPipelineIid\\n            }\\n            fixed {\\n              uuid\\n              title\\n              description\\n              severity\\n              foundByPipelineIid\\n            }\\n          }\\n        }\\n      }\\n    }\\n  }\\n\",\"variables\":{\"fullPath\":\"a/project\",\"mergeRequestIid\":\"773\",\"reportType\":\"API_FUZZING\"}}}",
        "    at ZC (/Users/me/.vscode/extensions/node_modules/graphql-request/src/index.ts:426:11)",
        "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
        "    at async Promise.all (index 6)",
        "    at qz (/Users/me/.vscode/extensions/src/desktop/gitlab/security_findings/get_all_security_reports.ts:40:21)",
        "    at Function.getState (/Users/me/.vscode/extensions/src/desktop/current_branch_refresher.ts:184:28)",
        "    at t.refresh (/Users/me/.vscode/extensions/src/desktop/current_branch_refresher.ts:129:24)",
        "    at t.clearAndSetIntervalAndRefresh (/Users/me/.vscode/extensions/src/desktop/current_branch_refresher.ts:116:5)",
        "    at h.value (/Users/me/.vscode/extensions/src/desktop/current_branch_refresher.ts:95:9)"
      ]
    }

Possible fixes

Maybe https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/main/src/desktop/gitlab/security_findings/get_all_security_reports.ts 🤷