From 581f26f562aebb1cf6907942ed3045436db700f4 Mon Sep 17 00:00:00 2001 From: "M.V. Hutz" Date: Fri, 3 Apr 2026 13:46:05 +0000 Subject: [PATCH] ci: support semantic versioning, conventional commits (#15) ## Description Currently, the repository is not well suited for semantic versioning, and hasn't much to support it. This PR adds templates, CI jobs, and configs to simplify its adoption. ## Changes - Added `FEATURE` and `BUG` issue templates. Also, forbids free-form issues. - Adds a PR template. - Adds a CI job to ensure the commit title follows conventional commits. ### Design Decisions N/A. ## Checklist - [x] Tests pass - [x] Docs updated Reviewed-on: https://git.maximhutz.com/tools/go-cuckoo/pulls/15 Co-authored-by: M.V. Hutz Co-committed-by: M.V. Hutz --- .gitea/ISSUE_TEMPLATE/BUG_REPORT.yml | 26 +++++++++++++ .gitea/ISSUE_TEMPLATE/FEATURE_REQUEST.yml | 45 +++++++++++++++++++++++ .gitea/ISSUE_TEMPLATE/config.yml | 2 + .gitea/PULL_REQUEST_TEMPLATE.md | 17 +++++++++ .gitea/workflows/ci.yml | 11 ++++++ 5 files changed, 101 insertions(+) create mode 100644 .gitea/ISSUE_TEMPLATE/BUG_REPORT.yml create mode 100644 .gitea/ISSUE_TEMPLATE/FEATURE_REQUEST.yml create mode 100644 .gitea/ISSUE_TEMPLATE/config.yml create mode 100644 .gitea/PULL_REQUEST_TEMPLATE.md diff --git a/.gitea/ISSUE_TEMPLATE/BUG_REPORT.yml b/.gitea/ISSUE_TEMPLATE/BUG_REPORT.yml new file mode 100644 index 0000000..8868ab6 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/BUG_REPORT.yml @@ -0,0 +1,26 @@ +# yaml-language-server: $schema=https://www.schemastore.org/gitea-issue-forms.json +name: 🐛 Bug Report +about: Report a bug in this project +title: "[BUG]: " +body: + - type: textarea + id: context + attributes: + label: Context + description: What circumstances led to the bug? + validations: + required: true + - type: textarea + id: expected-behavior + attributes: + label: Expected Behavior + description: What did you expect would happen? + validations: + required: true + - type: textarea + id: actual-behavior + attributes: + label: Actual Behavior + description: What happened, and why was it unexpected? + validations: + required: true diff --git a/.gitea/ISSUE_TEMPLATE/FEATURE_REQUEST.yml b/.gitea/ISSUE_TEMPLATE/FEATURE_REQUEST.yml new file mode 100644 index 0000000..2473b0d --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/FEATURE_REQUEST.yml @@ -0,0 +1,45 @@ +# 'Feature Request Template' By @cheehwatang +# https://github.com/cheehwatang/.github/blob/master/.github/ISSUE_TEMPLATE/feature_request.yml +# +# yaml-language-server: $schema=https://www.schemastore.org/gitea-issue-forms.json +name: ✨ Feature Request +about: Suggest an idea for this project +title: "[FEATURE]: " +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this feature request! 🤗 + + Please make sure this feature request hasn't been already submitted by + someone by looking through other open/closed issues. 😃 + - type: dropdown + attributes: + multiple: false + label: Type of Feature + description: Select the type of feature request. + options: + - "✨ New Feature" + - "📝 Documentation" + - "🎨 Style and UI" + - "🔨 Code Refactor" + - "⚡ Performance Improvements" + - "✅ New Test" + validations: + required: true + - type: textarea + id: description + attributes: + label: Description + description: | + Give us a brief description of the feature or enhancement you would + like! + validations: + required: true + - type: textarea + id: additional-information + attributes: + label: Additional Information + description: | + Give us some additional information on the feature request like proposed + solutions, links, screenshots, etc. diff --git a/.gitea/ISSUE_TEMPLATE/config.yml b/.gitea/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..f2ee47f --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,2 @@ +# yaml-language-server: $schema=https://www.schemastore.org/gitea-issue-config.json +blank_issues_enabled: true \ No newline at end of file diff --git a/.gitea/PULL_REQUEST_TEMPLATE.md b/.gitea/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..0ee865f --- /dev/null +++ b/.gitea/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,17 @@ +--- +name: "New Pull Request" +about: "Standard PR template" +title: "" +ref: "main" +--- + +## Description + +## Changes + +### Design Decisions + +## Checklist + +- [ ] Tests pass +- [ ] Docs updated diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 5985296..b0ef1f8 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -6,6 +6,17 @@ on: pull_request: jobs: + check-pr-title: + name: Check PR Title + runs-on: ubuntu-latest + steps: + - run: | + TITLE="${{ gitea.event.pull_request.title }}" + if ! echo "$TITLE" | grep -qE '^(WIP: )?(feat|fix|docs|chore|ci|test|refactor|perf|build|style|revert)(\(.+\))?(!)?: .+'; then + echo "::error::Pull Request title must follow conventional commits" + exit 1 + fi + lint-go: name: Go Lint runs-on: ubuntu-latest