From c03c8b1c095fa2d733a5622b97e11e2684f47730 Mon Sep 17 00:00:00 2001 From: Charpa <102919164+jbcaron@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:33:10 +0100 Subject: [PATCH] chore(ci): add labels sync workflow (#452) --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/config/labels.yml | 93 +++++++++++++++++++++++++++++++ .github/labels.yml | 87 ----------------------------- .github/workflows/db-version.yml | 2 +- .github/workflows/sync-labels.yml | 26 +++++++++ scripts/update-db-version.sh | 2 +- 6 files changed, 122 insertions(+), 90 deletions(-) create mode 100644 .github/config/labels.yml delete mode 100644 .github/labels.yml create mode 100644 .github/workflows/sync-labels.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5b3c07739..9bf6d8d28 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -34,7 +34,7 @@ Resolves: #NA diff --git a/.github/config/labels.yml b/.github/config/labels.yml new file mode 100644 index 000000000..e31861489 --- /dev/null +++ b/.github/config/labels.yml @@ -0,0 +1,93 @@ +--- +# Issue Types - Core labels for issue categorization +- name: bug + color: d73a4a + description: Report an issue or unexpected behavior +- name: feature + color: a2eeef + description: Request for new feature or enhancement + aliases: [enhancement] +- name: question + color: d876e3 + description: Request for information or clarification + +# Development Status - Progress tracking +- name: research + color: 0890c3 + description: Research and exploration required before implementation + aliases: [exploration] +- name: wont-fix + color: ffffff + description: This will not be worked on or fixed + aliases: [wontfix] +- name: stale + color: ededed + description: No activity for a long period + +# Quality & Testing - Code quality related labels +- name: code-quality + color: c5def5 + description: Improvements to code structure and quality + aliases: [code quality] +- name: testing + color: 1d76db + description: Related to tests and test infrastructure + aliases: [tests] +- name: docs + color: 0075ca + description: Documentation changes or improvements + aliases: [documentation] +- name: performance + color: fef2c0 + description: Performance improvements or optimizations + aliases: + - perf + +# Component Specific - Labels for specific components +- name: node + color: 2cbe4e + description: Related to the full node implementation + aliases: [full node] +- name: sequencer + color: d93f0b + description: Related to the sequencing logic and implementation +- name: infrastructure + color: c2e0c6 + description: CI/CD, deployment and infrastructure changes + aliases: + - infra + +# Version & Features Tracking - Version and feature specific labels +- name: v0.13.2 + color: b104c2 + description: Related to version 0.13.2 + aliases: [0.13.2] +- name: db-migration + color: ee0701 + description: Requires database schema changes or migration + aliases: [bump_db] +- name: rpc-v0.8.0 + color: 53112f + description: Implementation of RPC specification v0.8.0 + aliases: + - rpc-0.8.0 + +# Issue Management - Issue workflow labels +- name: help-wanted + color: 008672 + description: Looking for contributors to help with this + aliases: [help wanted] +- name: duplicate + color: cfd3d7 + description: Similar issue or PR already exists +- name: invalid + color: e4e669 + description: This issue or PR is not applicable +# ---------------------------------------- +# Color Scheme Reference: +# - Reds (d73a4a, ee0701) for critical/blocking issues +# - Blues (0075ca, 1d76db) for technical tasks +# - Greens (2cbe4e, c2e0c6) for components +# - Purples (b104c2, d876e3) for versions/questions +# - Yellows (e4e669, fef2c0) for warnings/performance +# - Grays (ededed, ffffff) for workflow status diff --git a/.github/labels.yml b/.github/labels.yml deleted file mode 100644 index 20c2550b2..000000000 --- a/.github/labels.yml +++ /dev/null @@ -1,87 +0,0 @@ ---- -- name: "breaking-change" - color: ee0701 - description: "A change that changes the API or breaks backward compatibility for users." -- name: "bump_db" - color: ee0701 - description: "Changes requiring a database version increment." -- name: "bugfix" - color: ee0701 - description: - "Inconsistencies or issues which will cause a problem for users or - implementors." -- name: "documentation" - color: 0052cc - description: "Solely about the documentation of the project." -- name: "enhancement" - color: 1d76db - description: "Enhancement of the code, not introducing new features." -- name: "refactor" - color: 1d76db - description: - "Updating the code with simpler, easier to understand or more efficient - syntax or methods, but not introducing new features." -- name: "performance" - color: 1d76db - description: "Improving performance of the project, not introducing new features." -- name: "new-feature" - color: 0e8a16 - description: "New features or options." -- name: "maintenance" - color: 2af79e - description: "Generic maintenance tasks." -- name: "ci" - color: 1d76db - description: "Work that improves the continuous integration." -- name: "dependencies" - color: 1d76db - description: "Change in project dependencies." - -- name: "in-progress" - color: fbca04 - description: "Issue is currently being worked on by a developer." -- name: "stale" - color: fef2c0 - description: "No activity for quite some time." -- name: "no-stale" - color: fef2c0 - description: "This is exempt from the stale bot." - -- name: "security" - color: ee0701 - description: "Addressing a vulnerability or security risk in this project." -- name: "incomplete" - color: fef2c0 - description: "Missing information." -- name: "invalid" - color: fef2c0 - description: "This is off-topic, spam, or otherwise doesn't apply to this project." - -- name: "beginner-friendly" - color: 0e8a16 - description: "Good first issue for people wanting to contribute to this project." -- name: "help-wanted" - color: 0e8a16 - description: "We need some extra helping hands or expertise in order to resolve this!" - -- name: "priority-critical" - color: ee0701 - description: "Must be addressed as soon as possible." -- name: "priority-high" - color: b60205 - description: - "After critical issues are fixed, these should be dealt with before any - further issues." -- name: "priority-medium" - color: 0e8a16 - description: "This issue may be useful, and needs some attention." -- name: "priority-low" - color: e4ea8a - description: "Nice addition, maybe... someday..." - -- name: "major" - color: b60205 - description: "This PR causes a major bump in the version number." -- name: "minor" - color: 0e8a16 - description: "This PR causes a minor bump in the version number." diff --git a/.github/workflows/db-version.yml b/.github/workflows/db-version.yml index b64c83fb8..b2d2b9554 100644 --- a/.github/workflows/db-version.yml +++ b/.github/workflows/db-version.yml @@ -8,7 +8,7 @@ on: jobs: update-db-version: runs-on: ubuntu-latest - if: contains(github.event.pull_request.labels.*.name, 'bump_db') + if: contains(github.event.pull_request.labels.*.name, 'db-migration') steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml new file mode 100644 index 000000000..425baea09 --- /dev/null +++ b/.github/workflows/sync-labels.yml @@ -0,0 +1,26 @@ +name: Sync labels +on: + push: + branches: + - main + paths: + - ".github/labels.yml" + workflow_dispatch: + +permissions: + issues: write + +jobs: + labels: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + sparse-checkout: .github/config/labels.yml + + - uses: EndBug/label-sync@v2 + with: + config-file: .github/config/labels.yml + delete-other-labels: true + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/update-db-version.sh b/scripts/update-db-version.sh index 4d01023b7..a57bb2b5a 100755 --- a/scripts/update-db-version.sh +++ b/scripts/update-db-version.sh @@ -4,7 +4,7 @@ # Database version management script # # This script updates the database version tracking file when schema changes occur. -# It's typically called by CI when a PR with the 'bump_db' label is merged. +# It's typically called by CI when a PR with the 'db-migration' label is merged. # # Requirements: yq (https://github.com/mikefarah/yq/) #