Repository navigation
feat: Allow custom type declaration in SimpleSchema - #238
Conversation
Signed-off-by: Cyrill Näf <cyrill.naef@gmail.com>
65f7793 to
410f1d8
Compare
📝 WalkthroughWalkthroughThe XRD generator now reads ChangesSimpleSchema custom type support
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 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
🤖 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 `@cmd/crossplane/xrd/generate_test.go`:
- Around line 784-803: Update the comparison in the test around the generated
schema to include JSONSchemaProps.Required instead of globally ignoring it.
Ensure the assertions explicitly verify that both spec.request.Required and
status.result.Required contain value1, while preserving the existing comparisons
for other schema fields.
🪄 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 Plus
Run ID: f39acff3-182f-4bfb-b03f-6a7628e4408c
📒 Files selected for processing (2)
cmd/crossplane/xrd/generate.gocmd/crossplane/xrd/generate_test.go
crossplane 2.5.0 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## What's Changed * renovate: Add release-2.4 to the base branches by @adamwg in crossplane/cli#144 * validate: Use crossplane:stable as the default image by @adamwg in crossplane/cli#148 * chore(deps): update module github.com/sigstore/cosign/v2 to v2.6.3 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#150 * chore(deps): update module github.com/sigstore/rekor to v1.5.2 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#152 * fix(deps): update module github.com/docker/cli to v29.6.0+incompatible (main) by @crossplane-renovate[bot] in crossplane/cli#146 * fix(deps): update module github.com/emicklei/dot to v1.11.0 (main) by @crossplane-renovate[bot] in crossplane/cli#147 * fix(render): annotate functions when reusing an existing network by @jcogilvie in crossplane/cli#159 * render: Have the context function listen on a TCP port by @adamwg in crossplane/cli#163 * chore(deps): update module github.com/sigstore/cosign/v3 to v3.0.6 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#151 * fix(deps): update module github.com/docker/cli to v29.6.1+incompatible (main) by @crossplane-renovate[bot] in crossplane/cli#164 * chore(deps): update module oras.land/oras-go/v2 to v2.6.1 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#178 * chore(deps): update renovatebot/github-action action to v46.1.18 (main) by @crossplane-renovate[bot] in crossplane/cli#175 * projects: Correctly build multi-arch Python functions by @adamwg in crossplane/cli#192 * chore(deps): update module oras.land/oras-go/v2 to v2.6.2 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#189 * projects: Skip empty documents when applying init and extra resources by @ytsarev in crossplane/cli#208 * chore(deps): update module github.com/yuin/goldmark to v1.7.17 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#183 * fix(deps): update module github.com/crossplane/crossplane/apis/v2 to v2.3.4 (main) by @crossplane-renovate[bot] in crossplane/cli#209 * fix(deps): update module google.golang.org/grpc to v1.82.1 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#201 * Fix two potential race conditions in project-related code by @adamwg in crossplane/cli#171 * feat: add --json-schema flag to xrd convert by @fernandezcuesta in crossplane/cli#142 * validate: Recognize Kubernetes built-in resources by @ihopenre-eng in crossplane/cli#197 * chore(deps): update actions/checkout digest to d23441a (main) by @crossplane-renovate[bot] in crossplane/cli#217 * chore(deps): update actions/stale digest to 1e223db (main) by @crossplane-renovate[bot] in crossplane/cli#218 * fix(deps): update module github.com/getkin/kin-openapi to v0.144.0 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#222 * chore(deps): update module github.com/google/cel-go to v0.29.0 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#220 * chore(deps): update module github.com/go-chi/chi/v5 to v5.3.0 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#219 * chore(deps): update module github.com/sigstore/timestamp-authority/v2 to v2.1.0 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#174 * chore(deps): update module github.com/klauspost/compress to v1.18.7 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#227 * chore(deps): update cachix/install-nix-action digest to 630ae54 (main) by @crossplane-renovate[bot] in crossplane/cli#228 * build: Calculate checksums after the nix fixup phase by @adamwg in crossplane/cli#235 * chore(deps): update module github.com/sigstore/sigstore-go to v1.2.1 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#186 * chore(deps): update github/codeql-action digest to f205ea1 (main) by @crossplane-renovate[bot] in crossplane/cli#232 * fix(deps): update module github.com/docker/cli to v29.7.1+incompatible (main) by @crossplane-renovate[bot] in crossplane/cli#234 * chore(deps): update renovatebot/github-action action to v46.2.0 (main) by @crossplane-renovate[bot] in crossplane/cli#233 * feat: Allow custom type declaration in SimpleSchema by @BigGold1310 in crossplane/cli#238 * schemas: Indent .lock.json for readability by @Bham06 in crossplane/cli#231 * fix(common/load/streamToUnstructured): skip empty documents by @nkzk in crossplane/cli#241 * fix(deps): update module github.com/go-git/go-billy/v5 to v5.9.1 (main) by @crossplane-renovate[bot] in crossplane/cli#240 * chore(deps): update renovatebot/github-action action to v46.2.1 (main) by @crossplane-renovate[bot] in crossplane/cli#239 * feat: Add --replace flag to crossplane xrd generate by @BigGold1310 in crossplane/cli#243 * feat: add GetX/SetX accessors to generated Go models by @erikmiller-gusto in crossplane/cli#160 * generator: make generated Go types implement runtime.Object and provide AddToScheme by @erikmiller-gusto in crossplane/cli#162 * generator: make generated Go getters tolerate a nil receiver by @erikmiller-gusto in crossplane/cli#246 * chore(deps): update github/codeql-action digest to 5595cca (main) by @crossplane-renovate[bot] in crossplane/cli#244 * fix(deps): update module github.com/go-git/go-git/v5 to v5.19.2 (main) by @crossplane-renovate[bot] in crossplane/cli#245 * ci: fix Renovate's Nix updates and bump nixpkgs to nixos-26.05 by @jbw976 in crossplane/cli#257 * chore(deps): update renovatebot/github-action action to v46.2.2 (main) by @crossplane-renovate[bot] in crossplane/cli#261 * fix(deps): update module google.golang.org/protobuf to v1.36.12 (main) by @crossplane-renovate[bot] in crossplane/cli#262 * chore(deps): update dependency renovate to v44.23.3 (main) by @crossplane-renovate[bot] in crossplane/cli#260 * chore(deps): lock file maintenance (main) by @crossplane-renovate[bot] in crossplane/cli#258 * fix(deps): update module github.com/alecthomas/kong to v1.16.1 (main) by @crossplane-renovate[bot] in crossplane/cli#268 * chore(deps): update dependency renovate to v44.27.0 (main) by @crossplane-renovate[bot] in crossplane/cli#267 * chore(deps): update gomod2nix digest to 1201ddd (main) by @crossplane-renovate[bot] in crossplane/cli#259 * chore(deps): update korthout/backport-action action to v4.6.0 (main) by @crossplane-renovate[bot] in crossplane/cli#250 * chore(deps): update actions/checkout action to v6.1.0 (main) by @crossplane-renovate[bot] in crossplane/cli#249 * fix(ci): clean /homeless-shelter before Renovate's Nix commands by @jbw976 in crossplane/cli#279 * fix(deps): update module golang.org/x/mod to v0.40.0 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#271 * fix(schemas): fix Go model generation for validation-only combinators and shared k8s package collisions by @haarchri in crossplane/cli#269 * chore(deps): lock file maintenance (main) by @crossplane-renovate[bot] in crossplane/cli#272 * chore(deps): update cachix/install-nix-action digest to 13d8dd5 (main) by @crossplane-renovate[bot] in crossplane/cli#273 * chore(deps): update module github.com/google/cel-go to v0.30.0 [security] (main) by @crossplane-renovate[bot] in crossplane/cli#284 * fix(deps): update module github.com/getkin/kin-openapi to v0.147.0 (main) by @crossplane-renovate[bot] in crossplane/cli#280 * fix(deps): update module github.com/docker/go-connections to v0.8.1 (main) by @crossplane-renovate[bot] in crossplane/cli#276 * chore(deps): update dependency renovate to v44.33.2 (main) by @crossplane-renovate[bot] in crossplane/cli#275 * chore(deps): update github/codeql-action digest to ff2f1c6 (main) by @crossplane-renovate[bot] in crossplane/cli#274 * fix(dependency): generate schemas for transitive package dependencies by @haarchri in crossplane/cli#270 * fix(deps): update module github.com/google/go-containerregistry to v0.21.9 (main) by @crossplane-renovate[bot] in crossplane/cli#247 * chore(deps): lock file maintenance (main) by @crossplane-renovate[bot] in crossplane/cli#287 ## New Contributors * @ytsarev made their first contribution in crossplane/cli#208 * @ihopenre-eng made their first contribution in crossplane/cli#197 * @BigGold1310 made their first contribution in https:/ See merge request: Harmonybrew/homebrew-core!17385
Description of your changes
Allows the definition of custom types within a SimpleSchema declaration.
Looks like:
Fixes #199
I have:
./nix.sh flake checkto ensure this PR is ready for review.backport release-x.ylabels to auto-backport this PR.Need help with this checklist? See the cheat sheet.