From e1634a41124f02214ac17edbdf1dbbf8a0262c84 Mon Sep 17 00:00:00 2001 From: Andrii Korotkov Date: Sat, 15 Mar 2025 08:38:11 -0700 Subject: [PATCH 1/4] fix: Use dorny changes files instead of compromised tj-actions one The later was compromised and taken down, the former seems like a drop-in replacement Signed-off-by: Andrii Korotkov --- .github/workflows/ci-build.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 8f04dd83dd564..3a1d773a38e50 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -27,16 +27,16 @@ jobs: changes: runs-on: ubuntu-latest outputs: - backend: ${{ steps.filter.outputs.backend_any_changed }} - frontend: ${{ steps.filter.outputs.frontend_any_changed }} - docs: ${{ steps.filter.outputs.docs_any_changed }} + backend: ${{ steps.filter.outputs.backend }} + frontend: ${{ steps.filter.outputs.frontend }} + docs: ${{ steps.filter.outputs.docs }} steps: - uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0 - - uses: tj-actions/changed-files@bab30c2299617f6615ec02a68b9a40d10bd21366 # v45.0.5 + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 id: filter with: # Any file which is not under docs/, ui/ or is not a markdown file is counted as a backend file - files_yaml: | + filters: | backend: - '!ui/**' - '!**.md' From 401cd38eeb31dee6ff04ca48e7080a91de74164d Mon Sep 17 00:00:00 2001 From: Andrii Korotkov Date: Fri, 14 Mar 2025 23:27:54 -0700 Subject: [PATCH 2/4] fix: Account for batch event processing in e2e tests Address tests flakiness by adjusting batch event processing time to 1ms in e2e tests (as there's little to process) and waiting for 5ms in When and Then to account for that delay. Signed-off-by: Andrii Korotkov --- Makefile | 1 + test/e2e/fixture/account/actions.go | 4 ++++ test/e2e/fixture/account/consequences.go | 3 +++ test/e2e/fixture/account/context.go | 3 +++ test/e2e/fixture/admin/actions.go | 4 ++++ test/e2e/fixture/admin/consequences.go | 4 ++++ test/e2e/fixture/admin/context.go | 3 +++ test/e2e/fixture/app/actions.go | 3 +++ test/e2e/fixture/app/consequences.go | 2 ++ test/e2e/fixture/app/context.go | 2 ++ test/e2e/fixture/applicationsets/actions.go | 2 ++ test/e2e/fixture/applicationsets/consequences.go | 2 ++ test/e2e/fixture/applicationsets/context.go | 2 ++ test/e2e/fixture/cluster/actions.go | 3 +++ test/e2e/fixture/cluster/consequences.go | 3 +++ test/e2e/fixture/cluster/context.go | 3 +++ test/e2e/fixture/notification/actions.go | 4 ++++ test/e2e/fixture/notification/consequences.go | 3 +++ test/e2e/fixture/notification/context.go | 3 +++ test/e2e/fixture/project/actions.go | 3 +++ test/e2e/fixture/project/consequences.go | 3 +++ test/e2e/fixture/project/context.go | 3 +++ test/e2e/fixture/repos/actions.go | 3 +++ test/e2e/fixture/repos/consequences.go | 3 +++ test/e2e/fixture/repos/context.go | 3 +++ 25 files changed, 72 insertions(+) diff --git a/Makefile b/Makefile index 8dec6f04a4143..9f8adf87d44c6 100644 --- a/Makefile +++ b/Makefile @@ -486,6 +486,7 @@ start-e2e-local: mod-vendor-local dep-ui-local cli-local ARGOCD_APPLICATIONSET_CONTROLLER_ALLOWED_SCM_PROVIDERS=http://127.0.0.1:8341,http://127.0.0.1:8342,http://127.0.0.1:8343,http://127.0.0.1:8344 \ ARGOCD_E2E_TEST=true \ ARGOCD_HYDRATOR_ENABLED=true \ + ARGOCD_CLUSTER_CACHE_EVENTS_PROCESSING_INTERVAL=1ms \ goreman -f $(ARGOCD_PROCFILE) start ${ARGOCD_START} ls -lrt /tmp/coverage diff --git a/test/e2e/fixture/account/actions.go b/test/e2e/fixture/account/actions.go index aafd7e1136162..fb612ff2ba96f 100644 --- a/test/e2e/fixture/account/actions.go +++ b/test/e2e/fixture/account/actions.go @@ -1,6 +1,8 @@ package project import ( + "time" + "github.com/stretchr/testify/require" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" @@ -81,5 +83,7 @@ func (a *Actions) runCli(args ...string) { func (a *Actions) Then() *Consequences { a.context.t.Helper() + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/account/consequences.go b/test/e2e/fixture/account/consequences.go index 9c526edbbb0c1..32c1dcb1f08d7 100644 --- a/test/e2e/fixture/account/consequences.go +++ b/test/e2e/fixture/account/consequences.go @@ -3,6 +3,7 @@ package project import ( "context" "errors" + "time" "github.com/stretchr/testify/require" @@ -64,5 +65,7 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return c.actions } diff --git a/test/e2e/fixture/account/context.go b/test/e2e/fixture/account/context.go index d639faf1969fa..7718326b06647 100644 --- a/test/e2e/fixture/account/context.go +++ b/test/e2e/fixture/account/context.go @@ -2,6 +2,7 @@ package project import ( "testing" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" "github.com/argoproj/argo-cd/v3/util/env" @@ -45,5 +46,7 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Actions{context: c} } diff --git a/test/e2e/fixture/admin/actions.go b/test/e2e/fixture/admin/actions.go index e25de18bbaa32..5b0ea706c9d11 100644 --- a/test/e2e/fixture/admin/actions.go +++ b/test/e2e/fixture/admin/actions.go @@ -1,6 +1,8 @@ package admin import ( + "time" + "github.com/argoproj/argo-cd/v3/test/e2e/fixture" ) @@ -63,5 +65,7 @@ func (a *Actions) runCliWithStdin(stdin string, args ...string) { func (a *Actions) Then() *Consequences { a.context.t.Helper() + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/admin/consequences.go b/test/e2e/fixture/admin/consequences.go index b9bf1dcc28dc9..586042fe3191f 100644 --- a/test/e2e/fixture/admin/consequences.go +++ b/test/e2e/fixture/admin/consequences.go @@ -1,6 +1,8 @@ package admin import ( + "time" + . "github.com/argoproj/argo-cd/v3/test/e2e/fixture/admin/utils" ) @@ -33,5 +35,7 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return c.actions } diff --git a/test/e2e/fixture/admin/context.go b/test/e2e/fixture/admin/context.go index 76d91af8677f8..cb35046f266b3 100644 --- a/test/e2e/fixture/admin/context.go +++ b/test/e2e/fixture/admin/context.go @@ -2,6 +2,7 @@ package admin import ( "testing" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" "github.com/argoproj/argo-cd/v3/util/env" @@ -39,5 +40,7 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Actions{context: c} } diff --git a/test/e2e/fixture/app/actions.go b/test/e2e/fixture/app/actions.go index d880f1b40cc33..8e907aa7d4406 100644 --- a/test/e2e/fixture/app/actions.go +++ b/test/e2e/fixture/app/actions.go @@ -6,6 +6,7 @@ import ( "os" "slices" "strconv" + "time" rbacv1 "k8s.io/api/rbac/v1" @@ -492,6 +493,8 @@ func (a *Actions) And(block func()) *Actions { func (a *Actions) Then() *Consequences { a.context.t.Helper() + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Consequences{a.context, a, 15} } diff --git a/test/e2e/fixture/app/consequences.go b/test/e2e/fixture/app/consequences.go index 05fdb17a2af4d..aa71e8184d180 100644 --- a/test/e2e/fixture/app/consequences.go +++ b/test/e2e/fixture/app/consequences.go @@ -101,6 +101,8 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return c.actions } diff --git a/test/e2e/fixture/app/context.go b/test/e2e/fixture/app/context.go index 50d33955cd948..03ede39bd55e0 100644 --- a/test/e2e/fixture/app/context.go +++ b/test/e2e/fixture/app/context.go @@ -349,6 +349,8 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Actions{context: c} } diff --git a/test/e2e/fixture/applicationsets/actions.go b/test/e2e/fixture/applicationsets/actions.go index ebf755b3438aa..44ed8d2d21fe3 100644 --- a/test/e2e/fixture/applicationsets/actions.go +++ b/test/e2e/fixture/applicationsets/actions.go @@ -61,6 +61,8 @@ func (a *Actions) And(block func()) *Actions { func (a *Actions) Then() *Consequences { a.context.t.Helper() + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/applicationsets/consequences.go b/test/e2e/fixture/applicationsets/consequences.go index 22dea84247a08..0df6d5774e7ad 100644 --- a/test/e2e/fixture/applicationsets/consequences.go +++ b/test/e2e/fixture/applicationsets/consequences.go @@ -71,6 +71,8 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return c.actions } diff --git a/test/e2e/fixture/applicationsets/context.go b/test/e2e/fixture/applicationsets/context.go index 4533bb61c3948..c17c5cb1f6b13 100644 --- a/test/e2e/fixture/applicationsets/context.go +++ b/test/e2e/fixture/applicationsets/context.go @@ -29,6 +29,8 @@ func Given(t *testing.T) *Context { } func (c *Context) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Actions{context: c} } diff --git a/test/e2e/fixture/cluster/actions.go b/test/e2e/fixture/cluster/actions.go index 4c03cf570524a..6accff4aff789 100644 --- a/test/e2e/fixture/cluster/actions.go +++ b/test/e2e/fixture/cluster/actions.go @@ -5,6 +5,7 @@ import ( "errors" "log" "strings" + "time" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" @@ -131,6 +132,8 @@ func (a *Actions) DeleteByServer() *Actions { func (a *Actions) Then() *Consequences { a.context.t.Helper() + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/cluster/consequences.go b/test/e2e/fixture/cluster/consequences.go index d6a856708a91c..14446f9492215 100644 --- a/test/e2e/fixture/cluster/consequences.go +++ b/test/e2e/fixture/cluster/consequences.go @@ -3,6 +3,7 @@ package cluster import ( "context" "errors" + "time" clusterpkg "github.com/argoproj/argo-cd/v3/pkg/apiclient/cluster" "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1" @@ -54,5 +55,7 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return c.actions } diff --git a/test/e2e/fixture/cluster/context.go b/test/e2e/fixture/cluster/context.go index 83d1541772fe7..6fe2f19e64873 100644 --- a/test/e2e/fixture/cluster/context.go +++ b/test/e2e/fixture/cluster/context.go @@ -2,6 +2,7 @@ package cluster import ( "testing" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" "github.com/argoproj/argo-cd/v3/util/env" @@ -59,6 +60,8 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Actions{context: c} } diff --git a/test/e2e/fixture/notification/actions.go b/test/e2e/fixture/notification/actions.go index 81b35e50de3d7..83c05f3530192 100644 --- a/test/e2e/fixture/notification/actions.go +++ b/test/e2e/fixture/notification/actions.go @@ -1,6 +1,8 @@ package notification import ( + "time" + "github.com/stretchr/testify/require" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" @@ -24,6 +26,8 @@ func (a *Actions) SetParamInNotificationConfigMap(key, value string) *Actions { func (a *Actions) Then() *Consequences { a.context.t.Helper() + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/notification/consequences.go b/test/e2e/fixture/notification/consequences.go index 4401268a45928..c0ad7fbb803d8 100644 --- a/test/e2e/fixture/notification/consequences.go +++ b/test/e2e/fixture/notification/consequences.go @@ -2,6 +2,7 @@ package notification import ( "context" + "time" "github.com/argoproj/argo-cd/v3/pkg/apiclient/notification" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" @@ -53,6 +54,8 @@ func (c *Consequences) listTemplates() (*notification.TemplateList, error) { } func (c *Consequences) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return c.actions } diff --git a/test/e2e/fixture/notification/context.go b/test/e2e/fixture/notification/context.go index 3bf075ff54ddb..1859e1b378528 100644 --- a/test/e2e/fixture/notification/context.go +++ b/test/e2e/fixture/notification/context.go @@ -2,6 +2,7 @@ package notification import ( "testing" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" ) @@ -23,5 +24,7 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Actions{context: c} } diff --git a/test/e2e/fixture/project/actions.go b/test/e2e/fixture/project/actions.go index 7e2df3b3e7756..1290c0461b57a 100644 --- a/test/e2e/fixture/project/actions.go +++ b/test/e2e/fixture/project/actions.go @@ -3,6 +3,7 @@ package project import ( "context" "strings" + "time" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -112,6 +113,8 @@ func (a *Actions) And(block func()) *Actions { func (a *Actions) Then() *Consequences { a.context.t.Helper() + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/project/consequences.go b/test/e2e/fixture/project/consequences.go index 3abcec5053555..929c38d3d0a5e 100644 --- a/test/e2e/fixture/project/consequences.go +++ b/test/e2e/fixture/project/consequences.go @@ -2,6 +2,7 @@ package project import ( "context" + "time" "github.com/argoproj/argo-cd/v3/pkg/apiclient/project" @@ -43,5 +44,7 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return c.actions } diff --git a/test/e2e/fixture/project/context.go b/test/e2e/fixture/project/context.go index d0f9118a5b603..43dd8715aa83f 100644 --- a/test/e2e/fixture/project/context.go +++ b/test/e2e/fixture/project/context.go @@ -2,6 +2,7 @@ package project import ( "testing" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" "github.com/argoproj/argo-cd/v3/util/env" @@ -68,5 +69,7 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Actions{context: c} } diff --git a/test/e2e/fixture/repos/actions.go b/test/e2e/fixture/repos/actions.go index c573632dfd9b3..38bf1a3bc01e0 100644 --- a/test/e2e/fixture/repos/actions.go +++ b/test/e2e/fixture/repos/actions.go @@ -2,6 +2,7 @@ package repos import ( "log" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" ) @@ -77,6 +78,8 @@ func (a *Actions) Project(project string) *Actions { func (a *Actions) Then() *Consequences { a.context.t.Helper() + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Consequences{a.context, a} } diff --git a/test/e2e/fixture/repos/consequences.go b/test/e2e/fixture/repos/consequences.go index 77658077b46d8..f1be83653eefd 100644 --- a/test/e2e/fixture/repos/consequences.go +++ b/test/e2e/fixture/repos/consequences.go @@ -3,6 +3,7 @@ package repos import ( "context" "errors" + "time" repositorypkg "github.com/argoproj/argo-cd/v3/pkg/apiclient/repository" "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1" @@ -54,5 +55,7 @@ func (c *Consequences) Given() *Context { } func (c *Consequences) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return c.actions } diff --git a/test/e2e/fixture/repos/context.go b/test/e2e/fixture/repos/context.go index bb99f7ef2a450..3f9cca86c3863 100644 --- a/test/e2e/fixture/repos/context.go +++ b/test/e2e/fixture/repos/context.go @@ -2,6 +2,7 @@ package repos import ( "testing" + "time" "github.com/argoproj/argo-cd/v3/test/e2e/fixture" "github.com/argoproj/argo-cd/v3/util/env" @@ -54,6 +55,8 @@ func (c *Context) And(block func()) *Context { } func (c *Context) When() *Actions { + // Account for batch events processing (set to 1ms in e2e tests) + time.Sleep(5 * time.Millisecond) return &Actions{context: c} } From 2287febbab413553f8ac4e7975bba4ddf8fca9bb Mon Sep 17 00:00:00 2001 From: Andrii Korotkov Date: Sat, 15 Mar 2025 09:38:38 -0700 Subject: [PATCH 3/4] Re-run flake Signed-off-by: Andrii Korotkov From 26b25442ad5eb8fa91e73a83e6a523b98fa43fe9 Mon Sep 17 00:00:00 2001 From: Andrii Korotkov Date: Sat, 15 Mar 2025 10:16:21 -0700 Subject: [PATCH 4/4] Fix negated patten matching Signed-off-by: Andrii Korotkov --- .github/workflows/ci-build.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 3a1d773a38e50..95cf5b8768492 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -38,15 +38,13 @@ jobs: # Any file which is not under docs/, ui/ or is not a markdown file is counted as a backend file filters: | backend: - - '!ui/**' - - '!**.md' - - '!**/*.md' - - '!docs/**' + - '!(ui/**|docs/**|**.md|**/*.md)' frontend: - 'ui/**' - - Dockerfile docs: - 'docs/**' + - '**.md' + - '**/*.md' check-go: name: Ensure Go modules synchronicity if: ${{ needs.changes.outputs.backend == 'true' }}