feat: github repo setup
A few changes to setup the GitHub repo for future contribution. Includes: - GHA workflow for labeling PRs based on size - GHA workflow that requires a kind/* label on PRs - GHA workflow for marking issues/prs as stale - GHA workflow for running tests on PRs (i.e. build, test, verify) - Dependabot configuration - GitHub release notes configuration Labels have also been created in the repo and these are used in the above. NOTE: the `make test` has been commented out from the tests for the time being until the tests have been fixed. Signed-off-by: Richard Case <richard.case@outlook.com>
This commit is contained in:
parent
581e8caadf
commit
02c965f113
|
|
@ -0,0 +1,3 @@
|
||||||
|
@richardcase
|
||||||
|
@alexander-demicev
|
||||||
|
@belgaied2
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Tell us about a problem you are experiencing
|
||||||
|
title: ''
|
||||||
|
labels: kind/bug, needs-priority, needs-triage
|
||||||
|
assignees: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
**What happened:**
|
||||||
|
[A clear and concise description of what the bug is.]
|
||||||
|
|
||||||
|
**What did you expect to happen:**
|
||||||
|
|
||||||
|
**How to reproduce it:**
|
||||||
|
|
||||||
|
**Anything else you would like to add:**
|
||||||
|
[Miscellaneous information that will assist in solving the issue.]
|
||||||
|
|
||||||
|
**Environment:**
|
||||||
|
|
||||||
|
- rke provider version:
|
||||||
|
- OS (e.g. from `/etc/os-release`):
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for the RKE2 Provider
|
||||||
|
title: ''
|
||||||
|
labels: kind/feature, needs-priority, needs-triage
|
||||||
|
assigness: ''
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the solution you'd like:**
|
||||||
|
[A clear and concise description of what you want to happen.]
|
||||||
|
|
||||||
|
**Why do you want this feature:**
|
||||||
|
|
||||||
|
**Anything else you would like to add:**
|
||||||
|
[Miscellaneous information that will assist in solving the issue.]
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<!--
|
||||||
|
Label the PR with the kind of change this for:
|
||||||
|
|
||||||
|
kind/feature
|
||||||
|
kind/bug
|
||||||
|
kind/documentation
|
||||||
|
kind/regression
|
||||||
|
kind/*
|
||||||
|
-->
|
||||||
|
|
||||||
|
**What this PR does / why we need it**:
|
||||||
|
|
||||||
|
<!-- Enter a description of the change and why this change is needed -->
|
||||||
|
|
||||||
|
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
|
||||||
|
Fixes #
|
||||||
|
|
||||||
|
**Special notes for your reviewer**:
|
||||||
|
|
||||||
|
**Checklist**:
|
||||||
|
<!-- Put an "X" character inside the brackets of each completed task. Some may be optional depending on the PR in which case these can be deleted -->
|
||||||
|
|
||||||
|
- [ ] squashed commits into logical changes
|
||||||
|
- [ ] includes documentation
|
||||||
|
- [ ] adds unit tests
|
||||||
|
- [ ] adds or updates e2e tests
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "gomod"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
labels:
|
||||||
|
- "kind/cleanup"
|
||||||
|
- "area/dependency"
|
||||||
|
- package-ecosystem: "docker"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
labels:
|
||||||
|
- "kind/cleanup"
|
||||||
|
- "area/build-and-release"
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
labels:
|
||||||
|
- "kind/cleanup"
|
||||||
|
- "area/build-and-release"
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
changelog:
|
||||||
|
categories:
|
||||||
|
- title: 🚀 Enhancements
|
||||||
|
labels:
|
||||||
|
- kind/feature
|
||||||
|
- title: 🐛 Bugs
|
||||||
|
labels:
|
||||||
|
- kind/bug
|
||||||
|
- kind/regression
|
||||||
|
- title: 📖 Docs
|
||||||
|
labels:
|
||||||
|
- kind/documentation
|
||||||
|
- title: Other Changes
|
||||||
|
labels:
|
||||||
|
- "*"
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
name: golangci-lint
|
name: lint
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
@ -11,19 +11,11 @@ jobs:
|
||||||
golangci:
|
golangci:
|
||||||
name: lint
|
name: lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
working-directory:
|
|
||||||
- ""
|
|
||||||
- test
|
|
||||||
- hack/tools
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.19
|
go-version: 1.19
|
||||||
- name: golangci-lint
|
- name: Lint
|
||||||
uses: golangci/golangci-lint-action@v3.2.0
|
run: make lint
|
||||||
with:
|
|
||||||
version: v1.49.0
|
|
||||||
working-directory: ${{matrix.working-directory}}
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
name: pr_size_labeler
|
||||||
|
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
labeler:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Label the PR size
|
||||||
|
steps:
|
||||||
|
- uses: codelytv/pr-size-labeler@v1
|
||||||
|
with:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
xs_max_size: '50'
|
||||||
|
s_max_size: '200'
|
||||||
|
m_max_size: '100'
|
||||||
|
l_max_size: '2000'
|
||||||
|
fail_if_xl: 'false'
|
||||||
|
message_if_xl: >
|
||||||
|
This PR exceeds the recommended max size of 2000 lines.
|
||||||
|
Please make sure you are NOT addressing multiple issues with one PR
|
||||||
|
and split it up if possible 😊
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
name: pr_type
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
- labeled
|
||||||
|
- unlabeled
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check_pull_request_type:
|
||||||
|
name: Check for PR kind
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: docker://agilepathway/pull-request-label-checker:latest
|
||||||
|
with:
|
||||||
|
one_of: kind/bug,kind/documentation,kind/feature,kind/regression,kind/refactor,kind/cleanup,kind/proposal
|
||||||
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
name: Mark stale issues and pull requests
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '15 7 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v6
|
||||||
|
with:
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
days-before-issue-stale: 90
|
||||||
|
days-before-pr-stale: 90
|
||||||
|
days-before-issue-close: 365
|
||||||
|
days-before-pr-close: -1
|
||||||
|
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity.'
|
||||||
|
stale-issue-label: 'lifecycle/stale'
|
||||||
|
stale-pr-message: 'This PR is stale because it has been open 90 days with no activity.'
|
||||||
|
stale-pr-label: 'lifecycle/stale'
|
||||||
|
close-issue-message: 'This issue was closed because it has been stalled for 365 days with no activity.'
|
||||||
|
close-issue-label: 'lifecycle/rotten'
|
||||||
|
exempt-issue-labels: 'lifecycle/frozen'
|
||||||
|
exempt-pr-labels: 'lifecycle/frozen'
|
||||||
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
name: run tests
|
||||||
|
|
||||||
|
on: [pull_request, workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: '1.19'
|
||||||
|
check-latest: true
|
||||||
|
cache: true
|
||||||
|
- name: Verify
|
||||||
|
run: make verify
|
||||||
|
- name: Build
|
||||||
|
run: make managers
|
||||||
|
# When make test is fixed we can re-enabled this
|
||||||
|
#- name: Test
|
||||||
|
# run: make test
|
||||||
11
Makefile
11
Makefile
|
|
@ -93,6 +93,7 @@ GO_APIDIFF_PKG := github.com/joelanford/go-apidiff
|
||||||
HADOLINT_VER := v2.10.0
|
HADOLINT_VER := v2.10.0
|
||||||
HADOLINT_FAILURE_THRESHOLD = warning
|
HADOLINT_FAILURE_THRESHOLD = warning
|
||||||
|
|
||||||
|
GOLANGCI_LINT_VER := v1.49.0
|
||||||
GOLANGCI_LINT_BIN := golangci-lint
|
GOLANGCI_LINT_BIN := golangci-lint
|
||||||
GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN))
|
GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN))
|
||||||
|
|
||||||
|
|
@ -159,7 +160,7 @@ generate-manifests-rke2-bootstrap: $(CONTROLLER_GEN) ## Generate manifests e.g.
|
||||||
|
|
||||||
.PHONY: generate-manifests-rke2-control-plane
|
.PHONY: generate-manifests-rke2-control-plane
|
||||||
generate-manifests-rke2-control-plane: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc. for RKE2 control plane provider
|
generate-manifests-rke2-control-plane: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc. for RKE2 control plane provider
|
||||||
$(MAKE) clean-generated-yaml SRC_DIRS="./controlplane/rke2/config/crd/bases"
|
$(MAKE) clean-generated-yaml SRC_DIRS="./controlplane/config/crd/bases"
|
||||||
$(CONTROLLER_GEN) \
|
$(CONTROLLER_GEN) \
|
||||||
paths=./controlplane/api/... \
|
paths=./controlplane/api/... \
|
||||||
paths=./controlplane/internal/controllers/... \
|
paths=./controlplane/internal/controllers/... \
|
||||||
|
|
@ -202,8 +203,8 @@ generate-modules: ## Run go mod tidy to ensure modules are up to date
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: $(GOLANGCI_LINT) ## Lint the codebase
|
lint: $(GOLANGCI_LINT) ## Lint the codebase
|
||||||
cd $(CAPBPR_DIR); $(GOLANGCI_LINT) run -v $(GOLANGCI_LINT_EXTRA_ARGS)
|
cd $(CAPBPR_DIR); $(GOLANGCI_LINT) run -v --timeout 3m $(GOLANGCI_LINT_EXTRA_ARGS)
|
||||||
cd $(CAPRKE2_DIR); $(GOLANGCI_LINT) run -v $(GOLANGCI_LINT_EXTRA_ARGS)
|
cd $(CAPRKE2_DIR); $(GOLANGCI_LINT) run -v --timeout 3m $(GOLANGCI_LINT_EXTRA_ARGS)
|
||||||
./scripts/ci-lint-dockerfiles.sh $(HADOLINT_VER) $(HADOLINT_FAILURE_THRESHOLD)
|
./scripts/ci-lint-dockerfiles.sh $(HADOLINT_VER) $(HADOLINT_FAILURE_THRESHOLD)
|
||||||
|
|
||||||
.PHONY: lint-dockerfiles
|
.PHONY: lint-dockerfiles
|
||||||
|
|
@ -531,10 +532,10 @@ $(KUSTOMIZE): # Build kustomize from tools folder.
|
||||||
$(SETUP_ENVTEST): # Build setup-envtest from tools folder.
|
$(SETUP_ENVTEST): # Build setup-envtest from tools folder.
|
||||||
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(SETUP_ENVTEST_PKG) $(SETUP_ENVTEST_BIN) $(SETUP_ENVTEST_VER)
|
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(SETUP_ENVTEST_PKG) $(SETUP_ENVTEST_BIN) $(SETUP_ENVTEST_VER)
|
||||||
|
|
||||||
$(GOLANGCI_LINT): .github/workflows/golangci-lint.yml # Download golangci-lint using hack script into tools folder.
|
$(GOLANGCI_LINT): # Download and install golangci-lint
|
||||||
hack/ensure-golangci-lint.sh \
|
hack/ensure-golangci-lint.sh \
|
||||||
-b $(TOOLS_BIN_DIR) \
|
-b $(TOOLS_BIN_DIR) \
|
||||||
$(shell cat .github/workflows/golangci-lint.yml | grep [[:space:]]version | sed 's/.*version: //')
|
$(GOLANGCI_LINT_VER)
|
||||||
|
|
||||||
$(GH): # Download GitHub cli into the tools bin folder
|
$(GH): # Download GitHub cli into the tools bin folder
|
||||||
hack/ensure-gh.sh \
|
hack/ensure-gh.sh \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue