crossplane / crossplane/cli

Add a flag to force schema regeneration despite the dependency cache

Open
#67 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
19
Forks
31
Avg merge
3d 4h
Merged PRs (30d)
52

Description

### What problem are you facing?

`crossplane dependency update-cache` skips regenerating schemas for any dependency whose recorded digest in `schemas/.lock.json` is unchanged. That's the right default, but it means there's no supported way to force regeneration when the dependency versions haven't changed.

I hit this after bumping my schema generator, which produced a different output style. My own XRD schemas picked up the new style on the next build because the project's own APIs are always regenerated, but my dependency schemas didn't, because their digests were unchanged. The two halves of my generated tree drifted apart and no flag would let me re-render the dependency half.

The only workaround I found is deleting `schemas/.lock.json` (or running `clean-cache`, which deletes the whole schemas directory) and regenerating. That works, but deleting state out from under the tool to trigger a rebuild is awkward, and `clean-cache` is heavier than needed since it also removes the project's own generated schemas.

### How could Crossplane help solve your problem?

Add a flag to `dependency update-cache` to force regeneration despite the cache, e.g. `--force`. It would regenerate all dependency schemas regardless of whether their recorded digest is unchanged. This is useful any time the generators change rather than the dependency versions, where the digests are identical but the desired output differs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.