fix: incorrect branch encoding
This MR adds tests and fixes for the following issue:
When we removed the legacy GitLab service (!428 (merged)), we introduced a bug when we escaped some API query parameters twice.
That created malformed API URLs like these ones:
- https://gitlab.example.com/api/v4/projects/5261717/merge_requests?state=opened&source_branch=feature%252F123
+ https://gitlab.example.com/api/v4/projects/5261717/merge_requests?state=opened&source_branch=feature%2F123
notice double-escaped source_branch=feature/123
parameter
- https://gitlab.example.com/api/v4/projects/group%2Fproject/repository/tree?ref=feat%252F123&path=path%252Fto%252Ffile
+ https://gitlab.example.com/api/v4/projects/group%2Fproject/repository/tree?ref=feat%2F123&path=path%2Fto%2Ffile
notice double-escaped ref=feat/123
and path=path/to/file
parameters
(The issue affected "For Current Branch" and "Remote Repository" features)
I also removed duplication from the gitlab_service.tests.ts
by initializing the GitLabService
in the beforeEach
block.
Related to #523 (closed)
Edited by Tomas Vik