Getting details for closing issue fails (issue.iid is undefined)
Checklist
-
I'm using the latest version of the extension (see the latest version in the right column of this page) - Extension version: Put your extension version here
-
I'm using the latest VS Code version (find the latest version here) - VS Code version: Put your VS Code version here
-
I'm using a supported version of GitLab (see README for the supported version) - GitLab version: Put your GitLab version here, or say "happens on
gitlab.com
"
- GitLab version: Put your GitLab version here, or say "happens on
Summary
When the extension tries to fetch details for MR closing issue (happens every 30s), the API call fails because we add undefined
to the request.
Steps to reproduce
- I can't reproduce the issue, it's almost certainly caused by some old version of GitLab.
- I assume we call
/projects/${project.restId}/merge_requests/${mrId}/closes_issues
to get closing issues, but the objects we get back from API dont' containiid
property. - This is the code that fails: https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/blob/75fb449c2b85be42c78ca672f1e96fbf4b83f271/src/current_branch_refresher.ts#L127
const minimalIssues = mr ? await gitLabService.getMrClosingIssues(project, mr.iid) : [];
const issues = (
await Promise.all(
minimalIssues.map(mi => gitLabService.getSingleProjectIssue(project, mi.iid)),
)
).filter(notNullOrUndefined);
What is the current bug behavior?
We generate incorrect API calls.
What is the expected correct behavior?
Ignoring closing issue objects that don't contain iid
.