Skip to content

Commit 494ec0b

Browse files
sbernauerTechassi
andauthored
feat: Add CRD previewer (#1030)
* feat: Add CRD previewer * Add DummyCluster * docs * Add comment * Fixup DummyServer * Add README * Add CI check * Fix CI * Add changelog * Fix versions script * fix: Dont leak rustdoc in CRD descriptions * update crds * refactor: Transform CRD preview into xtask * ci: Remove unused job in build workflow * chore: Update ListenerClass CRD * chore: Cleanup schemars derive --------- Co-authored-by: Techassi <[email protected]>
1 parent c91c7ff commit 494ec0b

File tree

18 files changed

+2267
-10
lines changed

18 files changed

+2267
-10
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[alias]
2+
xtask = "run --package xtask --"

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
crates/stackable-operator/crds/*.yaml linguist-generated
12
*.stderr linguist-generated
23
*.snap linguist-generated

.pre-commit-config.yaml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ repos:
1212
args: ["--allow-missing-credentials"]
1313
- id: detect-private-key
1414

15-
- repo: https://github.com/doublify/pre-commit-rust
16-
rev: eeee35a89e69d5772bdee97db1a6a898467b686e # 1.0
17-
hooks:
18-
- id: clippy
19-
args: ["--all-targets", "--", "-D", "warnings"]
2015
- repo: https://github.com/adrienverge/yamllint
2116
rev: 79a6b2b1392eaf49cdd32ac4f14be1a809bbd8f7 # 1.37.1
2217
hooks:
@@ -52,10 +47,27 @@ repos:
5247
stages: [pre-commit, pre-merge-commit, manual]
5348
pass_filenames: false
5449

55-
- id: rustfmt
56-
name: rustfmt
50+
- id: cargo-rustfmt
51+
name: cargo-rustfmt
5752
language: system
5853
# Pinning to a specific rustc version, so that we get consistent formatting
5954
entry: cargo +nightly-2025-05-26 fmt --all -- --check
60-
stages: [pre-commit]
55+
stages: [pre-commit, pre-merge-commit]
56+
pass_filenames: false
57+
files: \.rs$
58+
59+
- id: cargo-clippy
60+
name: cargo-clippy
61+
language: system
62+
entry: cargo clippy --all-targets -- -D warnings
63+
stages: [pre-commit, pre-merge-commit]
64+
pass_filenames: false
65+
files: \.rs$
66+
67+
- id: crd-preview
68+
name: crd-preview
69+
language: system
70+
entry: cargo xtask crd preview
71+
stages: [pre-commit, pre-merge-commit]
6172
pass_filenames: false
73+
files: \.rs$

.scripts/verify_crate_versions.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ set -euo pipefail
1212
# stackable-webhook-0.3.1
1313

1414
for CRATE in $(find ./crates/ -mindepth 2 -name Cargo.toml -print0 | xargs -0 -n 1 dirname | xargs -n 1 basename | sort); do
15+
if [ "$CRATE" = "xtask" ]; then
16+
continue # Skip xtask binary, because it is not published and only used for internal tooling
17+
fi
18+
1519
# Get the version in Cargo.toml
1620
CRATE_VERSION=$(grep 'version' "./crates/$CRATE/Cargo.toml" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
1721
[ -n "$CRATE_VERSION" ] || (
@@ -40,7 +44,6 @@ for CRATE in $(find ./crates/ -mindepth 2 -name Cargo.toml -print0 | xargs -0 -n
4044
echo "Ensure the version in ./crates/$CRATE/Cargo.toml matches the version in ./crates/$ASSOCIATED_CRATE/Cargo.toml" >&2
4145
exit 23
4246
)
43-
4447
else
4548
# Get the latest documented version from the CHANGELOG.md
4649
CHANGELOG_VERSION=$(grep -oE '\[[0-9]+\.[0-9]+\.[0-9]+\]' "./crates/$CRATE/CHANGELOG.md" | head -1 | tr -d '[]')

.yamllint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ rules:
77
check-keys: false
88
comments:
99
min-spaces-from-content: 1 # Needed due to https://github.com/adrienverge/yamllint/issues/443
10+
indentation:
11+
ignore:
12+
crates/stackable-operator/crds/*.yaml

Cargo.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/stackable-operator/crds/AuthenticationClass.yaml

Lines changed: 294 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/stackable-operator/crds/DummyCluster.yaml

Lines changed: 1137 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/stackable-operator/crds/Listener.yaml

Lines changed: 123 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/stackable-operator/crds/ListenerClass.yaml

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/stackable-operator/crds/PodListeners.yaml

Lines changed: 86 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)