From 0f314e2da58a46a9509c523c3a58060135fdbcd0 Mon Sep 17 00:00:00 2001 From: "svc.appcenter" Date: Thu, 26 May 2022 19:32:25 -0300 Subject: [PATCH 1/3] fix/Add Repo part for user azure server 2020 Signed-off-by: Joao Paulo Moreira Antunes --- packages/integration/src/azure/AzureUrl.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/integration/src/azure/AzureUrl.ts b/packages/integration/src/azure/AzureUrl.ts index 76de8550ed..1161ab7a1b 100644 --- a/packages/integration/src/azure/AzureUrl.ts +++ b/packages/integration/src/azure/AzureUrl.ts @@ -37,6 +37,10 @@ export class AzureUrl { owner = parts[1]; project = parts[2]; repo = parts[4]; + } else if (parts[4] === '_git') { + owner = `${parts[1]}/${parts[2]}`; + project = parts[3]; + repo = parts[5]; } if (!owner || !project || !repo) { From e37c71b5a4654d6843abfce2248268f2061120bb Mon Sep 17 00:00:00 2001 From: Joao Paulo Moreira Antunes Date: Mon, 30 May 2022 18:57:48 -0300 Subject: [PATCH 2/3] catalog azure server 2020 for use with old tfs Signed-off-by: Joao Paulo Moreira Antunes --- .changeset/shy-geese-judge.md | 5 ++++ .../integration/src/azure/AzureUrl.test.ts | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 .changeset/shy-geese-judge.md diff --git a/.changeset/shy-geese-judge.md b/.changeset/shy-geese-judge.md new file mode 100644 index 0000000000..8012b78c8f --- /dev/null +++ b/.changeset/shy-geese-judge.md @@ -0,0 +1,5 @@ +--- +'@backstage/integration': patch +--- + +Updated to support deployments of Azure DevOps Server under TFS or similar subpath diff --git a/packages/integration/src/azure/AzureUrl.test.ts b/packages/integration/src/azure/AzureUrl.test.ts index 2f22dd13da..a56f800133 100644 --- a/packages/integration/src/azure/AzureUrl.test.ts +++ b/packages/integration/src/azure/AzureUrl.test.ts @@ -142,6 +142,30 @@ describe('AzureUrl', () => { ); }); + it('should work with the old tfs long URL', () => { + const url = AzureUrl.fromRepoUrl( + 'http://my-host/tfs/projects/my-project/_git/my-repo', + ); + + expect(url.getOwner()).toBe('tfs/projects'); + expect(url.getProject()).toBe('my-project'); + expect(url.getRepo()).toBe('my-repo'); + expect(url.getRef()).toBeUndefined(); + expect(url.getPath()).toBeUndefined(); + }); + + it('should work with the old tfs long URL form with a path and ref', () => { + const url = AzureUrl.fromRepoUrl( + 'http://my-host/tfs/projects/my-project/_git/my-repo?path=%2Ffolder&version=GBtest-branch', + ); + + expect(url.getOwner()).toBe('tfs/projects'); + expect(url.getProject()).toBe('my-project'); + expect(url.getRepo()).toBe('my-repo'); + expect(url.getRef()).toBe('test-branch'); + expect(url.getPath()).toBe('/folder'); + }); + it('should reject non-branch refs', () => { expect(() => AzureUrl.fromRepoUrl( From d22bf3267dbbeeab34beb030b46b3a702ec59bbc Mon Sep 17 00:00:00 2001 From: Joao Paulo Moreira Antunes Date: Tue, 31 May 2022 13:58:06 -0300 Subject: [PATCH 3/3] edit changeset Signed-off-by: Joao Paulo Moreira Antunes --- .changeset/shy-geese-judge.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/shy-geese-judge.md b/.changeset/shy-geese-judge.md index 8012b78c8f..fbb994263b 100644 --- a/.changeset/shy-geese-judge.md +++ b/.changeset/shy-geese-judge.md @@ -2,4 +2,4 @@ '@backstage/integration': patch --- -Updated to support deployments of Azure DevOps Server under TFS or similar subpath +Updated to support deployments of Azure DevOps Server under TFS or similar sub path