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.
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. |
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
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>
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>
10c27c6 to
afe599f
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>
….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>
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>
afe599f to
6e54b16
Compare
|
Hi @jschoombee thank you for opening this PR! I've pushed a commit to rebase your branch against main as we've had some changes and go.mod was stale. |
|
Runbook for taking a generic upjet v2 provider to
TL;DREverything, in order, from the provider root: # --- 1. modules: one resolution pass -----------------------------------------
go get github.com/crossplane/crossplane-runtime/v2@v2.3.3 \
github.com/crossplane/crossplane/apis/v2@v2.3.3 \
github.com/crossplane/crossplane-tools@v0.0.0-20260715161912-60e57f817ad1
# --- 2. the rewriter ---------------------------------------------------------
cat > /tmp/rewrite.sh <<'SH'
#!/usr/bin/env bash
# rewrite.sh <alias> <file>...
set -euo pipefail
NEW='github.com/crossplane/crossplane/apis/v2/core/v2'
OLD1='github.com/crossplane/crossplane-runtime/v2/apis/common/v1'
OLD2='github.com/crossplane/crossplane-runtime/v2/apis/common/v2'
A="$1"; shift
# GNU sed wants -i, BSD/macOS sed wants -i ''
if sed --version >/dev/null 2>&1; then INPLACE=(-i); else INPLACE=(-i ''); fi
# Addresses use \|...|d, not /.../d: the import paths contain slashes.
sed -E "${INPLACE[@]}" \
-e "s|^([[:space:]]+)\"${OLD1}\"$|\1\"${NEW}\"|" \
-e "s|^([[:space:]]+)[A-Za-z0-9_]+ \"${OLD1}\"$|\1${A} \"${NEW}\"|" \
-e "s|^import [A-Za-z0-9_]+ \"${OLD1}\"$|import ${A} \"${NEW}\"|" \
-e "\\|^[[:space:]]+([A-Za-z0-9_]+ )?\"${OLD2}\"$|d" \
-e "\\|^import ([A-Za-z0-9_]+ )?\"${OLD2}\"$|d" \
-e "s|([^[:alnum:]_])(xp)?v1\.ResourceSpec|\1${A}.ClusterManagedResourceSpec|g" \
-e "s|([^[:alnum:]_])(xp)?v1\.ResourceStatus|\1${A}.ManagedResourceStatus|g" \
-e "s|([^[:alnum:]_])(in\|out)\.ResourceSpec([^[:alnum:]_])|\1\2.ClusterManagedResourceSpec\3|g" \
-e "s|([^[:alnum:]_])(in\|out)\.ResourceStatus([^[:alnum:]_])|\1\2.ManagedResourceStatus\3|g" \
-e "s|([^[:alnum:]_])(xp)?v[12]\.ResourceCredentialsSecret|\1${A}.CredentialsSecret|g" \
-e "s|([^[:alnum:]_])(xp)?v1\.|\1${A}.|g" \
-e "s|([^[:alnum:]_])(xp)?v2\.|\1${A}.|g" \
"$@"
SH
chmod +x /tmp/rewrite.sh
# --- 3. rewrite: one pass per generator, then reformat -----------------------
SRC="apis internal cmd config"
find $SRC -type f \( -name 'zz_*_types.go' -o -name 'zz_generated.deepcopy.go' \) \
-exec /tmp/rewrite.sh v2 {} +
find $SRC -type f \( -name 'zz_generated.managed.go' -o -name 'zz_generated.managedlist.go' \
-o -name 'zz_generated.pc.go' -o -name 'zz_generated.pcu.go' \
-o -name 'zz_generated.pculist.go' -o -name 'zz_generated.resolvers.go' \) \
-exec /tmp/rewrite.sh xpv2 {} +
find $SRC -type f -name '*.go' ! -name 'zz_*' -exec /tmp/rewrite.sh xpv2 {} +
gofmt -l -w $SRC
# --- 4. must be 0 before continuing ------------------------------------------
grep -rl 'crossplane-runtime/v2/apis/common' --include='*.go' $SRC | wc -l
# --- 5. canonical regeneration -------------
go mod tidy
make generate
go mod tidyrunbookConfirmed (module cache, The ordering constraint that shapes everything below: So the sequence is: edit EnvironmentValidated against:
go.mod changes
Do it in one go get github.com/crossplane/crossplane-runtime/v2@v2.3.3 \
github.com/crossplane/crossplane/apis/v2@v2.3.3 \
github.com/crossplane/crossplane-tools@v0.0.0-20260715161912-60e57f817ad1
Caution The Confirmed (source, RuntimeAlias = "xpv1"
RuntimeImport = "github.com/crossplane/crossplane-runtime/v2/apis/common/v1"
RuntimeV2Alias = "xpv2"
RuntimeV2Import = "github.com/crossplane/crossplane/apis/v2/core/v2"Verify whatever pin you pick: grep -rn 'RuntimeV2Import' "$(go env GOMODCACHE)"/github.com/crossplane/crossplane-tools@*/cmd/angryjet/main.goSymbol mappingImport path changes only, names unchanged: Actually renamed:
Deleted outright: Confirmed (field-by-field diff of both packages in the module cache): Important The entire OLD="$(go env GOMODCACHE)/github.com/crossplane/crossplane-runtime/v2@v2.2.1/apis/common"
NEW="$(go env GOMODCACHE)/github.com/crossplane/crossplane/apis/v2@v2.3.3/core/v2"
diff <(grep -rhoE '^(type [A-Za-z0-9_]+| [A-Z][A-Za-z0-9_]+ =)' "$OLD" | sort -u) \
<(grep -rhoE '^(type [A-Za-z0-9_]+| [A-Z][A-Za-z0-9_]+ =)' "$NEW" | sort -u)Renaming an embed also renames the fieldAn embedded field's name is its type name, so in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) // before
in.ClusterManagedResourceSpec.DeepCopyInto(&out.ClusterManagedResourceSpec) // afterThese are unqualified identifiers. A rewrite that only touches import qualifiers compiles everything else and then fails here — this is the single easiest thing to miss. Which alias goes in which fileMatch what each generator emits, or the next
Confirmed (source, Six import shapes exist in practice, and a rewrite must handle all of them: v1 "…/apis/common/v1" // block, aliased
xpv1 "…/apis/common/v1" // block, aliased
"…/apis/common/v1" // block, UNALIASED (controller-gen) — qualifier is still v1.
v2 "…/apis/common/v2" // block, aliased
xpv2 "…/apis/common/v2" // block, aliased
import xpv1 "…/apis/common/v1" // single-line, no block (angryjet)Inventory and pre-flight guardsScope every search to the source dirs. At the repo root, recursive search descends into SRC="apis internal cmd config"
# how big is this job
grep -rl 'crossplane-runtime/v2/apis/common' --include='*.go' $SRC | wc -l
# breakdown by generator, so you know which alias each group needs
grep -rl 'crossplane-runtime/v2/apis/common' --include='*.go' $SRC \
| sed 's|.*/||' | sort | uniq -c | sort -rn
# every distinct import shape actually present
grep -rh 'apis/common' --include='*.go' $SRC | sort | uniq -c
# hand-written files, which need review rather than bulk rewriting
grep -rl 'crossplane-runtime/v2/apis/common' --include='*.go' $SRC | grep -v '/zz_'The rewrite deletes the # MUST print nothing — files importing common/v2 but not common/v1
grep -rl 'apis/common/v2"' --include='*.go' $SRC | xargs grep -L 'apis/common/v1"'
# MUST print nothing — unaliased imports outside deepcopy, where target alias != package name
grep -rlE '^[[:space:]]+"github.com/crossplane/crossplane-runtime/v2/apis/common/v1"$' \
--include='*.go' $SRC | grep -v 'zz_generated.deepcopy.go'
# the unversioned apis/common package (mock surfaces) also vanished in v2.3 — check for it
grep -rn 'apis/common"' --include='*.go' $SRCIf the second command prints files, an unaliased import in a group whose target alias is not The rewrite
|
jonasz-lasut
left a comment
There was a problem hiding this comment.
LGTM thank you @jschoombee for the contribution!
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> (cherry picked from commit 6e54b16)
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 consolidatedmygithub.libinneed.workers.dev/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) formygithub.libinneed.workers.dev/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.