From b9bc3f9278d39424a7fede5a0a640d89c8daa867 Mon Sep 17 00:00:00 2001 From: Pluggi <1277836+Pluggi@users.noreply.github.com> Date: Wed, 27 Apr 2022 16:39:59 +0200 Subject: [PATCH 1/4] ui: Fix delete radio labels/ids (#9218) * ui: Fix delete radio labels/ids Signed-off-by: Antoine Bardoux * Fix linter Signed-off-by: Antoine Bardoux Co-authored-by: pasha-codefresh --- ui/src/app/applications/components/utils.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/app/applications/components/utils.tsx b/ui/src/app/applications/components/utils.tsx index c8a78dd832b6d..49b868f4ccfb6 100644 --- a/ui/src/app/applications/components/utils.tsx +++ b/ui/src/app/applications/components/utils.tsx @@ -272,15 +272,16 @@ export const deletePopup = async (ctx: ContextApis, resource: ResourceTreeNode, onChange={() => handleStateChange('foreground')} defaultChecked={true} style={{marginRight: '5px'}} + id='foreground-delete-radio' /> - handleStateChange('force')} style={{marginRight: '5px'}} /> + handleStateChange('force')} style={{marginRight: '5px'}} id='force-delete-radio' /> - handleStateChange('orphan')} style={{marginRight: '5px'}} /> + handleStateChange('orphan')} style={{marginRight: '5px'}} id='cascade-delete-radio' /> From e07b3e7492e934ee7bd332ca423c7dbb1c5280c0 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Wed, 27 Apr 2022 09:21:08 -0700 Subject: [PATCH 2/4] ci: Cancel redundant builds. Fixes #9222 (#9223) Signed-off-by: Alex Collins --- .github/workflows/ci-build.yaml | 4 ++++ .github/workflows/codeql.yml | 4 ++++ .github/workflows/image.yaml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 077e68ba3989f..be33dcd2ff111 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -14,6 +14,10 @@ env: # Golang version to use across CI steps GOLANG_VERSION: '1.18' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: check-go: name: Ensure Go modules synchronicity diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 44f1a05d70185..ff8bd02cc4c2a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -9,6 +9,10 @@ on: schedule: - cron: '0 19 * * 0' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: CodeQL-Build: if: github.repository == 'argoproj/argo-cd' diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index 99db85e7c7a7f..db9dd36234979 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -12,6 +12,10 @@ on: env: GOLANG_VERSION: '1.18' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: publish: if: github.repository == 'argoproj/argo-cd' From 721798e01676850c194710d4328198dbd95aa561 Mon Sep 17 00:00:00 2001 From: Michael Crenshaw Date: Wed, 27 Apr 2022 12:54:35 -0400 Subject: [PATCH 3/4] fix: fall back to only branch if default branch is missing in gitea (#9228) * fix: fall back to only branch if default branch is missing in gitea Signed-off-by: Michael Crenshaw * throw meaningful error, use different org for test Signed-off-by: Michael Crenshaw --- applicationset/services/scm_provider/gitea.go | 5 ++++- .../services/scm_provider/gitea_test.go | 16 ++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/applicationset/services/scm_provider/gitea.go b/applicationset/services/scm_provider/gitea.go index 15e8f1a9adbc1..971e92497b497 100644 --- a/applicationset/services/scm_provider/gitea.go +++ b/applicationset/services/scm_provider/gitea.go @@ -46,7 +46,10 @@ func NewGiteaProvider(ctx context.Context, owner, token, url string, allBranches func (g *GiteaProvider) GetBranches(ctx context.Context, repo *Repository) ([]*Repository, error) { if !g.allBranches { - branch, _, err := g.client.GetRepoBranch(g.owner, repo.Repository, repo.Branch) + branch, status, err := g.client.GetRepoBranch(g.owner, repo.Repository, repo.Branch) + if status.StatusCode == 404 { + return nil, fmt.Errorf("got 404 while getting default branch %q for repo %q - check your repo config: %w", repo.Branch, repo.Repository, err) + } if err != nil { return nil, err } diff --git a/applicationset/services/scm_provider/gitea_test.go b/applicationset/services/scm_provider/gitea_test.go index e3992b3987371..c585aafe1a679 100644 --- a/applicationset/services/scm_provider/gitea_test.go +++ b/applicationset/services/scm_provider/gitea_test.go @@ -19,20 +19,20 @@ func TestGiteaListRepos(t *testing.T) { { name: "blank protocol", allBranches: false, - url: "git@gitea.com:gitea/go-sdk.git", - branches: []string{"master"}, + url: "git@gitea.com:test-argocd/pr-test.git", + branches: []string{"main"}, }, { name: "ssh protocol", allBranches: false, proto: "ssh", - url: "git@gitea.com:gitea/go-sdk.git", + url: "git@gitea.com:test-argocd/pr-test.git", }, { name: "https protocol", allBranches: false, proto: "https", - url: "https://gitea.com/gitea/go-sdk", + url: "https://gitea.com/test-argocd/pr-test", }, { name: "other protocol", @@ -43,14 +43,14 @@ func TestGiteaListRepos(t *testing.T) { { name: "all branches", allBranches: true, - url: "git@gitea.com:gitea/go-sdk.git", - branches: []string{"master", "release/v0.11", "release/v0.12", "release/v0.13", "release/v0.14", "release/v0.15"}, + url: "git@gitea.com:test-argocd/pr-test.git", + branches: []string{"main"}, }, } for _, c := range cases { t.Run(c.name, func(t *testing.T) { - provider, _ := NewGiteaProvider(context.Background(), "gitea", "", "https://gitea.com/", c.allBranches, false) + provider, _ := NewGiteaProvider(context.Background(), "test-argocd", "", "https://gitea.com/", c.allBranches, false) rawRepos, err := ListRepos(context.Background(), provider, c.filters, c.proto) if c.hasError { assert.NotNil(t, err) @@ -61,7 +61,7 @@ func TestGiteaListRepos(t *testing.T) { repos := []*Repository{} branches := []string{} for _, r := range rawRepos { - if r.Repository == "go-sdk" { + if r.Repository == "pr-test" { repos = append(repos, r) branches = append(branches, r.Branch) } From 5f0e58d5f0678a0ca545c82a0f0ed060fdf648d3 Mon Sep 17 00:00:00 2001 From: Michael Crenshaw Date: Wed, 27 Apr 2022 13:29:29 -0400 Subject: [PATCH 4/4] fix: throw better error if default branch is missing in gitea (#9228) * fix: fall back to only branch if default branch is missing in gitea Signed-off-by: Michael Crenshaw * throw meaningful error, use different org for test Signed-off-by: Michael Crenshaw