Skip to content

Commit

Permalink
Adding gitops support for all git repositories (#4743)
Browse files Browse the repository at this point in the history
* adding gitops support for all git repo

Signed-off-by: JanhaviAlekar <[email protected]>

* Changing Github-repository to Remote-repository in UI

Signed-off-by: JanhaviAlekar <[email protected]>

* Adding comments

Signed-off-by: JanhaviAlekar <[email protected]>

---------

Signed-off-by: JanhaviAlekar <[email protected]>
Co-authored-by: Amit Kumar Das <[email protected]>
Co-authored-by: Namkyu Park <[email protected]>
Co-authored-by: Saranya Jena <[email protected]>
  • Loading branch information
4 people authored Jul 22, 2024
1 parent 50c2ef5 commit 08c111a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions chaoscenter/graphql/server/pkg/gitops/gitops.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -172,6 +173,13 @@ 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,
}

switch c.AuthType {

case model.AuthTypeToken:
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/web/src/strings/strings.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}}?
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/web/src/strings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ export interface StringsMap {
'genericResourceNotFoundError': PrimitiveObject<'resource' | 'resourceID' | 'projectID'>
'gitConnection': unknown
'gitOps': unknown
'githubRepo': unknown
'gitops': unknown
'goBack': unknown
'goChaosHome': unknown
Expand Down Expand Up @@ -737,6 +736,7 @@ export interface StringsMap {
'registry': unknown
'registryName': unknown
'registryType': unknown
'remoteRepo': unknown
'remove': unknown
'removeMember': unknown
'removeMemberConfirmation': PrimitiveObject<'username'>
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/web/src/views/Gitops/Gitops.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default function GitopsView({
font={{ variation: FontVariation.BODY2_SEMI, weight: 'semi-bold' }}
color={Color.BLACK}
>
{getString('githubRepo')}
{getString('remoteRepo')}
</Text>
</Layout.Vertical>
{gitopsType === GitopsValues.GITHUB && (
Expand Down

0 comments on commit 08c111a

Please sign in to comment.