Skip to content

Commit

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

* 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
Signed-off-by: Miguel Sacristán Izcue <miguel_tete17@hotmail.com>

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

Signed-off-by: Miguel Sacristán Izcue <miguel_tete17@hotmail.com>

---------

Signed-off-by: Miguel Sacristán Izcue <miguel_tete17@hotmail.com>

(cherry picked from commit 5662367)
Signed-off-by: Miguel Sacristán Izcue <miguel_tete17@hotmail.com>
  • Loading branch information
tete17 committed May 28, 2023
1 parent 5640b72 commit 358db7b
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 @@ -222,6 +222,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. [Viaduct](https://www.viaduct.ai/)
1. [Virtuo](https://www.govirtuo.com/)
1. [VISITS Technologies](https://visits.world/en)
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 @@ -33,6 +33,12 @@ export function revisionUrl(url: string, revision: string): string {
urlSubPath = isSHA(revision) ? '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 358db7b

Please sign in to comment.