Skip to content

Commit 0c5cc6d

Browse files
authored
Merge branch 'master' into feature/cluster-list-unit-test
2 parents 1fde232 + 7396c1a commit 0c5cc6d

File tree

159 files changed

+19131
-4200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+19131
-4200
lines changed

.github/workflows/ci-build.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,8 @@ jobs:
6565
go mod download
6666
- name: Check for tidiness of go.mod and go.sum
6767
run: |
68-
rm go.work.sum
69-
go work sync
70-
go work vendor
71-
go mod tidy
72-
git diff --exit-code -- .
73-
68+
make workspace-vendor
69+
git diff --exit-code -- . ':!go.work.sum'
7470
build-go:
7571
name: Build & cache Go code
7672
if: ${{ needs.changes.outputs.backend == 'true' }}
@@ -85,7 +81,7 @@ jobs:
8581
with:
8682
go-version: ${{ env.GOLANG_VERSION }}
8783
- name: Restore go build cache
88-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
84+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
8985
with:
9086
path: ~/.cache/go-build
9187
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
@@ -156,7 +152,7 @@ jobs:
156152
run: |
157153
echo "/usr/local/bin" >> $GITHUB_PATH
158154
- name: Restore go build cache
159-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
155+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
160156
with:
161157
path: ~/.cache/go-build
162158
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
@@ -220,7 +216,7 @@ jobs:
220216
run: |
221217
echo "/usr/local/bin" >> $GITHUB_PATH
222218
- name: Restore go build cache
223-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
219+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
224220
with:
225221
path: ~/.cache/go-build
226222
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}
@@ -314,7 +310,7 @@ jobs:
314310
node-version: '22.9.0'
315311
- name: Restore node dependency cache
316312
id: cache-dependencies
317-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
313+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
318314
with:
319315
path: ui/node_modules
320316
key: ${{ runner.os }}-node-dep-v2-${{ hashFiles('**/yarn.lock') }}
@@ -363,7 +359,7 @@ jobs:
363359
fetch-depth: 0
364360
- name: Restore node dependency cache
365361
id: cache-dependencies
366-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
362+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
367363
with:
368364
path: ui/node_modules
369365
key: ${{ runner.os }}-node-dep-v2-${{ hashFiles('**/yarn.lock') }}
@@ -471,7 +467,7 @@ jobs:
471467
sudo chmod go-r $HOME/.kube/config
472468
kubectl version
473469
- name: Restore go build cache
474-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
470+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
475471
with:
476472
path: ~/.cache/go-build
477473
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }}

.github/workflows/image-reuse.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,23 @@ jobs:
103103
echo 'EOF' >> $GITHUB_ENV
104104
105105
- name: Login to Quay.io
106-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
106+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
107107
with:
108108
registry: quay.io
109109
username: ${{ secrets.quay_username }}
110110
password: ${{ secrets.quay_password }}
111111
if: ${{ inputs.quay_image_name && inputs.push }}
112112

113113
- name: Login to GitHub Container Registry
114-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
114+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
115115
with:
116116
registry: ghcr.io
117117
username: ${{ secrets.ghcr_username }}
118118
password: ${{ secrets.ghcr_password }}
119119
if: ${{ inputs.ghcr_image_name && inputs.push }}
120120

121121
- name: Login to dockerhub Container Registry
122-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
122+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
123123
with:
124124
username: ${{ secrets.docker_username }}
125125
password: ${{ secrets.docker_password }}

.github/workflows/renovate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
go-version: 1.25.1
3131

3232
- name: Self-hosted Renovate
33-
uses: renovatebot/github-action@9ba84f1ade243f8c2ce5b223df61cf23dc094584 #43.0.13
33+
uses: renovatebot/github-action@2d941ef4e268e53affdc1f11365c69a73e544f50 #43.0.14
3434
with:
3535
configurationFile: .github/configs/renovate-config.js
3636
token: '${{ steps.get_token.outputs.token }}'

.golangci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ linters:
2222
- govet
2323
- importas
2424
- misspell
25+
- noctx
2526
- perfsprint
2627
- revive
2728
- staticcheck

.mockery.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ packages:
2424
Renderer: {}
2525
github.com/argoproj/argo-cd/v3/commitserver/apiclient:
2626
interfaces:
27-
Clientset: {}
2827
CommitServiceClient: {}
2928
github.com/argoproj/argo-cd/v3/commitserver/commit:
3029
interfaces:
@@ -35,6 +34,7 @@ packages:
3534
github.com/argoproj/argo-cd/v3/controller/hydrator:
3635
interfaces:
3736
Dependencies: {}
37+
RepoGetter: {}
3838
github.com/argoproj/argo-cd/v3/pkg/apiclient/cluster:
3939
interfaces:
4040
ClusterServiceServer: {}

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,14 @@ mod-vendor: test-tools-image
379379
mod-vendor-local: mod-download-local
380380
go work vendor
381381

382+
# Update the go.work.sum file and the vendor folder
383+
.PHONY: workspace-vendor
384+
workspace-vendor:
385+
rm -rf vendor
386+
rm -f go.work.sum
387+
go work vendor
388+
go mod tidy
389+
382390
# Run linter on the code
383391
.PHONY: lint
384392
lint: test-tools-image

Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ ui: sh -c 'cd ui && ${ARGOCD_E2E_YARN_CMD:-yarn} start'
99
git-server: test/fixture/testrepos/start-git.sh
1010
helm-registry: test/fixture/testrepos/start-helm-registry.sh
1111
oci-registry: test/fixture/testrepos/start-authenticated-helm-registry.sh
12-
dev-mounter: [[ "$ARGOCD_E2E_TEST" != "true" ]] && go run hack/dev-mounter/main.go --configmap argocd-ssh-known-hosts-cm=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} --configmap argocd-tls-certs-cm=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} --configmap argocd-gpg-keys-cm=${ARGOCD_GPG_DATA_PATH:-/tmp/argocd-local/gpg/source}
12+
dev-mounter: [ "$ARGOCD_E2E_TEST" != "true" ] && go run hack/dev-mounter/main.go --configmap argocd-ssh-known-hosts-cm=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} --configmap argocd-tls-certs-cm=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} --configmap argocd-gpg-keys-cm=${ARGOCD_GPG_DATA_PATH:-/tmp/argocd-local/gpg/source}
1313
applicationset-controller: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "GOCOVERDIR=${ARGOCD_COVERAGE_DIR:-/tmp/coverage/applicationset-controller} FORCE_LOG_COLORS=4 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_SSH_DATA_PATH=${ARGOCD_SSH_DATA_PATH:-/tmp/argocd-local/ssh} ARGOCD_BINARY_NAME=argocd-applicationset-controller $COMMAND --loglevel debug --metrics-addr localhost:12345 --probe-addr localhost:12346 --argocd-repo-server localhost:${ARGOCD_E2E_REPOSERVER_PORT:-8081}"
1414
notification: [ "$BIN_MODE" = 'true' ] && COMMAND=./dist/argocd || COMMAND='go run ./cmd/main.go' && sh -c "GOCOVERDIR=${ARGOCD_COVERAGE_DIR:-/tmp/coverage/notification} FORCE_LOG_COLORS=4 ARGOCD_FAKE_IN_CLUSTER=true ARGOCD_TLS_DATA_PATH=${ARGOCD_TLS_DATA_PATH:-/tmp/argocd-local/tls} ARGOCD_BINARY_NAME=argocd-notifications $COMMAND --loglevel debug --application-namespaces=${ARGOCD_APPLICATION_NAMESPACES:-''} --self-service-notification-enabled=${ARGOCD_NOTIFICATION_CONTROLLER_SELF_SERVICE_NOTIFICATION_ENABLED:-'false'}"

applicationset/metrics/metrics_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func TestApplicationsetCollector(t *testing.T) {
174174
appsetCollector := newAppsetCollector(utils.NewAppsetLister(client), collectedLabels, filter)
175175

176176
metrics.Registry.MustRegister(appsetCollector)
177-
req, err := http.NewRequest(http.MethodGet, "/metrics", http.NoBody)
177+
req, err := http.NewRequestWithContext(t.Context(), http.MethodGet, "/metrics", http.NoBody)
178178
require.NoError(t, err)
179179
rr := httptest.NewRecorder()
180180
handler := promhttp.HandlerFor(metrics.Registry, promhttp.HandlerOpts{})
@@ -216,7 +216,7 @@ func TestObserveReconcile(t *testing.T) {
216216

217217
appsetMetrics := NewApplicationsetMetrics(utils.NewAppsetLister(client), collectedLabels, filter)
218218

219-
req, err := http.NewRequest(http.MethodGet, "/metrics", http.NoBody)
219+
req, err := http.NewRequestWithContext(t.Context(), http.MethodGet, "/metrics", http.NoBody)
220220
require.NoError(t, err)
221221
rr := httptest.NewRecorder()
222222
handler := promhttp.HandlerFor(metrics.Registry, promhttp.HandlerOpts{})

applicationset/services/github_metrics_test.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ func TestGitHubMetrics_CollectorApproach_Success(t *testing.T) {
9797
),
9898
}
9999

100-
req, _ := http.NewRequest(http.MethodGet, ts.URL+URL, http.NoBody)
100+
ctx := t.Context()
101+
102+
req, _ := http.NewRequestWithContext(ctx, http.MethodGet, ts.URL+URL, http.NoBody)
101103
resp, err := client.Do(req)
102104
if err != nil {
103105
t.Fatalf("unexpected error: %v", err)
@@ -109,7 +111,11 @@ func TestGitHubMetrics_CollectorApproach_Success(t *testing.T) {
109111
server := httptest.NewServer(handler)
110112
defer server.Close()
111113

112-
resp, err = http.Get(server.URL)
114+
req, err = http.NewRequestWithContext(ctx, http.MethodGet, server.URL, http.NoBody)
115+
if err != nil {
116+
t.Fatalf("failed to create request: %v", err)
117+
}
118+
resp, err = http.DefaultClient.Do(req)
113119
if err != nil {
114120
t.Fatalf("failed to scrape metrics: %v", err)
115121
}
@@ -151,15 +157,23 @@ func TestGitHubMetrics_CollectorApproach_NoRateLimitMetricsOnNilResponse(t *test
151157
metrics: metrics,
152158
},
153159
}
160+
ctx := t.Context()
154161

155-
req, _ := http.NewRequest(http.MethodGet, URL, http.NoBody)
162+
req, err := http.NewRequestWithContext(ctx, http.MethodGet, URL, http.NoBody)
163+
if err != nil {
164+
t.Fatalf("failed to create request: %v", err)
165+
}
156166
_, _ = client.Do(req)
157167

158168
handler := promhttp.HandlerFor(reg, promhttp.HandlerOpts{})
159169
server := httptest.NewServer(handler)
160170
defer server.Close()
161171

162-
resp, err := http.Get(server.URL)
172+
req, err = http.NewRequestWithContext(ctx, http.MethodGet, server.URL, http.NoBody)
173+
if err != nil {
174+
t.Fatalf("failed to create request: %v", err)
175+
}
176+
resp, err := http.DefaultClient.Do(req)
163177
if err != nil {
164178
t.Fatalf("failed to scrape metrics: %v", err)
165179
}

applicationset/services/scm_provider/bitbucket_cloud.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (c *ExtendedClient) GetContents(repo *Repository, path string) (bool, error
3030
urlStr += fmt.Sprintf("/repositories/%s/%s/src/%s/%s?format=meta", c.owner, repo.Repository, repo.SHA, path)
3131
body := strings.NewReader("")
3232

33-
req, err := http.NewRequest(http.MethodGet, urlStr, body)
33+
req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, urlStr, body)
3434
if err != nil {
3535
return false, err
3636
}

0 commit comments

Comments
 (0)