Merge pull request #12774 from jamieklassen/gitlab-unscoped

support unscoped routes in location targets on gitlab
This commit is contained in:
Ben Lambert
2022-08-02 10:33:54 +02:00
committed by GitHub
4 changed files with 149 additions and 213 deletions
@@ -106,7 +106,7 @@ describe('GitlabUrlReader', () => {
);
it.each([
// Project URLs
// Scoped routes
{
url: 'https://gitlab.com/groupA/teams/teamA/subgroupA/repoA/-/blob/branch/my/path/to/file.yaml',
config: createConfig(),
@@ -135,12 +135,12 @@ describe('GitlabUrlReader', () => {
}),
},
// Raw URLs
// Unscoped route
{
url: 'https://gitlab.example.com/a/b/blob/master/c.yaml',
config: createConfig(),
response: expect.objectContaining({
url: 'https://gitlab.example.com/a/b/raw/master/c.yaml',
url: 'https://gitlab.example.com/api/v4/projects/12345/repository/files/c.yaml/raw?ref=master',
}),
},
])('should handle happy path %#', async ({ url, config, response }) => {