Conversation
There was a problem hiding this comment.
Pull request overview
Adds a documented compatibility/support matrix and a GitHub Actions workflow to continuously validate this framework against multiple controller-runtime / Kubernetes dependency combinations, and links that information from the README.
Changes:
- Add
docs/compatibility.mddescribing supported versions, version policy, and how compatibility is tested. - Add a scheduled/on-demand
.github/workflows/compatibility.ymlmatrix job to swap dependencies and run build/tests. - Update
README.mdto reference the compatibility matrix and to mentiontestifyas part of the testing stack.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| docs/compatibility.md | Introduces the compatibility policy, matrix, and user guidance for pinning versions. |
| README.md | Links to the new compatibility doc and updates stated requirements/testing tools. |
| .github/workflows/compatibility.yml | Adds a CI workflow to exercise multiple dependency combinations. |
docs/compatibility.md
Outdated
| The [compatibility workflow](../.github/workflows/compatibility.yml) runs weekly and on demand. For each version | ||
| combination in the matrix, it: | ||
|
|
||
| 1. Swaps the `controller-runtime` and `k8s.io/*` dependencies to the target versions using `go get`. | ||
| 2. Runs `go mod tidy` to resolve transitive dependencies. | ||
| 3. Verifies that the entire module compiles (`go build ./...`). | ||
| 4. Builds all examples (`make build-examples`). | ||
| 5. Runs the full unit and envtest test suite (`make test`). | ||
|
|
There was a problem hiding this comment.
This section says the compatibility workflow runs "weekly and on demand" and that for each matrix entry it swaps dependencies and runs go mod tidy. The workflow is also triggered on PR label events, and it skips the swap/tidy step for the current (go.mod) matrix entry, so the description is currently incomplete/inaccurate. Update the text/bullets to reflect the PR label trigger and the special-case for the current entry.
| The [compatibility workflow](../.github/workflows/compatibility.yml) runs weekly and on demand. For each version | |
| combination in the matrix, it: | |
| 1. Swaps the `controller-runtime` and `k8s.io/*` dependencies to the target versions using `go get`. | |
| 2. Runs `go mod tidy` to resolve transitive dependencies. | |
| 3. Verifies that the entire module compiles (`go build ./...`). | |
| 4. Builds all examples (`make build-examples`). | |
| 5. Runs the full unit and envtest test suite (`make test`). | |
| The [compatibility workflow](../.github/workflows/compatibility.yml) runs weekly, on demand, and on pull request label | |
| events. For each version combination in the matrix, it: | |
| 1. For matrix entries that differ from the versions in `go.mod`, swaps the `controller-runtime` and `k8s.io/*` | |
| dependencies to the target versions using `go get`. | |
| 2. For those non-`go.mod` entries, runs `go mod tidy` to resolve transitive dependencies. | |
| 3. Verifies that the entire module compiles (`go build ./...`). | |
| 4. Builds all examples (`make build-examples`). | |
| 5. Runs the full unit and envtest test suite (`make test`). | |
| The entry that matches the versions in `go.mod` reuses the existing dependency graph and skips the swap and tidy steps. |
| if: >- | ||
| github.event_name != 'pull_request' || | ||
| github.event.label.name == 'compatibility' | ||
| name: "CR v${{ matrix.controller-runtime }} / k8s v${{ matrix.k8s }}" |
There was a problem hiding this comment.
Matrix keys containing hyphens (e.g., controller-runtime) can't be accessed via dot-notation in GitHub Actions expressions. matrix.controller-runtime will be parsed incorrectly and the workflow will fail. Rename the matrix key(s) (e.g., controller_runtime) or use bracket notation like matrix['controller-runtime'].
| name: "CR v${{ matrix.controller-runtime }} / k8s v${{ matrix.k8s }}" | |
| name: "CR v${{ matrix['controller-runtime'] }} / k8s v${{ matrix.k8s }}" |
| sigs.k8s.io/controller-runtime@${{ matrix.cr-version }} \ | ||
| k8s.io/api@${{ matrix.k8s-version }} \ | ||
| k8s.io/apimachinery@${{ matrix.k8s-version }} \ | ||
| k8s.io/client-go@${{ matrix.k8s-version }} \ | ||
| k8s.io/apiextensions-apiserver@${{ matrix.k8s-version }} |
There was a problem hiding this comment.
These expressions reference hyphenated matrix keys (cr-version, k8s-version) using dot-notation (e.g., matrix.cr-version), which will not evaluate correctly in GitHub Actions. Rename the keys (e.g., cr_version, k8s_version) or switch to bracket notation (matrix['cr-version'], matrix['k8s-version']) for all usages in this step.
| sigs.k8s.io/controller-runtime@${{ matrix.cr-version }} \ | |
| k8s.io/api@${{ matrix.k8s-version }} \ | |
| k8s.io/apimachinery@${{ matrix.k8s-version }} \ | |
| k8s.io/client-go@${{ matrix.k8s-version }} \ | |
| k8s.io/apiextensions-apiserver@${{ matrix.k8s-version }} | |
| sigs.k8s.io/controller-runtime@${{ matrix['cr-version'] }} \ | |
| k8s.io/api@${{ matrix['k8s-version'] }} \ | |
| k8s.io/apimachinery@${{ matrix['k8s-version'] }} \ | |
| k8s.io/client-go@${{ matrix['k8s-version'] }} \ | |
| k8s.io/apiextensions-apiserver@${{ matrix['k8s-version'] }} |
No description provided.