Skip to content

add new agent skills to audit our KRO adaptations, improve agentic upgrade process, code quality improvements from audit - #13

Merged
jbw976 merged 7 commits into
crossplane-contrib:mainfrom
jbw976:audit
Mar 6, 2026
Merged

add new agent skills to audit our KRO adaptations, improve agentic upgrade process, code quality improvements from audit#13
jbw976 merged 7 commits into
crossplane-contrib:mainfrom
jbw976:audit

Conversation

@jbw976

@jbw976 jbw976 commented Mar 6, 2026

Copy link
Copy Markdown
Member

Description of your changes

This PR updates the agent tooling and documentation as well as code quality improvements to make our KRO library adaptations auditable, well-documented, and easier to upgrade in the future.

The biggest changes are:

Audit tooling and skills. Added diff-upstream-kro.sh for automated file-by-file comparison against upstream KRO with import path normalization. Added Claude skills (/audit-patches and /review-kro-adaptations) so any contributor can consistently audit and review our adaptations against a specific upstream tag.

Patches documentation rewrite. Rewrote v0.8.x_PATCHES.md from a descriptive changelog into a structured upgrade guide with per-file "what to look for / what to do" instructions and complete replacement code blocks. This makes it more effective for use by an agent following the upgrade process.

Upgrade process improvements. Added an "Intelligent Merging" section to UPGRADE_PROCESS.md that guides the upgrade agent to reason about why each adaptation exists rather than mechanically pasting old code into new upstream. Each adaptation should be evaluated for its relevance in new versions of KRO.

Small fixes were made to improve the adaptations code quality and make it more maintainer for the future:

  • DeepCopySchema now returns errors instead of silently returning nil on marshal/unmarshal failure
  • Removed unnecessary mutexes from SchemaMapResolver and CRDSchemaResolver — both maps are read-only after construction
  • Removed redundant ObjectMetaSchema injection in getSchemaWithoutStatus — Crossplane's required_schemas already sends fully-flattened schemas with resolved metadata

How has this code been tested

All unit tests pass and example scenarios from https://github.com/upbound/function-kro/tree/main/example are working.

I have also run the /audit-patches v0.8.3 and /review-kro-adaptations v0.8.3 skills to ensure they are converging after these changes.

I have:

jbw976 added 7 commits March 5, 2026 11:50
Add diff-upstream-kro.sh script for automated file-by-file comparison
against upstream KRO, this will help us be very precise in the future
about all changes we've made locally vs upstream KRO.

Add Claude skills for auditing patches documentation and reviewing KRO
adaptations. These new skills help automate the process of auditing
our changes and reviewing them for improvements so we can do that in
consistent ways across all contributors to this repo going forward.

Update AGENTS.md with mandatory audit process requiring diff script
output as source of truth.

Update .gitignore for diff script temp dirs.

Signed-off-by: Jared Watts <jbw976@gmail.com>
Rewrite v0.8.x_PATCHES.md from a descriptive changelog into a
structured upgrade guide with per-file "what to look for / what to do"
instructions and complete replacement code blocks. This makes it
directly usable by an agent following the upgrade process.

Update UPGRADE_PROCESS.md to prefer the /audit-patches skill and diff
script for patch validation, handle both possible upstream module paths
(github.com/kubernetes-sigs/kro and sigs.k8s.io/kro), and document the
v1alpha1 → v1beta1 API version import rewrite.

Remove v0.8.x_UPSTREAM_CHANGES.md as its content (v0.7.1 → v0.8.x
delta analysis) was specific to the completed v0.8.x upgrade and is
superseded by the rewritten patches doc.

Signed-off-by: Jared Watts <jbw976@gmail.com>
…RO libraries

Remove restMapper completely from the graph builder, GVR/Namespaced fields
from graph nodes, namespace normalization in runtime, and cluster-scope template
validation. These are standalone KRO controller concerns that don't
apply in the Crossplane function context — Crossplane handles resource
creation, namespace defaulting, and scope validation itself. The
restMapper was already passed as nil, making this dead code, so removing
it entirely is reasonable.

Signed-off-by: Jared Watts <jbw976@gmail.com>
Signed-off-by: Jared Watts <jbw976@gmail.com>
…ns skill

Signed-off-by: Jared Watts <jbw976@gmail.com>
…pplying our adaptations

Signed-off-by: Jared Watts <jbw976@gmail.com>
Signed-off-by: Jared Watts <jbw976@gmail.com>
@jbw976
jbw976 merged commit 36624e2 into crossplane-contrib:main Mar 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant