From 2bfe422b649d2509f2ebe44cf2e1170b28e519ae Mon Sep 17 00:00:00 2001 From: Anne Schuth Date: Wed, 29 May 2024 21:21:30 +0200 Subject: [PATCH] Add all defaults --- .github/CODEOWNERS | 1 + .github/ISSUE_TEMPLATE/1-bug.yml | 59 +++++++++++++++++++++++++ .github/ISSUE_TEMPLATE/2-feature.yml | 49 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/dependabot.yml | 29 ++++++++++++ .github/pull_request_template.md | 19 ++++++++ .github/release.yml | 16 +++++++ .github/workflows/automerge.yml | 31 +++++++++++++ .github/workflows/codeql.yml | 38 ++++++++++++++++ .github/workflows/first-interaction.yml | 22 +++++++++ .github/workflows/stale.yml | 22 +++++++++ script/format | 3 ++ script/lint | 3 ++ 13 files changed, 293 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE/1-bug.yml create mode 100644 .github/ISSUE_TEMPLATE/2-feature.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/dependabot.yml create mode 100644 .github/pull_request_template.md create mode 100644 .github/release.yml create mode 100644 .github/workflows/automerge.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/first-interaction.yml create mode 100644 .github/workflows/stale.yml create mode 100755 script/format create mode 100755 script/lint diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..c0508e9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @MinBZK/ai-validation-team diff --git a/.github/ISSUE_TEMPLATE/1-bug.yml b/.github/ISSUE_TEMPLATE/1-bug.yml new file mode 100644 index 0000000..d6eea3a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-bug.yml @@ -0,0 +1,59 @@ +name: Bug Report +description: Let us know about an unexpected error, a crash, or an incorrect behavior. +labels: ["bug", "triage"] +body: + - type: markdown + attributes: + value: | + # Thank you for opening an issue. + + ## Filing a bug report + + To fix problems, we need clear reproduction cases. Please fill in the bug report as exact as possible to help us resolve the issue. + + - type: textarea + id: version + attributes: + label: Version + description: Specify the version of the software that you use + placeholder: 0.1.0 + value: + validations: + required: true + + - type: textarea + id: expected + attributes: + label: Expected Behavior + description: What should have happened? + placeholder: What should have happened? + value: + validations: + required: true + + - type: textarea + id: actual + attributes: + label: Actual Behavior + description: What actually happened? + placeholder: What actually happened? + value: + validations: + required: true + + - type: textarea + id: context + attributes: + label: Additional Context + description: | + Are there anything atypical about your situation that we should know? + placeholder: Additional context... + value: + validations: + required: false + + + - type: markdown + attributes: + value: | + **Note:** If the submit button is disabled and you have filled out all required fields, please check that you did not forget a **Title** for the issue. diff --git a/.github/ISSUE_TEMPLATE/2-feature.yml b/.github/ISSUE_TEMPLATE/2-feature.yml new file mode 100644 index 0000000..1c9594f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2-feature.yml @@ -0,0 +1,49 @@ +name: Feature Request +description: Suggest a new feature or other enhancement. +labels: ["enhancement", "triage"] +body: + - type: markdown + attributes: + value: | + # Thank you for opening a feature request. + + - type: textarea + id: version + attributes: + label: Version + description: Specify the version of the software that you use + placeholder: 0.1.0 + value: + validations: + required: true + + - type: textarea + id: use-case + attributes: + label: Use Cases + description: | + In order to properly evaluate a feature request, it is necessary to understand the use cases for it. + Please describe below the _end goal_ you are trying to achieve that has led you to request this feature. + Please keep this section focused on the problem and not on the suggested solution. We'll get to that in a moment, below! + placeholder: + value: + validations: + required: true + + - type: textarea + id: proposal + attributes: + label: Proposal + description: | + If you have an idea for a way to address the problem via a change to our product features, please describe it below. + If you're not sure of some details, don't worry! When we evaluate the feature request we may suggest modifications as necessary to work within the design constraints of OpenTofu Core. + placeholder: + value: + validations: + required: false + + + - type: markdown + attributes: + value: | + **Note:** If the submit button is disabled and you have filled out all required fields, please check that you did not forget a **Title** for the issue. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d24384c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,29 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + day: "monday" + time: "08:00" + timezone: "Europe/Amsterdam" + labels: + - "dependencies" + groups: + allgithubactions: + patterns: + - "*" + + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + day: "monday" + time: "08:00" + timezone: "Europe/Amsterdam" + labels: + - "dependencies" + groups: + allpippackages: + patterns: + - "*" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..068812e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,19 @@ +# Description + +Describe in detail the changes you are proposing, and the rationale. + +Link all GitHub issues fixed by this PR. +Make sure to first open an issue, get community approval and only then create Pull Request to resolve it. +All Pull Requests must have an issue attached to them + +Resolves # + +## Checklist + +Please check all the boxes that apply to this pull request using "x": + +- [ ] I have tested the changes locally and verified that they work as expected. +- [ ] I have followed the project's coding conventions and style guidelines. +- [ ] I have rebased my branch onto the latest commit of the main branch. +- [ ] I have squashed or reorganized my commits into logical units. +- [ ] I have read, understood and agree to the [Developer Certificate of Origin](../blob/main/DCO.md), which this project utilizes. diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..14adb4d --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,16 @@ +changelog: + exclude: + labels: + - ignore-for-release + authors: + - dependabot[bot] + categories: + - title: Breaking Changes 🛠 + labels: + - breaking-change + - title: Exciting New Features 🎉 + labels: + - enhancement + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..210ba78 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,31 @@ +name: AutoMerge +on: pull_request + + +jobs: + automerge: + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + permissions: + contents: write + pull-requests: write + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: Enable Auto-Approve for Dependabot PRs + if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch' + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - name: Enable auto-merge for Dependabot PRs + if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch' + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..dde4191 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,38 @@ +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: 'ubuntu-latest' + timeout-minutes: 360 + permissions: + security-events: write + packages: read + actions: read + contents: read + strategy: + fail-fast: false + matrix: + include: + - language: python + build-mode: none + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/first-interaction.yml b/.github/workflows/first-interaction.yml new file mode 100644 index 0000000..0ea633c --- /dev/null +++ b/.github/workflows/first-interaction.yml @@ -0,0 +1,22 @@ +name: Greetings + +on: [pull_request, issues] + +jobs: + greeting: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: | + Welcome to our community :hugs: and thank you for your first contribution. + + As a first time contributor please make sure to review our [contribution guidelines](../blob/main/CONTRIBUTING.md) :heart: + pr-message: | + Welcome to our community :hugs: and thank you for your first contribution. + + As a first time contributor please make sure to review our [contribution guidelines](../blob/main/CONTRIBUTING.md) :heart: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..052e75f --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,22 @@ +name: "Close stale" +on: + schedule: + - cron: "0 4 * * *" + workflow_dispatch: + +jobs: + stale: + runs-on: ubuntu-latest + permissions: + contents: write # only for delete-branch option + issues: write + pull-requests: write + steps: + - uses: actions/stale@v9 + with: + days-before-stale: 90 + days-before-close: 30 + stale-issue-message: "This issue did not have any activity in the last 90 days and will be removed after 30 days" + stale-pr-message: "This PR did not have any activity in the last 90 days and will be removed after 30 days" + close-pr-message: "This PR is closed due to inactivity" + close-issue-message: "This issue is closed due to inactivity" diff --git a/script/format b/script/format new file mode 100755 index 0000000..a0297e8 --- /dev/null +++ b/script/format @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +ruff format $@ diff --git a/script/lint b/script/lint new file mode 100755 index 0000000..a993d18 --- /dev/null +++ b/script/lint @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +ruff check --fix $@