From 60f904bef8623ec499f737ddf4fd55d9b064ace6 Mon Sep 17 00:00:00 2001 From: JanhaviAlekar Date: Wed, 3 Jul 2024 11:46:43 +0530 Subject: [PATCH 1/3] adding gitops support for all git repo Signed-off-by: JanhaviAlekar --- chaoscenter/graphql/server/pkg/gitops/gitops.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chaoscenter/graphql/server/pkg/gitops/gitops.go b/chaoscenter/graphql/server/pkg/gitops/gitops.go index b629e600d79..7448b648ffe 100644 --- a/chaoscenter/graphql/server/pkg/gitops/gitops.go +++ b/chaoscenter/graphql/server/pkg/gitops/gitops.go @@ -14,6 +14,7 @@ import ( "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" + "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/plumbing/transport/http" "github.com/go-git/go-git/v5/plumbing/transport/ssh" @@ -172,6 +173,10 @@ func (c GitConfig) GitClone() (*git.Repository, error) { // getAuthMethod returns the AuthMethod instance required for the current repo access [read/writes] func (c GitConfig) getAuthMethod() (transport.AuthMethod, error) { + transport.UnsupportedCapabilities = []capability.Capability{ + capability.ThinPack, + } + switch c.AuthType { case model.AuthTypeToken: From 95c5f611c5f1c05cec8d1bc709ddc7ebf691950c Mon Sep 17 00:00:00 2001 From: JanhaviAlekar Date: Wed, 3 Jul 2024 15:18:54 +0530 Subject: [PATCH 2/3] Changing Github-repository to Remote-repository in UI Signed-off-by: JanhaviAlekar --- chaoscenter/web/src/strings/strings.en.yaml | 2 +- chaoscenter/web/src/strings/types.ts | 2 +- chaoscenter/web/src/views/Gitops/Gitops.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chaoscenter/web/src/strings/strings.en.yaml b/chaoscenter/web/src/strings/strings.en.yaml index 80fff0b50af..64f55f59f24 100644 --- a/chaoscenter/web/src/strings/strings.en.yaml +++ b/chaoscenter/web/src/strings/strings.en.yaml @@ -426,7 +426,6 @@ genericResourceNotFoundError: >- has been deleted. gitConnection: Repository Connection gitOps: GitOps -githubRepo: Github Repository gitops: Gitops goBack: Go back to previous page goChaosHome: Go to Home @@ -889,6 +888,7 @@ referencedBy: Referenced By registry: Registry registryName: Registry Name registryType: Registry Type +remoteRepo: Remote Repository remove: Remove removeMember: Remove Member removeMemberConfirmation: Are you sure you want to remove {{username}}? diff --git a/chaoscenter/web/src/strings/types.ts b/chaoscenter/web/src/strings/types.ts index 9db3a837ac8..8fd85382d53 100644 --- a/chaoscenter/web/src/strings/types.ts +++ b/chaoscenter/web/src/strings/types.ts @@ -362,7 +362,6 @@ export interface StringsMap { 'genericResourceNotFoundError': PrimitiveObject<'resource' | 'resourceID' | 'projectID'> 'gitConnection': unknown 'gitOps': unknown - 'githubRepo': unknown 'gitops': unknown 'goBack': unknown 'goChaosHome': unknown @@ -737,6 +736,7 @@ export interface StringsMap { 'registry': unknown 'registryName': unknown 'registryType': unknown + 'remoteRepo': unknown 'remove': unknown 'removeMember': unknown 'removeMemberConfirmation': PrimitiveObject<'username'> diff --git a/chaoscenter/web/src/views/Gitops/Gitops.tsx b/chaoscenter/web/src/views/Gitops/Gitops.tsx index 7bc4b1fb89d..1c0f35e5662 100644 --- a/chaoscenter/web/src/views/Gitops/Gitops.tsx +++ b/chaoscenter/web/src/views/Gitops/Gitops.tsx @@ -199,7 +199,7 @@ export default function GitopsView({ font={{ variation: FontVariation.BODY2_SEMI, weight: 'semi-bold' }} color={Color.BLACK} > - {getString('githubRepo')} + {getString('remoteRepo')} {gitopsType === GitopsValues.GITHUB && ( From c2d7f3adaf4a17c12b4ee7bd09991e1c96751ccf Mon Sep 17 00:00:00 2001 From: JanhaviAlekar Date: Wed, 3 Jul 2024 15:30:29 +0530 Subject: [PATCH 3/3] Adding comments Signed-off-by: JanhaviAlekar --- chaoscenter/graphql/server/pkg/gitops/gitops.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chaoscenter/graphql/server/pkg/gitops/gitops.go b/chaoscenter/graphql/server/pkg/gitops/gitops.go index 7448b648ffe..c7b2afda308 100644 --- a/chaoscenter/graphql/server/pkg/gitops/gitops.go +++ b/chaoscenter/graphql/server/pkg/gitops/gitops.go @@ -173,6 +173,9 @@ func (c GitConfig) GitClone() (*git.Repository, error) { // getAuthMethod returns the AuthMethod instance required for the current repo access [read/writes] func (c GitConfig) getAuthMethod() (transport.AuthMethod, error) { + // Azure DevOps requires the 'multi_ack' and 'multi_ack_detailed' capabilities, + // which are not fully implemented in the go-git package. By default, these + // capabilities are included in 'transport.UnsupportedCapabilities'. transport.UnsupportedCapabilities = []capability.Capability{ capability.ThinPack, }