From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- .github/workflows/create-backport-trackers.yml | 50 ++++++++++++++++++++++ .github/workflows/needs-rebase.yml | 18 ++++++++ .github/workflows/pr-check-deps.yml | 10 +++++ .github/workflows/pr-checklist.yml | 19 +++++++++ .github/workflows/pr-triage.yml | 28 +++++++++++++ .github/workflows/stale.yml | 58 ++++++++++++++++++++++++++ 6 files changed, 183 insertions(+) create mode 100644 .github/workflows/create-backport-trackers.yml create mode 100644 .github/workflows/needs-rebase.yml create mode 100644 .github/workflows/pr-check-deps.yml create mode 100644 .github/workflows/pr-checklist.yml create mode 100644 .github/workflows/pr-triage.yml create mode 100644 .github/workflows/stale.yml (limited to '.github/workflows') diff --git a/.github/workflows/create-backport-trackers.yml b/.github/workflows/create-backport-trackers.yml new file mode 100644 index 000000000..b3525d9e9 --- /dev/null +++ b/.github/workflows/create-backport-trackers.yml @@ -0,0 +1,50 @@ +--- +name: Create backport trackers for trackers in "Pending Backport" state +on: + # To manually trigger this: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + inputs: + issues: + description: 'whitespace-separated list of issue numbers' + type: string + default: '' + debug: + description: '--debug: Show debug-level messages' + default: false + type: boolean + resolveParent: + description: '--resolve-parent: Resolve parent issue if all backports resolved/rejected' + default: false + type: boolean + force: + description: > + --force: When issue numbers provided, process them even if not in + 'Pending Backport' status. + Otherwise, process all issues in 'Pending Backport' status even if + already processed (tag 'backport_processed' added)' + default: false + type: boolean + dryRun: + description: '--dry-run: Do not write anything to Redmine' + default: false + type: boolean + schedule: + # Every 5 minutes: https://crontab.guru/every-5-minutes + - cron: '*/5 * * * *' +jobs: + create-backports: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + steps: + - uses: Bhacaz/checkout-files@e3e34e7daef91a5f237485bb88a260aee4be29dd + with: + files: src/script/backport-create-issue src/script/requirements.backport-create-issue.txt + - uses: actions/setup-python@v4 + with: + python-version: '>=3.6' + cache: 'pip' + cache-dependency-path: src/script/requirements.backport-create-issue.txt + - run: pip install -r src/script/requirements.backport-create-issue.txt + - run: python3 src/script/backport-create-issue ${{ inputs.debug && '--debug' || '' }} ${{ inputs.resolveParent && '--resolve-parent' || '' }} ${{ inputs.force && '--force' || '' }} ${{ inputs.dryRun && '--dry-run' || '' }} ${{ inputs.issues }} + env: + REDMINE_API_KEY: ${{ secrets.REDMINE_API_KEY_BACKPORT_BOT }} diff --git a/.github/workflows/needs-rebase.yml b/.github/workflows/needs-rebase.yml new file mode 100644 index 000000000..d9e2c706f --- /dev/null +++ b/.github/workflows/needs-rebase.yml @@ -0,0 +1,18 @@ +--- +name: "Pull Request Needs Rebase?" +on: + pull_request_target: + types: [opened, synchronize, reopened] +jobs: + needs-rebase: + runs-on: ubuntu-latest + steps: + # eps1lon/actions-label-merge-conflict@v2.0.1 + # (NOTE: pinning the action to a given commit is a security best-practice: + # https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions) + - name: Check if PR needs rebase + uses: eps1lon/actions-label-merge-conflict@b8bf8341285ec9a4567d4318ba474fee998a6919 + with: + repoToken: "${{ secrets.GITHUB_TOKEN }}" + dirtyLabel: "needs-rebase" + commentOnDirty: "This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved" diff --git a/.github/workflows/pr-check-deps.yml b/.github/workflows/pr-check-deps.yml new file mode 100644 index 000000000..7815b8fe4 --- /dev/null +++ b/.github/workflows/pr-check-deps.yml @@ -0,0 +1,10 @@ +name: Check PR dependencies +on: [pull_request_target] +jobs: + check_dependencies: + runs-on: ubuntu-latest + name: Check PR Dependencies + steps: + - uses: gregsdennis/dependencies-action@80b5ffec566913b1494d5a8577ab0d60e476271d + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr-checklist.yml b/.github/workflows/pr-checklist.yml new file mode 100644 index 000000000..0b3f2d6e5 --- /dev/null +++ b/.github/workflows/pr-checklist.yml @@ -0,0 +1,19 @@ +--- +name: "Pull Request Checklist" +on: + pull_request: + types: + - edited + - opened + - reopened +jobs: + pr_checklist: + runs-on: ubuntu-latest + name: Verify + steps: + - name: Sleep for 30 seconds + run: sleep 30s + shell: bash + - name: Action + id: checklist + uses: ceph/ceph-pr-checklist-action@32e92d1a2a7c9991ed51de5fccb2296551373d60 diff --git a/.github/workflows/pr-triage.yml b/.github/workflows/pr-triage.yml new file mode 100644 index 000000000..8566f2599 --- /dev/null +++ b/.github/workflows/pr-triage.yml @@ -0,0 +1,28 @@ +--- +name: "Pull Request Triage" +on: pull_request_target +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +jobs: + pr-triage: + runs-on: ubuntu-latest + steps: + - name: Assign labels based on modified files + # https://github.com/marketplace/actions/labeler?version=v4.0.2 + uses: actions/labeler@5c7539237e04b714afd8ad9b4aed733815b9fab4 + with: + sync-labels: '' + repo-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Assign to Dashboard project + # https://github.com/marketplace/actions/add-to-github-projects?version=v0.4.1 + uses: actions/add-to-project@4756e6330fe1e0a736690d3cfd9f11c9399c2ed4 + with: + project-url: https://github.com/orgs/ceph/projects/2 + github-token: ${{ secrets.GITHUB_TOKEN }} + labeled: dashboard + - name: Assign milestone based on target brach name + # https://github.com/marketplace/actions/pull-request-milestone?version=v1.3.0 + uses: iyu/actions-milestone@e93115c90ff7bcddee71086e9253f1b6a5f4b48a + with: + configuration-path: .github/milestone.yml + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..2de5de3f1 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,58 @@ +# Configuration for stale action workflow - https://github.com/actions/stale + +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '0 * * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v5 + with: + # PAT for GitHub API authentication + repo-token: "${{ secrets.GITHUB_TOKEN }}" + + # Comment on the staled PRs + stale-pr-message: > + This pull request has been automatically marked as stale because it + has not had any activity for 60 days. It will be closed if no further + activity occurs for another 30 days. + + If you are a maintainer or core committer, please follow-up on this + pull request to identify what steps should be taken by the author to move this + proposed change forward. + + If you are the author of this pull request, thank you for your proposed + contribution. If you believe this change is still appropriate, please + ensure that any feedback has been addressed and ask for a code review. + + # Comment on the staled PRs while closed + close-pr-message: > + This pull request has been automatically closed because there has + been no activity for 90 days. Please feel free to reopen this pull + request (or open a new one) if the proposed change is still + appropriate. Thank you for your contribution! + + # Idle number of days before making PRs stale (exempts Issues) + days-before-pr-stale: 60 + + # Idle number of days before closing stale PRs (exempts Issues) + days-before-pr-close: 30 + + # Label to apply on staled PRs + stale-pr-label: 'stale' + + # Labels on PRs exempted from stale + exempt-pr-labels: 'pinned,security' + + # Exempt all PRs with milestones from stale (also exempts Issues) + exempt-all-pr-milestones: true + + # Max number of operations per run + operations-per-run: 100 + + # Change the order used to fetch the issues and pull requests from GitHub + # So we now start with the oldest PRs and work our way backwards + ascending: true -- cgit v1.2.3