Skip to content

Commit 328fb9d

Browse files
Apply operator templating where applicable (#341)
## Description * Apply [operator templating](https://github.com/stackabletech/operator-templating) where applicable * Fix links in Rust documentation Not applied: * `.dockerignore` * `.flake8` * `.github/ISSUE_TEMPLATE/new_version.md` * `.github/pull_request_template.md`: Helm chart check * `.github/workflows/build.yml`: Regeneration of CRDs, Helm charts, and Kustomize manifests; Building and publishing of the Docker image * `.github/workflows/reviewdog.yaml`: flake8, hadolint, shellcheck * `.pylintrc` * `deploy/` * `docker/` * `Makefile` * `python/` * `renovate.json`: lock file maintenance * `scripts/` Closes #323 ## Review Checklist - [ ] Code contains useful comments - [ ] (Integration-)Test cases added (or not applicable) - [ ] Documentation added (or not applicable) - [ ] Changelog updated (or not applicable)
1 parent 37dd08b commit 328fb9d

15 files changed

+339
-148
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: "🐛 Bug Report"
3+
description: "If something isn't working as expected 🤔."
4+
labels: ["type/bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: Thanks for taking the time to file a bug report! Please fill out this form as completely as possible.
9+
10+
- type: input
11+
attributes:
12+
label: Affected version
13+
description: Which version do you see this bug in?
14+
15+
- type: textarea
16+
attributes:
17+
label: Current and expected behavior
18+
description: A clear and concise description of what operator-rs is doing and what you would expect.
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
attributes:
24+
label: Possible solution
25+
description: "If you have suggestions on a fix for the bug."
26+
27+
- type: textarea
28+
attributes:
29+
label: Additional context
30+
description: "Add any other context about the problem here. Or a screenshot if applicable."
31+
32+
- type: textarea
33+
attributes:
34+
label: Environment
35+
description: |
36+
What type of kubernetes cluster you are running aginst (k3s/eks/aks/gke/other) and any other information about your environment?
37+
placeholder: |
38+
Examples:
39+
Output of `kubectl version --short`
40+
41+
- type: dropdown
42+
attributes:
43+
label: Would you like to work on fixing this bug?
44+
description: |
45+
**NOTE**: Let us know if you would like to submit a PR for this. We are more than happy to help you through the process.
46+
options:
47+
- "yes"
48+
- "no"
49+
- "maybe"

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
blank_issues_enabled: true
3+
contact_links:
4+
- name: Feature request
5+
about: 🚀 Suggest an idea for this project
6+
url: https://github.com/stackabletech/operator-templating-operator/discussions/new?category=ideas
7+
- name: 🙋🏾 Question
8+
about: Use this to ask a question about this project
9+
url: https://github.com/stackabletech/operator-templating-operator/discussions/new?category=q-a
10+
- name: Other issue
11+
about: Open an issue that doesn't fit any other category
12+
url: https://github.com/stackabletech/operator-templating-operator/issues/new

.github/dependabot.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
## Description
22

3+
*Please add a description here. This will become the commit message of the merge request later.*
4+
5+
<!-- Commit message above. Everything below is not added to the message. Do not change this line! -->
6+
37
## Review Checklist
48
- [ ] Code contains useful comments
59
- [ ] (Integration-)Test cases added (or not applicable)
610
- [ ] Documentation added (or not applicable)
711
- [ ] Changelog updated (or not applicable)
12+
- [ ] Cargo.toml only contains references to git tags (not specific commits or branches)
13+
14+
Once the review is done, comment `bors r+` (or `bors merge`) to merge. [Further information](https://bors.tech/documentation/getting-started/#reviewing-pull-requests)

.github/workflows/build.yml

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
---
2+
name: Stackable Build Pipeline
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- staging
9+
- trying
10+
- "renovate/**"
11+
tags:
12+
- "*"
13+
pull_request:
14+
15+
env:
16+
CARGO_TERM_COLOR: always
17+
CARGO_INCREMENTAL: '0'
18+
CARGO_PROFILE_DEV_DEBUG: '0'
19+
RUSTFLAGS: "-D warnings"
20+
RUSTDOCFLAGS: "-D warnings"
21+
RUST_LOG: "info"
22+
23+
jobs:
24+
# Identify unused dependencies
25+
run_udeps:
26+
name: Run Cargo Udeps
27+
runs-on: ubuntu-latest
28+
env:
29+
RUSTC_BOOTSTRAP: 1
30+
steps:
31+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
32+
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
33+
with:
34+
profile: minimal
35+
toolchain: stable
36+
override: true
37+
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641 # renovate: tag=v1.3.0
38+
with:
39+
key: udeps
40+
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # renovate: tag=v1.0.3
41+
with:
42+
command: install
43+
args: cargo-udeps --locked
44+
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # renovate: tag=v1.0.3
45+
with:
46+
command: udeps
47+
args: --all-targets
48+
49+
run_cargodeny:
50+
name: Run Cargo Deny
51+
runs-on: ubuntu-latest
52+
strategy:
53+
matrix:
54+
checks:
55+
- advisories
56+
- bans licenses sources
57+
58+
# Prevent sudden announcement of a new advisory from failing ci:
59+
continue-on-error: ${{ matrix.checks == 'advisories' }}
60+
61+
steps:
62+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
63+
- uses: EmbarkStudios/cargo-deny-action@8acbae97b5d01b0481ae14cee8fcd8f5aa9e374d # tag=v1.2.12
64+
with:
65+
command: check ${{ matrix.checks }}
66+
67+
run_rustfmt:
68+
name: Run Rustfmt
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
72+
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
73+
with:
74+
profile: minimal
75+
toolchain: stable
76+
components: rustfmt
77+
override: true
78+
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # renovate: tag=v1.0.3
79+
with:
80+
command: fmt
81+
args: --all -- --check
82+
83+
run_clippy:
84+
name: Run Clippy
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
88+
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
89+
with:
90+
profile: minimal
91+
toolchain: stable
92+
components: clippy
93+
override: true
94+
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641 # renovate: tag=v1.3.0
95+
with:
96+
key: clippy
97+
- name: Run clippy action to produce annotations
98+
env:
99+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d # renovate: tag=v1.0.7
101+
if: env.GITHUB_TOKEN != null
102+
with:
103+
args: --all-targets -- -D warnings
104+
token: ${{ secrets.GITHUB_TOKEN }}
105+
- name: Run clippy manually without annotations
106+
env:
107+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
if: env.GITHUB_TOKEN == null
109+
run: cargo clippy --all-targets -- -D warnings
110+
111+
run_rustdoc:
112+
name: Run RustDoc
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
116+
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
117+
with:
118+
profile: minimal
119+
toolchain: stable
120+
components: rustfmt
121+
override: true
122+
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641 # renovate: tag=v1.3.0
123+
with:
124+
key: doc
125+
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # renovate: tag=v1.0.3
126+
with:
127+
command: doc
128+
args: --document-private-items
129+
130+
run_tests:
131+
name: Run Cargo Tests
132+
needs:
133+
- run_cargodeny
134+
- run_clippy
135+
- run_rustfmt
136+
- run_rustdoc
137+
runs-on: ubuntu-latest
138+
steps:
139+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
140+
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # renovate: tag=v1.0.7
141+
with:
142+
profile: minimal
143+
toolchain: stable
144+
override: true
145+
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641 # renovate: tag=v1.3.0
146+
with:
147+
key: test
148+
- uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # renovate: tag=v1.0.3
149+
with:
150+
command: test
151+
152+
tests_passed:
153+
name: All tests passed
154+
needs:
155+
- run_udeps
156+
- run_tests
157+
runs-on: ubuntu-latest
158+
steps:
159+
- name: log
160+
run: echo All tests have passed!

.github/workflows/daily_security.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
---
12
name: Security audit
3+
24
on:
35
schedule:
4-
- cron: '0 0 * * *'
6+
- cron: '15 4 * * *'
57
workflow_dispatch:
68

79
jobs:
810
audit:
911
runs-on: ubuntu-latest
1012
steps:
11-
- uses: actions/[email protected]
12-
- uses: actions-rs/[email protected]
13+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
14+
- uses: actions-rs/audit-check@35b7b53b1e25b55642157ac01b4adceb5b9ebef3 # renovate: tag=v1.2.0
1315
with:
1416
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/reviewdog.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: reviewdog
3+
on:
4+
pull_request
5+
6+
permissions:
7+
contents: read
8+
checks: write
9+
pull-requests: write
10+
issues: write
11+
12+
jobs:
13+
actionlint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
17+
- uses: reviewdog/action-actionlint@b90911e83b48ae099d609be666e2ff7a3dde25d8 # tag=v1.19.0
18+
with:
19+
github_token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
detect-secrets:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
25+
- uses: reviewdog/action-detect-secrets@0034e2d330af20c02fb6d9b3a813404a4ef6ba12 # tag=v0.8.0
26+
with:
27+
github_token: ${{ secrets.github_token }}
28+
29+
markdownlint:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
33+
- uses: reviewdog/action-markdownlint@40f5a7a4afc06d314a2c3a72f42c387b5187deaa # renovate: tag=v0.3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
37+
yamllint:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
41+
- uses: reviewdog/action-yamllint@aabd7aef24430a8da23122ca6711faec445dfcf6 # renovate: tag=v1.4.0
42+
with:
43+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)