Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
xtask = "run --package xtask --"
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
crates/stackable-operator/crds/*.yaml linguist-generated
*.stderr linguist-generated
*.snap linguist-generated
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,33 @@ jobs:
- run: cargo test --no-default-features --workspace
- run: cargo test --all-features --workspace

check_crd_previews:
name: Check if CRD previews are up to date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
- name: Regenerate CRD previews
run: cargo check -p stackable-crd-previewer
- name: Check if committed CRD previews were up to date
run: git diff --exit-code generated-crd-previews
- name: Git Diff showed uncommitted changes
if: ${{ failure() }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
core.setFailed('Committed CRD previews were not up to date, please run "cargo check -p stackable-crd-previewer" and re-commit!')

tests_passed:
name: All tests passed
needs:
- run_udeps
- run_tests
- check_crd_previews
runs-on: ubuntu-latest
steps:
- name: log
Expand Down
28 changes: 20 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ repos:
args: ["--allow-missing-credentials"]
- id: detect-private-key

- repo: https://github.com/doublify/pre-commit-rust
rev: eeee35a89e69d5772bdee97db1a6a898467b686e # 1.0
hooks:
- id: clippy
args: ["--all-targets", "--", "-D", "warnings"]
- repo: https://github.com/adrienverge/yamllint
rev: 81e9f98ffd059efe8aa9c1b1a42e5cce61b640c6 # 1.35.1
hooks:
Expand Down Expand Up @@ -52,10 +47,27 @@ repos:
stages: [pre-commit, pre-merge-commit, manual]
pass_filenames: false

- id: rustfmt
name: rustfmt
- id: cargo-rustfmt
name: cargo-rustfmt
language: system
# Pinning to a specific rustc version, so that we get consistent formatting
entry: cargo +nightly-2025-01-15 fmt --all -- --check
stages: [pre-commit]
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: \.rs$

- id: cargo-clippy
name: cargo-clippy
language: system
entry: cargo clippy --all-targets -- -D warnings
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: \.rs$

- id: crd-preview
name: crd-preview
language: system
entry: cargo xtask crd preview
stages: [pre-commit, pre-merge-commit]
pass_filenames: false
files: \.rs$
5 changes: 4 additions & 1 deletion .scripts/verify_crate_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ set -euo pipefail
# stackable-webhook-0.3.1

for CRATE in $(find ./crates/ -mindepth 2 -name Cargo.toml -print0 | xargs -0 -n 1 dirname | xargs -n 1 basename | sort); do
if [ "$CRATE" = "xtask" ]; then
continue # Skip xtask binary, because it is not published and only used for internal tooling
fi

# Get the version in Cargo.toml
CRATE_VERSION=$(grep 'version' "./crates/$CRATE/Cargo.toml" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
[ -n "$CRATE_VERSION" ] || (
Expand Down Expand Up @@ -40,7 +44,6 @@ for CRATE in $(find ./crates/ -mindepth 2 -name Cargo.toml -print0 | xargs -0 -n
echo "Ensure the version in ./crates/$CRATE/Cargo.toml matches the version in ./crates/$ASSOCIATED_CRATE/Cargo.toml" >&2
exit 23
)

else
# Get the latest documented version from the CHANGELOG.md
CHANGELOG_VERSION=$(grep -oE '\[[0-9]+\.[0-9]+\.[0-9]+\]' "./crates/$CRATE/CHANGELOG.md" | head -1 | tr -d '[]')
Expand Down
3 changes: 3 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ rules:
check-keys: false
comments:
min-spaces-from-content: 1 # Needed due to https://github.com/adrienverge/yamllint/issues/443
indentation:
ignore:
crates/stackable-operator/crds/*.yaml
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

294 changes: 294 additions & 0 deletions crates/stackable-operator/crds/AuthenticationClass.yaml

Large diffs are not rendered by default.

1,137 changes: 1,137 additions & 0 deletions crates/stackable-operator/crds/DummyCluster.yaml

Large diffs are not rendered by default.

123 changes: 123 additions & 0 deletions crates/stackable-operator/crds/Listener.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions crates/stackable-operator/crds/ListenerClass.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading