From f8fcfa0dbd51d099b3ba2adb3921eb21caa67162 Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Mon, 15 Jul 2024 09:02:52 -0400 Subject: [PATCH 1/2] cicd: update github workflows/templates (#284) --- .github/ISSUE_TEMPLATE/bug-report.yaml | 85 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature-request.yaml | 60 +++++++++++++++ .github/workflows/backend_checks.yml | 6 +- .github/workflows/pr-priority-label.yaml | 23 ++++++ .github/workflows/stale.yaml | 27 +++++++ 5 files changed, 198 insertions(+), 3 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug-report.yaml create mode 100644 .github/ISSUE_TEMPLATE/feature-request.yaml create mode 100644 .github/workflows/pr-priority-label.yaml create mode 100644 .github/workflows/stale.yaml diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml new file mode 100644 index 00000000..5b3f7c8d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -0,0 +1,85 @@ +name: Bug Report +description: Report a bug. +labels: ["bug"] +body: + - type: textarea + attributes: + label: Describe the bug + description: Provide a clear and concise description of what the bug is. + validations: + required: true + - type: textarea + attributes: + label: Steps to reproduce + description: Provide detailed steps to replicate the bug. + placeholder: | + 1. In this environment... + 2. With this config... + 3. Run '...' + 4. See error... + validations: + required: true + - type: textarea + attributes: + label: Expected behavior + description: What did you expect to happen? + validations: + required: true + - type: textarea + attributes: + label: Current behavior + description: | + What actually happened? + + Include full errors, stack traces, and/or relevant logs. + validations: + required: true + - type: textarea + attributes: + label: Possible reason(s) + description: Provide any insights into what might be causing the issue. + validations: + required: false + - type: textarea + attributes: + label: Suggested fix + description: Provide any suggestions on how to resolve the bug. + validations: + required: false + - type: textarea + attributes: + label: Branch, commit, and/or version + description: Provide the branch, commit, and/or version you're using. + placeholder: | + branch: issue-1 + commit: abc123d + validations: + required: true + - type: textarea + attributes: + label: Screenshots + description: If applicable, add screenshots with descriptions to help explain your problem. + validations: + required: false + - type: textarea + attributes: + label: Environment details + description: Provide environment details (OS name and version, etc). + validations: + required: true + - type: textarea + attributes: + label: Additional details + description: Provide any other additional details about the problem. + validations: + required: false + - type: dropdown + attributes: + label: Contribution + description: Can you contribute to the development of this feature? + options: + - "Yes, I can create a PR for this fix." + - "Yes, but I can only provide ideas and feedback." + - "No, I cannot contribute." + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature-request.yaml b/.github/ISSUE_TEMPLATE/feature-request.yaml new file mode 100644 index 00000000..2e1ae644 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yaml @@ -0,0 +1,60 @@ +name: Feature Request +description: Suggest an idea for this project. +labels: ["enhancement"] +body: + - type: textarea + attributes: + label: Feature description + description: Provide a clear and concise description of what you want to happen. + validations: + required: true + - type: textarea + attributes: + label: Use case + description: | + Why do you need this feature? For example: "I'm always frustrated when..." + validations: + required: true + - type: textarea + attributes: + label: Proposed solution + description: Provide proposed solution. + validations: + required: false + - type: textarea + attributes: + label: Alternatives considered + description: Describe any alternative solutions you've considered. + validations: + required: false + - type: textarea + attributes: + label: Implementation details + description: Provide any technical details on how the feature might be implemented. + validations: + required: false + - type: textarea + attributes: + label: Potential Impact + description: | + Discuss any potential impacts of this feature on existing functionality or performance, if known. + Will this feature cause breaking changes? + What challenges might arise? + validations: + required: false + - type: textarea + attributes: + label: Additional context + description: Provide any other context or screenshots about the feature. + validations: + required: false + - type: dropdown + attributes: + label: Contribution + description: Can you contribute to the development of this feature? + options: + - "Yes, I can create a PR for this feature." + - "Yes, but I can only provide ideas and feedback." + - "No, I cannot contribute." + validations: + required: false diff --git a/.github/workflows/backend_checks.yml b/.github/workflows/backend_checks.yml index dec028d0..6f243f49 100644 --- a/.github/workflows/backend_checks.yml +++ b/.github/workflows/backend_checks.yml @@ -7,8 +7,8 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: 3.11 @@ -18,7 +18,7 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: black uses: psf/black@stable diff --git a/.github/workflows/pr-priority-label.yaml b/.github/workflows/pr-priority-label.yaml new file mode 100644 index 00000000..0bef462d --- /dev/null +++ b/.github/workflows/pr-priority-label.yaml @@ -0,0 +1,23 @@ +name: Pull Request Has Priority Label +on: + pull_request: + types: [opened, labeled, unlabeled, synchronize] +jobs: + pr-priority-label: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + outputs: + status: ${{ steps.check-labels.outputs.status }} + steps: + - id: check-labels + uses: mheap/github-action-required-labels@v5 + with: + mode: exactly + count: 1 + labels: "priority:*" + use_regex: true + add_comment: true + message: "PRs require a priority label. Please add one." + exit_type: failure diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 00000000..6a7b1339 --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,27 @@ +name: "Stalebot for issues and PRs" + +on: + schedule: + - cron: "30 13 * * 1-5" + +jobs: + stale-high-priority: + uses: genomicmedlab/software-templates/.github/workflows/reusable-stale.yaml + with: + days-before-issue-stale: 90 + days-before-pr-stale: 1 + labels: priority:high + + stale-medium-priority: + uses: genomicmedlab/software-templates/.github/workflows/reusable-stale.yaml + with: + days-before-issue-stale: 135 + days-before-pr-stale: 3 + labels: priority:medium + + stale-low-priority: + uses: genomicmedlab/software-templates/.github/workflows/reusable-stale.yaml + with: + days-before-issue-stale: 180 + days-before-pr-stale: 7 + labels: priority:low From 2548408285248afcc39fcfecab4e5969edfe28b5 Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Mon, 15 Jul 2024 09:03:04 -0400 Subject: [PATCH 2/2] cicd: update precommit (#286) --- .pre-commit-config.yaml | 6 ++++-- server/setup.cfg | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c1a48b23..5ebc9143 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,13 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v1.4.0 + rev: v4.6.0 # pre-commit-hooks version hooks: - id: check-added-large-files - args: ["--maxkb=2000"] - id: detect-private-key - id: trailing-whitespace - id: end-of-file-fixer + - id: check-merge-conflict + - id: detect-aws-credentials - repo: https://github.com/psf/black rev: 23.7.0 hooks: @@ -34,3 +35,4 @@ repos: rev: "v2.7.1" hooks: - id: prettier +minimum_pre_commit_version: 3.7.1 diff --git a/server/setup.cfg b/server/setup.cfg index cb825e63..f5a8b3ad 100644 --- a/server/setup.cfg +++ b/server/setup.cfg @@ -35,7 +35,7 @@ dev = psycopg2-binary ruff black - pre-commit + pre-commit >= 3.7.1 gene-normalizer ~= 0.1.39 pydantic-to-typescript