bump crossplane-runtime and crossplane/apis to v2.3.3#664
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR migrates Crossplane common API imports and symbols to github.com/crossplane/crossplane/apis/v2/core/v2 across controllers, resources, tests, codegen constants, CI workflow, and upgrade docs. ChangesCommon API Package Migration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pkg/pipeline/hooks_test.go (1)
167-178:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winMigration looks half-applied in this fixture — import moved, but the embedded type names didn't. 🧐
The import on Line 167 now points to
github.com/crossplane/crossplane/apis/v2/core/v2, but Lines 171 and 176 still embedv1.ResourceSpec/v1.ResourceStatus, which were renamed toClusterManagedResourceSpec/ManagedResourceStatusat the consolidated path. SincebaseContentis only a string fixture for marker manipulation (not compiled), the tests still pass — so no functional breakage here. That said, given thecrd_types.go.tmpltemplate now emits the renamed types, updating the fixture keeps it faithful to real generated output and avoids confusing the next maintainer. Was leaving the old names here intentional?📝 Suggested fixture alignment
type MemberSpec struct { - v1.ResourceSpec ` + "`json:\",inline\"`" + ` + v1.ClusterManagedResourceSpec ` + "`json:\",inline\"`" + ` ForProvider MemberParameters ` + "`json:\"forProvider\"`" + ` } type MemberStatus struct { - v1.ResourceStatus ` + "`json:\",inline\"`" + ` + v1.ManagedResourceStatus ` + "`json:\",inline\"`" + ` AtProvider MemberObservation ` + "`json:\"atProvider,omitempty\"`" + ` }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/pipeline/hooks_test.go` around lines 167 - 178, The fixture import was updated to github.com/crossplane/crossplane/apis/v2/core/v2 but the embedded types in MemberSpec and MemberStatus still reference v1.ResourceSpec and v1.ResourceStatus; update those embeddings to the consolidated names ClusterManagedResourceSpec and ManagedResourceStatus respectively (e.g., replace v1.ResourceSpec with ClusterManagedResourceSpec and v1.ResourceStatus with ManagedResourceStatus in the MemberSpec and MemberStatus structs) so the test fixture matches the output produced by crd_types.go.tmpl.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/types/reference.go`:
- Around line 22-29: The doc comments above the constants
PackagePathXPCommonAPIs and PackagePathXPV2CommonAPIs are stale/misleading (they
say “Crossplane Runtime package” vs actual target) — update both comments to
describe that they point to the Crossplane core APIs package (e.g., “Crossplane
core APIs”) and optionally note that types like Reference, Selector,
SecretKeySelector, SecretReference, LocalSecretReference,
LocalSecretKeySelector, NamespacedReference, and NamespacedSelector are exported
from github.com/crossplane/crossplane/apis/v2/core/v2 so the consolidation is
safe; change only the comment text near PackagePathXPCommonAPIs and
PackagePathXPV2CommonAPIs without modifying the constant values or other code.
---
Outside diff comments:
In `@pkg/pipeline/hooks_test.go`:
- Around line 167-178: The fixture import was updated to
github.com/crossplane/crossplane/apis/v2/core/v2 but the embedded types in
MemberSpec and MemberStatus still reference v1.ResourceSpec and
v1.ResourceStatus; update those embeddings to the consolidated names
ClusterManagedResourceSpec and ManagedResourceStatus respectively (e.g., replace
v1.ResourceSpec with ClusterManagedResourceSpec and v1.ResourceStatus with
ManagedResourceStatus in the MemberSpec and MemberStatus structs) so the test
fixture matches the output produced by crd_types.go.tmpl.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a1dd9105-d8ff-4e29-a6ae-70adbb07c1d0
⛔ Files ignored due to path filters (4)
go.modis excluded by none and included by nonego.sumis excluded by!**/*.sumand included by nonepkg/pipeline/templates/crd_types.go.tmplis excluded by none and included by nonepkg/resource/fake/mocks/mock.gois excluded by!**/fake/**and included by**/*.go
📒 Files selected for processing (17)
pkg/config/resource.gopkg/controller/api.gopkg/controller/external.gopkg/controller/external_async_tfpluginfw.gopkg/controller/external_async_tfpluginsdk.gopkg/controller/external_test.gopkg/controller/external_tfpluginfw.gopkg/controller/external_tfpluginsdk.gopkg/pipeline/hooks_test.gopkg/resource/conditions.gopkg/resource/sensitive.gopkg/resource/sensitive_test.gopkg/terraform/files.gopkg/terraform/files_test.gopkg/types/builder_test.gopkg/types/reference.gotests/conversion/test_resource.go
| env: | ||
| # Common versions | ||
| GO_VERSION: "1.25.8" | ||
| GO_VERSION: "1.25.10" |
There was a problem hiding this comment.
Out of the scope of this PR, but we can use go-version-file: go.mod in the setup-go action to avoid this coupling.
| "github.com/crossplane/crossplane-runtime/v2/pkg/logging" | ||
| "github.com/crossplane/crossplane-runtime/v2/pkg/reconciler/managed" | ||
| xpresource "github.com/crossplane/crossplane-runtime/v2/pkg/resource" | ||
| xpv1 "github.com/crossplane/crossplane/apis/v2/core/v2" |
There was a problem hiding this comment.
xpv2? It sounds weird to have this renamed to xpv1
The common APIs were relocated to a v2 package, so the xpv1 alias no longer reflects the import path. Standardise on xpv2 across all hand-written files; also unify the lone v1 alias in sensitive.go onto the same name. mockgen-generated fake still uses its default basename alias (v2) since it is regenerated. Addresses review feedback on crossplane#664.
Removes the env-var coupling so the workflow's Go version follows whatever go.mod declares. Addresses review feedback on crossplane#664.
The common APIs were relocated to a v2 package, so the xpv1 alias no longer reflects the import path. Standardise on xpv2 across all hand-written files; also unify the lone v1 alias in sensitive.go onto the same name. mockgen-generated fake still uses its default basename alias (v2) since it is regenerated. Addresses review feedback on crossplane#664. Signed-off-by: JP Schoombee <jpschoombee@gmail.com>
Removes the env-var coupling so the workflow's Go version follows whatever go.mod declares. Addresses review feedback on crossplane#664. Signed-off-by: JP Schoombee <jpschoombee@gmail.com>
eb242fc to
7aa83b7
Compare
|
Thanks @fernandezcuesta — both addressed:
Fork CI green. |
….3.x
crossplane-runtime v2.3.0 moved the common APIs (formerly
crossplane-runtime/v2/apis/common/{v1,v2} and the unversioned apis/common
mock surface) into a single consolidated package at
github.com/crossplane/crossplane/apis/v2/core/v2, and renamed the
inline-embedded spec/status types:
- v1.ResourceSpec → v2.ClusterManagedResourceSpec (cluster-scoped)
→ v2.ManagedResourceSpec (namespaced; existing)
- v1.ResourceStatus → v2.ManagedResourceStatus
- v1/v2 SecretReference, SecretKeySelector, Reference, Selector, Condition,
ManagementAction*, ManagementPolicies, DeletionPolicy, etc. — same names,
new package path.
Migration in this commit:
- Bulk-swap every Go import of the three removed paths to the consolidated
path across pkg/, tests/, and the GoMock fake (apis/common at root).
- Refresh the embedded type-string fixtures in pkg/types/builder_test.go
to match the new fully-qualified path.
- Update pkg/types/reference.go PackagePath* constants so generated CRD
types reference the new package (both XPCommonAPIs and XPV2CommonAPIs
now point at the same consolidated package, kept as separate constants
for source-level backward compatibility).
- Update pkg/pipeline/templates/crd_types.go.tmpl to emit
ClusterManagedResourceSpec for cluster-scoped MRs and
ManagedResourceStatus for the embedded status — both required by the
consolidated v2 API.
- Hand-edit tests/conversion/test_resource.go ResourceSpec/Status
references to use the new cluster-scoped type names.
- go.mod: bump crossplane-runtime/v2 v2.2.0 → v2.3.1, add direct require
on crossplane/apis/v2 v2.3.1; go mod tidy.
Unblocks providers (e.g. provider-wiz) that consume upjet and want to
adopt crossplane-runtime v2.3.x.
Signed-off-by: JP Schoombee <jpschoombee@gmail.com>
The common APIs were relocated to a v2 package, so the xpv1 alias no longer reflects the import path. Standardise on xpv2 across all hand-written files; also unify the lone v1 alias in sensitive.go onto the same name. mockgen-generated fake still uses its default basename alias (v2) since it is regenerated. Addresses review feedback on crossplane#664. Signed-off-by: JP Schoombee <jpschoombee@gmail.com>
7aa83b7 to
2b10525
Compare
Removes the env-var coupling so the workflow's Go version follows whatever go.mod declares. Addresses review feedback on crossplane#664. Signed-off-by: JP Schoombee <jpschoombee@gmail.com>
09f1f25 to
bc24ab9
Compare
Signed-off-by: JP Schoombee <jpschoombee@gmail.com>
… in test fixtures Signed-off-by: JP Schoombee <jpschoombee@gmail.com>
… package name in type builder Signed-off-by: JP Schoombee <jpschoombee@gmail.com>
The common APIs were relocated to a v2 package, so the xpv1 alias no longer reflects the import path. Standardise on xpv2 across all hand-written files; also unify the lone v1 alias in sensitive.go onto the same name. mockgen-generated fake still uses its default basename alias (v2) since it is regenerated. Addresses review feedback on crossplane#664. Signed-off-by: JP Schoombee <jpschoombee@gmail.com>
Removes the env-var coupling so the workflow's Go version follows whatever go.mod declares. Addresses review feedback on crossplane#664. Signed-off-by: JP Schoombee <jpschoombee@gmail.com>
bc24ab9 to
10c27c6
Compare
The Grafana TF provider v4.39.x pulls in the k8s.io v0.36 stack (via grafana-app-sdk and grafana/apps/provisioning). client-go v0.36 added HasSyncedChecker() to cache.ResourceEventHandlerRegistration, which the controller-runtime v0.22 pinned by crossplane-runtime v2.1.x does not implement, breaking codegen. The k8s.io modules are a co-versioned set and cannot straddle v0.35/v0.36 individually, so pin the whole stack (api, apimachinery, apiserver, apiextensions-apiserver, client-go, code-generator, component-base) back to v0.35.3 as a matched set until controller-runtime v0.24 lands via crossplane-runtime (crossplane/crossplane-runtime#1037) and upjet adopts it (crossplane/upjet#664). Includes regenerated code from 'make generate' for the v4.39.1 schema. Refs #601
## Resolution The `make generate` failure was caused by `terraform-provider-grafana` v4.39.x pulling in the **k8s.io v0.36** stack while crossplane-runtime v2.1.x still pins **controller-runtime v0.22** (which does not implement client-go v0.36's `HasSyncedChecker()` on `cache.ResourceEventHandlerRegistration`). As a temporary workaround, this PR pins the whole k8s.io stack back to v0.35.3 via `replace` directives (they're a co-versioned set and can't straddle v0.35/v0.36 individually). `make submodules && make generate` now completes and the regenerated code is committed. - Removal of the `replace` block is tracked in #622 (blocked on controller-runtime v0.24 upstream: crossplane/crossplane-runtime#1037 + crossplane/upjet#664). Closes #601 --- ## Automated dependency update Updates `terraform-provider-grafana` to v4.39.1. **Release**: https://github.com/grafana/terraform-provider-grafana/releases/tag/v4.39.1 ### Changelog ### Bug Fixes - **appplatform:** retry transient referential-integrity and server errors ([#2838](grafana/terraform-provider-grafana#2838)) by @rknightion - **appplatform:** exponential backoff for retries via k8s wait.Backoff ([#2844](grafana/terraform-provider-grafana#2844)) by @MissingRoberto - **asserts:** omit empty match values for null-check operators ([#2854](grafana/terraform-provider-grafana#2854)) by @vpadi - **deps:** update module github.com/prometheus/common to v0.69.0 ([#2827](grafana/terraform-provider-grafana#2827)) by @renovate-sh-app[bot] ### CI/CD - **workflows:** add workflow for validation of unpublished builds ([#2780](grafana/terraform-provider-grafana#2780)) by @suntala - **workflows:** align validate-unpublished-provider with field-eng ([#2845](grafana/terraform-provider-grafana#2845)) by @suntala - **workflows:** poll cloud acceptance gate until tests finish ([#2855](grafana/terraform-provider-grafana#2855)) by @suntala ### Documentation - clarify provider config for git sync App Platform resources ([#2843](grafana/terraform-provider-grafana#2843)) by @MissingRoberto ### Miscellaneous - **cloud:** move to new stacks connections endpoint ([#2840](grafana/terraform-provider-grafana#2840)) by @nachogiljaldo **Full Changelog**: [v4.39.0...v4.39.1](grafana/terraform-provider-grafana@v4.39.0...v4.39.1) --- *This PR was automatically created by the [update-terraform-provider](https://github.com/grafana/crossplane-provider-grafana/actions/workflows/update-terraform-provider.yaml) workflow.* --------- Co-authored-by: terraform-provider-grafana[bot] <220933401+terraform-provider-grafana[bot]@users.noreply.github.com> Co-authored-by: Duologic <jeroen@simplistic.be>
Description of your changes
This PR adopts crossplane-runtime v2.3.x in upjet/v2, pinned to the latest patch v2.3.3 (along with
crossplane/apis/v2 v2.3.3).The v2.3.0 release relocated the common APIs out of
crossplane-runtimeinto the consolidatedgithub.com/crossplane/crossplane/apis/v2/core/v2package and renamed the inline-embedded spec/status types. Today upjet still imports the removed paths, so any downstream provider that wants to pick up v2.3.x is blocked.API compatibility
The two renamed embeds are structurally identical to the originals — same fields, same JSON tags, same kubebuilder defaults:
ResourceSpec(cluster-scoped MRs)ClusterManagedResourceSpecResourceStatusManagedResourceStatusAll other common symbols (
Reference,Selector,SecretReference,SecretKeySelector,LocalSecretReference,LocalSecretKeySelector,NamespacedReference,NamespacedSelector,Condition*,ManagementAction*,ManagementPolicies,DeletionPolicy, …) keep their names — only the import path changes. So providers that regenerate after this lands see no CRD schema drift.Migration applied
pkg/config,pkg/controller,pkg/resource,pkg/terraform,pkg/types,pkg/pipeline,tests/conversion, plus the GoMock fake atpkg/resource/fake/mocks/mock.go): swap the three retired package paths (apis/common,apis/common/v1,apis/common/v2) forgithub.com/crossplane/crossplane/apis/v2/core/v2.gcire-ordered into the project's import sections.pkg/types/reference.go: bothPackagePathXPCommonAPIsandPackagePathXPV2CommonAPIsnow resolve to the consolidated path. They're kept as two constants for source-level backward compatibility — typewriter'sUsePackagededupes by path so emitted imports collapse to a single alias. Thetypes.NewPackagepackage-name argument corrected from"v1"to"v2"to match the real package declaration.pkg/pipeline/templates/crd_types.go.tmpl:ResourceSpec→ClusterManagedResourceSpecfor cluster-scoped CRDs.ResourceStatus→ManagedResourceStatusfor the embedded status (both scopes).pkg/types/builder_test.gorefreshed to match the new fully-qualified path.tests/conversion/test_resource.gofield embeds renamed toClusterManagedResourceSpec/ManagedResourceStatus.pkg/pipeline/hooks_test.gogolden fixture aligned with the updatedcrd_types.go.tmploutput..github/workflows/ci.yml: switched all jobs from a pinnedGO_VERSIONenv var togo-version-file: go.mod(including therace-testsjob which was missed in the initial commit and caused aGOTOOLCHAIN=localfailure against the runner's Go 1.24). The minimum Go floor is now1.25.11(set by crossplane-runtime v2.3.3 viago mod tidy).go.mod:crossplane-runtime/v2 v2.2.0→v2.3.3; new direct require oncrossplane/apis/v2 v2.3.3;go mod tidy.docs/upjet-v2-upgrade.md: new "v2.3 common-API migration" subsection with corrected prerequisite ordering (step 1go mod tidymust succeed before step 2make generate), plus a scope note on the existingapissection to prevent readers migrating from v2→v2.3 from copying the v1-era import paths below it.Fixes #663
I have:
go vet ./...,gci writewith the repo's section config,go generate ./...(no diff), andgo test ./... -count=1(all packages green, includingtests/conversion/TestConversionIntegrationwhich exercises the codegen template end-to-end).workflow_dispatchofci.ymlon the fork's branch —lint,unit-tests,check-diff, andrace-testsall pass.backport release-x.ylabels — intentionally not requesting a backport:release-2.2is pinned to a pseudo-version ofcrossplane-runtime/v2(pre-v2.2.0) and Go 1.24.13, so pulling v2.3 onto that maintenance line would defeat the point of the line. Forward-only.How has this code been tested
go build ./...clean.go test ./... -count=1clean across all 23 packages.tests/conversion/TestConversionIntegrationexercises the codegen pipeline end-to-end against a test provider and asserts roundtrip conversions across versions, covering the updatedcrd_types.go.tmpland new package path constants.workflow_dispatch): lint, unit-tests, check-diff, and race-tests all green.