From 67fceb5dccb7778b4a6f5c7ae1ece8223be1f52d Mon Sep 17 00:00:00 2001 From: Shangjie Chen Date: Tue, 23 Jun 2026 09:25:34 -0700 Subject: [PATCH] chore: Consolidate spam monitoring and stale issue auditing workflows Consolidates the two daily issue-cleaning background agents (`stale-bot.yml` and `issue-monitor.yml`) into a single, unified, parallelized workflow `issue-maintenance.yml`. Both agents run once a day at 6:00 AM UTC. Merging them into parallel jobs within a single workflow: 1. Prevents GitHub Actions run history clutter by grouping the daily sweeps into exactly one daily run card. 2. Provides a clean, unified manual trigger (workflow_dispatch) console in the GitHub UI, allowing developers to run either or both agents with a simple dropdown and checkbox menu. 3. Eliminates duplicate YAML boilerplate. Co-authored-by: Shangjie Chen PiperOrigin-RevId: 936714448 --- .github/workflows/issue-maintenance.yml | 100 ++++++++++++++++++++++++ .github/workflows/issue-monitor.yml | 64 --------------- .github/workflows/stale-bot.yml | 58 -------------- 3 files changed, 100 insertions(+), 122 deletions(-) create mode 100644 .github/workflows/issue-maintenance.yml delete mode 100644 .github/workflows/issue-monitor.yml delete mode 100644 .github/workflows/stale-bot.yml diff --git a/.github/workflows/issue-maintenance.yml b/.github/workflows/issue-maintenance.yml new file mode 100644 index 00000000..5238615b --- /dev/null +++ b/.github/workflows/issue-maintenance.yml @@ -0,0 +1,100 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: "ADK Issue Tracker Maintenance" + +on: + # Daily background cleanup at 6:00 AM UTC (10 PM PST) + schedule: + - cron: '0 6 * * *' + + # Allows manual triggering from the Actions console + workflow_dispatch: + inputs: + run_spam_monitor: + description: 'Run Issue Monitoring Agent (Spam Sweep)' + type: boolean + default: true + full_scan: + description: 'For Issue Monitoring: Run an Initial Full Scan of ALL open issues' + type: boolean + default: false + run_stale_auditor: + description: 'Run Stale Issue Auditor Agent' + type: boolean + default: true + +permissions: + issues: write + contents: read + +env: + GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }} + GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} + OWNER: ${{ github.repository_owner }} + REPO: adk-python + CONCURRENCY_LIMIT: 3 + LLM_MODEL_NAME: "gemini-3.5-flash" + PYTHONPATH: contributing/samples/adk_team + +jobs: + # 1. Sweep for spam, advertising, and invalid issues + sweep-spam: + if: | + github.repository == 'google/adk-python' && + (github.event_name == 'schedule' || github.event.inputs.run_spam_monitor == 'true') + runs-on: ubuntu-latest + timeout-minutes: 120 + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install requests google-adk python-dotenv + + - name: Run Issue Monitoring Agent (Spam Sweep) + env: + INITIAL_FULL_SCAN: ${{ github.event.inputs.full_scan == 'true' }} + run: python -m adk_issue_monitoring_agent.main + + # 2. Audit inactive issues and nudge/close them + audit-stale: + if: | + github.repository == 'google/adk-python' && + (github.event_name == 'schedule' || github.event.inputs.run_stale_auditor == 'true') + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install requests google-adk python-dateutil + + - name: Run Stale Auditor Agent + run: python -m adk_stale_agent.main diff --git a/.github/workflows/issue-monitor.yml b/.github/workflows/issue-monitor.yml deleted file mode 100644 index 60e05b52..00000000 --- a/.github/workflows/issue-monitor.yml +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: ADK Issue Monitoring Agent - -on: - schedule: - # Runs daily at 6:00 AM UTC - - cron: '0 6 * * *' - - # Allows manual triggering from the GitHub Actions tab - workflow_dispatch: - inputs: - full_scan: - description: 'Run an Initial Full Scan of ALL open issues' - required: false - type: boolean - default: false - -jobs: - sweep-spam: - if: github.repository == 'google/adk-python' - runs-on: ubuntu-latest - timeout-minutes: 120 - permissions: - issues: write - contents: read - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install requests google-adk python-dotenv - - - name: Run Issue Monitoring Agent - env: - GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }} - GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} - OWNER: ${{ github.repository_owner }} - REPO: ${{ github.event.repository.name }} - CONCURRENCY_LIMIT: 3 - INITIAL_FULL_SCAN: ${{ github.event.inputs.full_scan == 'true' }} - LLM_MODEL_NAME: "gemini-3.5-flash" - PYTHONPATH: contributing/samples/adk_team - run: python -m adk_issue_monitoring_agent.main diff --git a/.github/workflows/stale-bot.yml b/.github/workflows/stale-bot.yml deleted file mode 100644 index bb4d6600..00000000 --- a/.github/workflows/stale-bot.yml +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: ADK Stale Issue Auditor - -on: - workflow_dispatch: - - schedule: - # This runs at 6:00 AM UTC (10 PM PST) - - cron: '0 6 * * *' - -jobs: - audit-stale-issues: - if: github.repository == 'google/adk-python' - runs-on: ubuntu-latest - timeout-minutes: 60 - - permissions: - issues: write - contents: read - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install requests google-adk python-dateutil - - - name: Run Auditor Agent Script - env: - GITHUB_TOKEN: ${{ secrets.ADK_TRIAGE_AGENT }} - GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} - OWNER: ${{ github.repository_owner }} - REPO: adk-python - CONCURRENCY_LIMIT: 3 - LLM_MODEL_NAME: "gemini-3.5-flash" - PYTHONPATH: contributing/samples/adk_team - - run: python -m adk_stale_agent.main