Skip to content

feat: Generate the Artifact Hub CRD annotation from extra/crds.yaml - #622

Open
lfrancke wants to merge 2 commits into
mainfrom
push-twnptvkmmznu
Open

feat: Generate the Artifact Hub CRD annotation from extra/crds.yaml#622
lfrancke wants to merge 2 commits into
mainfrom
push-twnptvkmmznu

Conversation

@lfrancke

@lfrancke lfrancke commented Aug 3, 2026

Copy link
Copy Markdown
Member

This is derived from extra/crds.yaml and ends up in Chart.yaml.

This is derived from extra/crds.yaml and ends up in Chart.yaml.
@lfrancke

lfrancke commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

If you like I can create this as a test PR in one repo first.

@lfrancke lfrancke self-assigned this Aug 3, 2026
@lfrancke lfrancke moved this to Development: Waiting for Review in Stackable Engineering Aug 3, 2026
Comment thread template/Makefile.j2 Outdated
# displayName: TrustStore
# description: A TrustStore requests information about how to validate secrets ...
crd-annotation: crds
@CRDS="$$(yq ea -o=yaml '[.] | map(.spec.versions |= map(select(.storage == true))) | map({"kind": .spec.names.kind, "version": .spec.versions[0].name, "name": .metadata.name, "displayName": .spec.names.kind, "description": (.spec.versions[0].schema.openAPIV3Schema.description // "")})' extra/crds.yaml)" \

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.

Does this overrwrite the extra/crds.yaml in the repo, or does it do something else that only gets seen when doing artifact hub stuff?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Instead of answering here I'll try to clarify the comment. Thanks for taking a look!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

See if this makes more sense now.

Addresses review feedback: the recipe was one long line, so it was not obvious
that it reads extra/crds.yaml and writes Chart.yaml.

CRD_ANNOTATION_READ and CRD_ANNOTATION_WRITE are now separate, each with its own
comment. Still a single shell command: the env-var prefix is needed because the
value is multi-line and reaches yq via strenv.
@lfrancke
lfrancke requested a review from NickLarsenNZ August 4, 2026 08:18
Comment thread template/Makefile.j2
mkdir -p extra
cargo run --bin stackable-"${OPERATOR_NAME}" -- crd > extra/crds.yaml

# This adds CRD metadata for artifacthub.io (AH) to Chart.yaml.

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.

I feel like this should be an xtask (or even a subcommand on the operator itself, like the crd subcommand) instead.

Also, this would need to be executed by pre-commit/prek to ensure consistency.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I want to push back on both.

  1. We don't have xtask or anything like that for any other command in here and we already even do rewriting (for version stuff) with yq. So this is consistent

  2. This is already executed via prek (regenerate-charts) so that's covered and it triggers when it's inconsistent.

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

Labels

None yet

Projects

Status: Development: Waiting for Review

Development

Successfully merging this pull request may close these issues.

3 participants