From a35bf35af6918c9a5bba185f74e737c3c80b2e52 Mon Sep 17 00:00:00 2001 From: Mario Constanti Date: Fri, 15 Sep 2023 09:57:05 +0200 Subject: [PATCH] chore: enable commitlint as we rely on structured commit messages for release notes, commitlint will validate the commit messages. --- .github/ISSUE_TEMPLATE/bug.yaml | 48 +++++++++++++++++++++++++++++++++ .github/workflows/build.yml | 13 +++++++++ CODEOWNERS | 2 ++ MAINTAINERS.md | 1 + Makefile | 2 +- README.md | 8 +++--- 6 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug.yaml create mode 100644 CODEOWNERS diff --git a/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug.yaml new file mode 100644 index 00000000..a2caeffe --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yaml @@ -0,0 +1,48 @@ +name: Bug Report +description: Report a bug encountered while using garm operator +body: + - type: textarea + id: problem + attributes: + label: What steps did you take and what happened? + description: | + Please provide as much info as possible about the problem. + placeholder: "A clear and concise description on how to REPRODUCE the bug." + validations: + required: true + + - type: textarea + id: expected + attributes: + label: What did you expect to happen? + validations: + required: true + + - type: textarea + id: garmVersion + attributes: + label: garm version + placeholder: "The version of garm used in your environment" + validations: + required: true + + - type: textarea + id: garmOperatorVersion + attributes: + label: garm-operator version + placeholder: "The version of garm-operator used in your environment." + validations: + required: true + + - type: textarea + id: kubeVersion + attributes: + label: Kubernetes version + placeholder: "$kubectl version" + validations: + required: true + + - type: textarea + id: additional + attributes: + label: Anything else you would like to add? diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae5395b1..52f37018 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,3 +35,16 @@ jobs: - name: make test run: make test + + - name: Install commitlint + run: | + npm install conventional-changelog-conventionalcommits + npm install commitlint@latest + + - name: Validate current commit (last commit) with commitlint + if: github.event_name == 'push' + run: npx commitlint --from HEAD~1 --to HEAD --verbose + + - name: Validate PR commits with commitlint + if: github.event_name == 'pull_request' + run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 00000000..519d0274 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: MIT +* @bavarianbidi @maigl \ No newline at end of file diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 0bc6b29c..40a32553 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -8,3 +8,4 @@ | Mario Constanti | | [bavarianbidi](https://github.com/bavarianbidi) | Mercedes-Benz Tech Innovation GmbH, [imprint](https://github.com/mercedes-benz/foss/blob/master/PROVIDER_INFORMATION.md) | 2023-07-27 | | Michael Kuhnt | | [maigl](https://github.com/maigl) | Mercedes-Benz Tech Innovation GmbH, [imprint](https://github.com/mercedes-benz/foss/blob/master/PROVIDER_INFORMATION.md) | 2023-07-27 | +> Please note to also update the [`CODEOWNERS`](CODEOWNERS) file. diff --git a/Makefile b/Makefile index 06e54d70..83adb856 100644 --- a/Makefile +++ b/Makefile @@ -197,7 +197,7 @@ $(GOLANGCI_LINT): $(LOCALBIN) .PHONY: mockgen mockgen: $(MOCKGEN) ## Download mockgen locally if necessary. If wrong version is installed, it will be overwritten. $(MOCKGEN): $(LOCALBIN) - test -s $(LOCALBIN)/golangci-lint && $(LOCALBIN)/golangci-lint --version | grep -q $(MOCKGEN_VERSION) || \ + test -s $(LOCALBIN)/mockgen && $(LOCALBIN)/mockget --version | grep -q $(MOCKGEN_VERSION) || \ GOBIN=$(LOCALBIN) go install go.uber.org/mock/mockgen@$(MOCKGEN_VERSION) .PHONY: goreleaser diff --git a/README.md b/README.md index 90dd3dee..7722364d 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,10 @@ We are releasing the `garm-operator` as container image together with the corres This manifests can be used to deploy the `garm-operator` into your Kubernetes cluster. ```bash -GARM_OPERATOR_VERSIOn= -GARM_SERVER_URL= -GARM_SERVER_USERNAME= -GARM_SERVER_PASSWORD= +export GARM_OPERATOR_VERSIOn= +export GARM_SERVER_URL= +export GARM_SERVER_USERNAME= +export GARM_SERVER_PASSWORD= curl -L https://github.com/mercedes-benz/garm-operator/releases/download/${GARM_OPERATOR_VERSION}/garm-operator-all.yaml | envsubst | kubectl apply -f - ```