Skip to content

Commit 7e06935

Browse files
committed
Merge branch 'main' into feat/kubernetes-nodes-talos-sysctls
Generated files (types, README, schema, cozyrds) are regenerated from the merged values.yaml. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
2 parents 3265892 + 06ca603 commit 7e06935

448 files changed

Lines changed: 32546 additions & 6025 deletions

File tree

Some content is hidden

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

‎.github/workflows/e2e-fork.yaml‎

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ jobs:
6161
# base-repo PR file list — NOT from the presence/absence of an artifact the
6262
# fork's own build controls. Fail-closed if the fork build failed or the
6363
# pr-patch artifact is missing; green-and-stop only for a PR whose file list is
64-
# entirely under docs/ (verified against the base-repo API).
64+
# entirely under docs/ or the CI-only tools cmd/backport-batch/ and
65+
# cmd/api-gate/ (verified against the base-repo API).
6566
resolve:
6667
name: Resolve fork PR
6768
# Only fork PRs: head_repository differs from the base repository. Same-repo
@@ -266,15 +267,21 @@ jobs:
266267
await decide('failure', 'PR file list hit the 3000-file API cap — cannot verify docs-only');
267268
return;
268269
}
270+
// Paths with nothing to build and nothing for e2e to install: docs,
271+
// and the CI-only Go tools no image builds. pull-requests.yaml's
272+
// plan job answers the same question with the same prefixes, and
273+
// hack/gate-concurrency-contract.bats holds the two lists equal.
274+
//
269275
// A rename reports the NEW path in `filename` and the old one in
270276
// `previous_filename`. Checking only `filename` would read a
271277
// packages/… -> docs/… rename as docs-only, when it in fact removes
272-
// a code path. BOTH sides must be under docs/ to count as docs-only.
273-
const isDocs = p => typeof p === 'string' && p.startsWith('docs/');
274-
const hasNonDocs = files.some(f =>
275-
!isDocs(f.filename) || (f.previous_filename && !isDocs(f.previous_filename)));
276-
if (!hasNonDocs) {
277-
await decide('success', 'docs-only PR (verified via PR file list) — e2e not required');
278+
// a code path. BOTH sides must be under these prefixes to count.
279+
const noRuntimePrefixes = ['docs/', 'cmd/backport-batch/', 'cmd/api-gate/'];
280+
const isNoRuntime = p => typeof p === 'string' && noRuntimePrefixes.some(x => p.startsWith(x));
281+
const hasRuntime = files.some(f =>
282+
!isNoRuntime(f.filename) || (f.previous_filename && !isNoRuntime(f.previous_filename)));
283+
if (!hasRuntime) {
284+
await decide('success', 'docs or CI-only tools (verified via PR file list) — e2e not required');
278285
return;
279286
}
280287
@@ -543,7 +550,7 @@ jobs:
543550
# Covers a green full suite. It does not cover a tenant-Kubernetes suite
544551
# running into its node-join deadline, so a red there can end as a
545552
# cancelled job. Held to one figure across every lane that runs the suite.
546-
timeout-minutes: 215
553+
timeout-minutes: 265
547554
permissions:
548555
contents: read
549556
packages: read

‎.github/workflows/e2e-tag.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
# Covers a green full suite. It does not cover a tenant-Kubernetes suite
138138
# running into its node-join deadline, so a red there can end as a
139139
# cancelled job. Held to one figure across every lane that runs the suite.
140-
timeout-minutes: 215
140+
timeout-minutes: 265
141141
permissions:
142142
contents: read
143143
checks: write # Breakpoint action updates its dedicated "Breakpoint Open" Check Run.
@@ -292,7 +292,7 @@ jobs:
292292
# collect-report packages cozyreport plus per-failed-test crust-gather
293293
# snapshots captured before Chainsaw cleanup.
294294
#
295-
# A ceiling of its own, not the job's 215 minutes. `Upload cozyreport.tgz`
295+
# A ceiling of its own, not the job's 265 minutes. `Upload cozyreport.tgz`
296296
# is the next step and the collector writes its tarball at the very end of
297297
# its run, so a read that never returns spends what is left of the job
298298
# budget, the job is cancelled, and the upload never runs -- the artifact

‎.github/workflows/nightly.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ jobs:
250250
# Covers a green full suite. It does not cover a tenant-Kubernetes suite
251251
# running into its node-join deadline, so a red there can end as a
252252
# cancelled job. Held to one figure across every lane that runs the suite.
253-
timeout-minutes: 215
253+
timeout-minutes: 265
254254
permissions:
255255
contents: read
256256
packages: read
@@ -385,7 +385,7 @@ jobs:
385385
path: _out/chainsaw-report.xml
386386
if-no-files-found: ignore
387387

388-
# A ceiling of its own, not the job's 215 minutes. `Upload cozyreport.tgz`
388+
# A ceiling of its own, not the job's 265 minutes. `Upload cozyreport.tgz`
389389
# is the next step and the collector writes its tarball at the very end of
390390
# its run, so a read that never returns spends what is left of the job
391391
# budget, the job is cancelled, and the upload never runs -- the artifact

‎.github/workflows/pull-requests.yaml‎

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ jobs:
7575
statuses: write
7676
outputs:
7777
code: ${{ steps.p.outputs.code }}
78+
docs: ${{ steps.p.outputs.docs }}
79+
backport_batch: ${{ steps.p.outputs.backport_batch }}
7880
matrix: ${{ steps.p.outputs.matrix }}
7981
any: ${{ steps.p.outputs.any }}
8082
touched: ${{ steps.p.outputs.touched }}
@@ -167,11 +169,27 @@ jobs:
167169
# alone here rather than widened by a side effect.
168170
git diff --name-only --no-renames "origin/${BASE_REF}...HEAD" > /tmp/changed_norenames.txt
169171
echo "Changed files:"; sed 's/^/ /' /tmp/changed_norenames.txt
170-
if grep -qvE '^docs/' /tmp/changed_norenames.txt; then
172+
# `code` is false when every path is under docs/ or in a CI-only Go
173+
# tool that no image builds (cmd/backport-batch, cmd/api-gate): there
174+
# is nothing to build and nothing for e2e to install. e2e-fork.yaml
175+
# answers the same question from the PR file list with the same
176+
# prefixes, and hack/gate-concurrency-contract.bats holds the two lists
177+
# equal.
178+
if grep -qvE '^(docs/|cmd/backport-batch/|cmd/api-gate/)' /tmp/changed_norenames.txt; then
171179
echo "code=true" >> "$GITHUB_OUTPUT"
172180
else
173181
echo "code=false" >> "$GITHUB_OUTPUT"
174182
fi
183+
# The Bats contracts read docs, so a docs change runs them even when
184+
# `code` is false; a change confined to the CI-only tools does not.
185+
if grep -qE '^docs/' /tmp/changed_norenames.txt; then
186+
echo "docs=true" >> "$GITHUB_OUTPUT"
187+
else
188+
echo "docs=false" >> "$GITHUB_OUTPUT"
189+
fi
190+
backport_batch="$(hack/backport-batch-tests-needed.sh /tmp/changed_norenames.txt)"
191+
echo "backport-batch tests needed: $backport_batch"
192+
echo "backport_batch=$backport_batch" >> "$GITHUB_OUTPUT"
175193
matrix="$(hack/build-matrix.sh /tmp/changed.txt)"
176194
echo "Build matrix: $matrix"
177195
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
@@ -293,9 +311,11 @@ jobs:
293311
contents: read
294312
needs: ["plan"]
295313
# Unit contracts read both code and documentation. Run this job for every
296-
# non-release PR: code changes take the complete unit path, while docs-only
297-
# changes run the Bats lane that owns those cross-tree contracts. Builds and
298-
# E2E remain gated on `code` below.
314+
# non-release PR: code changes take the complete unit path, docs changes run
315+
# the Bats lane that owns those cross-tree contracts, and the backport-batch
316+
# tests run whenever one of their inputs changed and at no other time. A
317+
# change confined to the CI-only tools runs no other lane. Builds and E2E
318+
# remain gated on `code` below.
299319
if: |
300320
!contains(github.event.pull_request.labels.*.name, 'release')
301321
steps:
@@ -306,29 +326,31 @@ jobs:
306326
# The module cache is restored from the key build-main.yaml writes on
307327
# main, which every PR run can read, so a PR's first run starts warm. The
308328
# download fetches whatever the cache lacks, the whole set on a miss. The
309-
# Go steps are for code changes only: a docs-only run is the Bats lane alone.
329+
# Go steps are for code changes and the backport-batch tests only: a
330+
# docs-only run is the Bats lane alone.
310331
- name: Locate Go module cache
311-
if: needs.plan.outputs.code == 'true'
332+
if: needs.plan.outputs.code == 'true' || needs.plan.outputs.backport_batch == 'true'
312333
id: gomodcache
313334
run: echo "dir=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
314335
- name: Cache Go modules
315-
if: needs.plan.outputs.code == 'true'
336+
if: needs.plan.outputs.code == 'true' || needs.plan.outputs.backport_batch == 'true'
316337
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
317338
with:
318339
path: ${{ steps.gomodcache.outputs.dir }}
319340
key: go-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
320341
restore-keys: go-mod-${{ runner.os }}-
321342
- name: Download Go modules
322-
if: needs.plan.outputs.code == 'true'
343+
if: needs.plan.outputs.code == 'true' || needs.plan.outputs.backport_batch == 'true'
323344
run: |
324345
for mod in $(git ls-files go.mod '*/go.mod' | xargs -n1 dirname); do
325346
(cd "$mod" && "$GITHUB_WORKSPACE/hack/go-mod-download.sh")
326347
done
327348
# Ephemeral runners don't carry the helm-unittest plugin the persistent
328349
# self-hosted runner accreted. The plugin embeds its own Helm, so its
329350
# version is pinned: a plugin release must not change test results. Bats is
330-
# installed on every run, docs-only ones included.
351+
# installed whenever a Bats lane runs, docs-only ones included.
331352
- name: Set up test toolchain
353+
if: needs.plan.outputs.code == 'true' || needs.plan.outputs.docs == 'true'
332354
env:
333355
CODE_CHANGED: ${{ needs.plan.outputs.code }}
334356
HELM_UNITTEST_VERSION: "1.1.2"
@@ -374,8 +396,15 @@ jobs:
374396
if: needs.plan.outputs.code == 'true'
375397
run: make unit-tests test-controllers test-controllers-envtest -j4 -k --output-sync=target
376398
- name: Run Bats unit tests for docs-only changes
377-
if: needs.plan.outputs.code == 'false'
399+
if: needs.plan.outputs.code == 'false' && needs.plan.outputs.docs == 'true'
378400
run: make bats-unit-tests
401+
# Not part of `make unit-tests`: hack/backport-batch-tests-needed.sh
402+
# decides from cmd/backport-batch/test-inputs.txt, whatever `code` is.
403+
# `!cancelled()` for the reason the unit lane runs with -k: a red step
404+
# above must not hide this suite's own result.
405+
- name: Run backport-batch tests
406+
if: ${{ !cancelled() && needs.plan.outputs.backport_batch == 'true' }}
407+
run: make test-backport-batch
379408
- name: Upload unit test report
380409
if: always()
381410
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
@@ -953,7 +982,7 @@ jobs:
953982
# Covers a green full suite. It does not cover a tenant-Kubernetes suite
954983
# running into its node-join deadline, so a red there can end as a
955984
# cancelled job. Held to one figure across every lane that runs the suite.
956-
timeout-minutes: 215
985+
timeout-minutes: 265
957986
permissions:
958987
contents: read
959988
packages: read
@@ -1224,7 +1253,7 @@ jobs:
12241253

12251254
# ▸ Collect debug information (always runs)
12261255
#
1227-
# A ceiling of its own, not the job's 215 minutes. `Upload
1256+
# A ceiling of its own, not the job's 265 minutes. `Upload
12281257
# cozyreport.tgz` is the next step and the collector writes its tarball
12291258
# at the very end of its run, so a read that never returns spends what
12301259
# is left of the job budget, the job is cancelled, and the upload never
@@ -1235,7 +1264,7 @@ jobs:
12351264
# 30 minutes is measured against the step: it takes 3-42s across sampled
12361265
# runs, on failed e2e jobs as well as green ones. It RESERVES nothing --
12371266
# `timeout-minutes` caps a step, it does not carve budget out of the job,
1238-
# so a suite that has already burned 210 of the 215 leaves this step five
1267+
# so a suite that has already burned 260 of the 265 leaves this step five
12391268
# minutes and the upload is cancelled with everything else. What the cap
12401269
# buys is that a hung read cannot be the reason.
12411270
# `continue-on-error` because the ceiling must not change what the job
@@ -1427,7 +1456,7 @@ jobs:
14271456
description = `release packages candidate did not verify (result: ${CANDIDATE_RESULT})`;
14281457
} else if (CODE !== 'true') {
14291458
state = 'success';
1430-
description = 'docs-only PR — e2e not required';
1459+
description = 'docs or CI-only tools — e2e not required';
14311460
} else if (IS_RELEASE === 'true' && IS_FULL_E2E !== 'true') {
14321461
// Release promotion PRs deliberately do not repeat e2e: the rc was
14331462
// already verified against the immutable candidate whose digests

‎Makefile‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ test:
120120
make -C packages/core/testing apply
121121
make -C packages/core/testing e2e
122122

123-
unit-tests: helm-unit-tests bats-unit-tests bats-posix-compat-tests go-unit-tests go-module-tests rd-presets-check test-check-readiness test-backport-batch migrations-target-check
123+
unit-tests: helm-unit-tests bats-unit-tests bats-posix-compat-tests go-unit-tests go-module-tests rd-presets-check test-check-readiness migrations-target-check
124124

125125
helm-unit-tests:
126126
hack/helm-unit-tests.sh
@@ -139,13 +139,14 @@ rd-presets-check:
139139
migrations-target-check:
140140
hack/check-migrations-target.sh
141141

142-
# Scoped go test over the cozystack-api surface that this repo owns. Kept
143-
# narrow intentionally - running `go test ./...` pulls in generated code
144-
# round-trip suites whose behavior depends on tool versions outside this
145-
# repo's control (kubebuilder, openapi-gen, etc.) and is better exercised
146-
# from their generator workflows.
142+
# Go tests of the cozystack-api surface and of the standalone packages and
143+
# commands listed here, whose tests need no cluster. Kept narrow
144+
# intentionally - running `go test ./...` pulls in generated code round-trip
145+
# suites whose behavior depends on tool versions outside this repo's control
146+
# (kubebuilder, openapi-gen, etc.) and is better exercised from their
147+
# generator workflows.
147148
go-unit-tests:
148-
go test ./pkg/registry/... ./pkg/config/... ./pkg/cmd/server/...
149+
go test ./pkg/registry/... ./pkg/config/... ./pkg/cmd/server/... ./pkg/lineage/... ./pkg/ovnstatus/... ./pkg/reservation/... ./cmd/cozypkg/... ./cmd/check-readiness/...
149150

150151
# The nested Go modules (image sources and the published API types) are
151152
# outside ./... of the root module, so no other target reaches their tests.
@@ -158,9 +159,7 @@ go-module-tests:
158159
done
159160

160161
# Go tests for the controllers and supporting packages under ./internal.
161-
# Excludes ./pkg/... and ./cmd/... — those are run separately by
162-
# go-unit-tests above (pkg subset) and skipped (cmd) until their tests
163-
# stabilise. CI schedules this target in the same four-slot make invocation as
162+
# CI schedules this target in the same four-slot make invocation as
164163
# unit-tests; locally invoke it directly or chain the two targets.
165164
test-controllers:
166165
go test ./internal/... -count=1
@@ -195,7 +194,10 @@ test-controllers-envtest: $(SETUP_ENVTEST)
195194
test-check-readiness:
196195
go test ./test/check-readiness/ -count=1
197196

198-
# ./cmd/... is excluded from go-unit-tests, so the batch tool needs its own target.
197+
# The batch tool's suite drives real git repositories for minutes, so it is
198+
# kept out of go-unit-tests in a target of its own. It is not a prerequisite
199+
# of unit-tests: the checks job in pull-requests.yaml runs it only when the
200+
# diff touches a path listed in cmd/backport-batch/test-inputs.txt.
199201
test-backport-batch:
200202
go test ./cmd/backport-batch/... -count=1
201203

‎api/apps/v1alpha1/bucket/types.go‎

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)