Skip to content

render: Sync render.proto with c/c and wire XRD through#74

Merged
adamwg merged 2 commits into
crossplane:mainfrom
jcogilvie:jco/sync-render-proto-xrd
Jun 4, 2026
Merged

render: Sync render.proto with c/c and wire XRD through#74
adamwg merged 2 commits into
crossplane:mainfrom
jcogilvie:jco/sync-render-proto-xrd

Conversation

@jcogilvie

@jcogilvie jcogilvie commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Description of your changes

Two commits:

  1. proto: Sync render.proto with crossplane/crossplane main — adds composite_resource_definition (field 8) to CompositeInput, matching the upstream proto, and regenerates render.pb.go via ./nix.sh run .#generate (Nix-pinned protoc-gen-go v1.36.10). The cli's option go_package intentionally still points at github.com/crossplane/cli/v2/proto/render/v1alpha1; after that one line the proto file is byte-identical to upstream main.

  2. render: wire CompositionInputs.XRD through to the proto — adds an XRD *unstructured.Unstructured field to CompositionInputs and threads it through BuildCompositeRequest to the proto's CompositeResourceDefinition. When the caller leaves XRD nil, behavior is unchanged: the field stays unset and the render binary keeps its Schema=Modern fallback. This mirrors the Go-level change in crossplane/crossplane/cmd/crossplane/render so the cli's CompositionInputs stays in sync with what the binary now consumes.

Picking up an XRD from disk / the --extra-resources flag and populating CompositionInputs.XRD at the call sites (e.g. cmd/crossplane/render/xr/cmd.go) is intentionally out of scope here — that's a separate UX-shaped change. After this PR the plumbing is in place; the field is available to any caller that wants to use it.

Upstream proto changes:

How this is covered by tests: regen is mechanical, and the wiring commit is pure plumbing — leaving CompositionInputs.XRD nil produces the same proto request as before, so the existing cmd/crossplane/render/... tests cover the no-XRD path. ./nix.sh flake check passes.

Fixes #

I have:

  • Read and followed Crossplane's contribution process.
  • Run ./nix.sh flake check to ensure this PR is ready for review.
  • Added or updated unit tests. Regen + nil-default plumbing; the existing render tests cover the unchanged no-XRD path. Happy to add a test that asserts the XRD-set path produces the populated proto field if reviewers want it.
  • Linked a PR or a docs tracking issue to document this change. No user-facing change yet — this PR adds the proto field and the CompositionInputs.XRD plumbing; there's no command-surface change to document.
  • Added backport release-x.y labels to auto-backport this PR. Not a backport candidate; happy to add a label if maintainers want it on a release branch.

Add composite_resource_definition (field 8) to CompositeInput, matching
the upstream change in crossplane/crossplane. The field carries the XRD
that defines the input XR so the render binary can pick the right
composite.Schema (Legacy vs Modern) the way the production reconciler
does. The field is optional, so existing callers keep their current
SchemaModern fallback behavior.

The cli's option go_package intentionally still points at
github.com/crossplane/cli/v2/proto/render/v1alpha1, not the upstream
path.

Regenerated render.pb.go via ./nix.sh run .#generate using the
Nix-pinned protoc-gen-go v1.36.10.

Upstream: crossplane/crossplane@12f3f1c
Upstream follow-up: crossplane/crossplane@babb251

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
@jcogilvie jcogilvie requested review from a team and tampakrap as code owners June 4, 2026 01:39
@jcogilvie jcogilvie requested review from negz and removed request for a team June 4, 2026 01:39
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR extends the CompositeInput protobuf message with an optional composite_resource_definition field. This field carries the XRD (composite resource definition) used to determine whether the renderer should apply Legacy or Modern schema behavior, with Modern schema as the default fallback.

Changes

CompositeInput Schema Extension

Layer / File(s) Summary
Composite resource definition field addition
proto/render/v1alpha1/render.proto
The CompositeInput message adds an optional google.protobuf.Struct composite_resource_definition field (tag 8) with documentation explaining it supplies the XRD for schema behavior selection and that Schema=Modern is the fallback when absent.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Breaking Changes ✅ Passed PR modifies only proto files outside apis//cmd/, adding optional field with no removals or required additions to public entities.
Feature Gate Requirement ✅ Passed The new field is in proto/ (not apis/**), is optional with fallback behavior, doesn't affect existing behavior, and isn't marked experimental. No feature gate required.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, detailing both commits, the proto field addition, the wiring changes, and test coverage.
Title check ✅ Passed The title clearly describes the main change: syncing the render.proto file with upstream and adding the XRD field, directly matching the PR's core objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Add XRD field to CompositionInputs so callers can pass a
CompositeResourceDefinition to the render binary. BuildCompositeRequest
copies it through to the proto's CompositeResourceDefinition field
(added in the previous commit syncing render.proto). When no XRD is
supplied behavior is unchanged (Schema=Modern fallback in the binary).

Mirror of the Go-level change in
crossplane/crossplane/cmd/crossplane/render to keep the CLI's
CompositionInputs in sync with what the binary now consumes.

Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
@jcogilvie jcogilvie changed the title proto: Sync render.proto with crossplane/crossplane main render: Sync render.proto with crossplane/crossplane and wire XRD through Jun 4, 2026
@jcogilvie jcogilvie changed the title render: Sync render.proto with crossplane/crossplane and wire XRD through render: Sync render.proto with c/c and wire XRD through Jun 4, 2026

@adamwg adamwg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for taking care of this.

@adamwg adamwg merged commit b697fe6 into crossplane:main Jun 4, 2026
12 checks passed
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

Successfully created backport PR for release-2.3:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants