Skip to content

Commit

Permalink
fix(ui): Stop using the deprecated url format for gitlab instances (#…
Browse files Browse the repository at this point in the history
…13687) (#13767)

* fix: Stop using the deprecated url format for gitlab instances

The legacy URLs format has been deprecated since february 2023 and
now gitlab is make these urls invalid.

Ref: https://docs.gitlab.com/ee/update/deprecations.html#legacy-urls-replaced-or-removed


* docs: Add Urbantz to the list of organizations using argo-cd



---------

Signed-off-by: Miguel Sacristán Izcue <miguel_tete17@hotmail.com>
Co-authored-by: Tete17 <miguel_tete17@hotmail.com>
  • Loading branch information
gcp-cherry-pick-bot[bot] and tete17 authored May 27, 2023
1 parent ed828e9 commit 2db86af
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ Currently, the following organizations are **officially** using Argo CD:
1. [ungleich.ch](https://ungleich.ch/)
1. [Unifonic Inc](https://www.unifonic.com/)
1. [Universidad Mesoamericana](https://www.umes.edu.gt/)
1. [Urbantz](https://urbantz.com/)
1. [Vectra](https://www.vectra.ai)
1. [Viaduct](https://www.viaduct.ai/)
1. [Vinted](https://vinted.com/)
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/shared/components/urls.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test('gitlab.com', () => {
'git@gitlab.com:alex_collins/private-repo.git',
'b1fe9426ead684d7af16958920968342ee295c1f',
'https://gitlab.com/alex_collins/private-repo',
'https://gitlab.com/alex_collins/private-repo/commit/b1fe9426ead684d7af16958920968342ee295c1f');
'https://gitlab.com/alex_collins/private-repo/-/commit/b1fe9426ead684d7af16958920968342ee295c1f');
});

test('bitbucket.org', () => {
Expand Down
6 changes: 6 additions & 0 deletions ui/src/app/shared/components/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ export function revisionUrl(url: string, revision: string, forPath: boolean): st
urlSubPath = isSHA(revision) && !forPath ? 'commits' : 'src';
}

// Gitlab changed the way urls to commit look like
// Ref: https://docs.gitlab.com/ee/update/deprecations.html#legacy-urls-replaced-or-removed
if (parsed.source === 'gitlab.com') {
urlSubPath = '-/' + urlSubPath;
}

if (!supportedSource(parsed)) {
return null;
}
Expand Down

0 comments on commit 2db86af

Please sign in to comment.