]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
.github: add workflow for redmine upkeep
authorPatrick Donnelly <pdonnell@ibm.com>
Thu, 26 Jun 2025 02:04:24 +0000 (22:04 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Wed, 9 Jul 2025 14:01:28 +0000 (10:01 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
.github/workflows/redmine-upkeep.yml [new file with mode: 0644]
src/script/requirements.redmine-upkeep.txt [new file with mode: 0644]

diff --git a/.github/workflows/redmine-upkeep.yml b/.github/workflows/redmine-upkeep.yml
new file mode 100644 (file)
index 0000000..49d3cab
--- /dev/null
@@ -0,0 +1,61 @@
+---
+name: Redmine Upkeep
+on:
+  # To manually trigger this: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
+  # View past runs and output: https://github.com/ceph/ceph/actions/workflows/create-backport-trackers.yml
+  workflow_dispatch:
+    inputs:
+      issue:
+        description: 'issue to update'
+        type: string
+        default: ''
+      limit:
+        description: '--limit: limit issue traversal'
+        default: 50
+        type: int
+      debug:
+        description: '--debug: Show debug-level messages'
+        default: false
+        type: boolean
+  schedule:
+    - cron: '*/30 * * * *'
+# TODO enable/setup after upkeep has caught up
+#  push:
+#    tags:
+#      - 'v*'
+  # for testing
+  push:
+    branches:
+      - 'feature/redmine-upkeep'
+concurrency:
+  group: redmine-upkeep-workflow-concurrency-group
+  cancel-in-progress: false
+jobs:
+  redmine-upkeep:
+    runs-on: ubuntu-latest
+    if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/feature/redmine-upkeep'
+    steps:
+      - name: checkout main
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+        with:
+          path: ceph
+          fetch-depth: 0
+
+      - name: Setup Python
+        uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
+        with:
+          python-version: '3.9'
+          cache: 'pip'
+          cache-dependency-path: ceph/src/script/requirements.redmine-upkeep.txt
+
+      - name: install dependencies
+        run: pip install -r ceph/src/script/requirements.redmine-upkeep.txt
+
+      - run: >
+             python3 ceph/src/script/redmine-upkeep.py
+             --github-action
+             --git-dir=./ceph/
+             ${{ github.event_name == 'workflow_dispatch' && (inputs.debug && '--debug' || '') || '' }}
+             ${{ github.event_name == 'workflow_dispatch' && format('--limit={}', inputs.limit) || '' }}
+        env:
+          REDMINE_API_KEY: ${{ secrets.REDMINE_API_KEY_BACKPORT_BOT }}
diff --git a/src/script/requirements.redmine-upkeep.txt b/src/script/requirements.redmine-upkeep.txt
new file mode 100644 (file)
index 0000000..51d5fee
--- /dev/null
@@ -0,0 +1,2 @@
+python-redmine == 2.3.0
+GitPython == 3.1.44