add new agent skills to audit our KRO adaptations, improve agentic upgrade process, code quality improvements from audit - #13
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.shfor automated file-by-file comparison against upstream KRO with import path normalization. Added Claude skills (/audit-patchesand/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.mdfrom 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.mdthat 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:
DeepCopySchemanow returns errors instead of silently returning nil on marshal/unmarshal failureSchemaMapResolverandCRDSchemaResolver— both maps are read-only after constructionObjectMetaSchemainjection ingetSchemaWithoutStatus— Crossplane'srequired_schemasalready sends fully-flattened schemas with resolved metadataHow 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.3and/review-kro-adaptations v0.8.3skills to ensure they are converging after these changes.I have: