From ceb67b3dfe8916547daef2d92462fb41d7aa97a2 Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Sat, 5 Sep 2026 12:58:05 +0300 Subject: [PATCH] Add weekly scheduled CI run and CODEOWNERS Runs the existing test suite weekly (Mondays 06:10 UTC) in addition to push/PR, and adds a CODEOWNERS file with the learning-fuel team as owner. On CI failure, files/updates a GitHub issue mentioning the team. Co-Authored-By: Claude Sonnet 5 --- .github/CODEOWNERS | 1 + .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..8eac885 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @mongodb-developer/learning-fuel diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff7e157..e58c5f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,8 @@ on: push: pull_request: workflow_dispatch: + schedule: + - cron: '10 6 * * 1' jobs: smoke: @@ -120,3 +122,44 @@ jobs: env: MONGODB_URI: mongodb://admin:mongodb@localhost:27017/ run: pytest tests/test_integration.py -v + + notify-on-failure: + needs: smoke + if: failure() + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: File or update CI failure issue for @mongodb-developer/learning-fuel + uses: actions/github-script@v7 + with: + script: | + const title = `CI failure on ${context.ref}`; + const body = [ + '@mongodb-developer/learning-fuel the CI workflow failed.', + '', + `Workflow: ${context.workflow}`, + `Run: ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, + ].join('\n'); + const { data: existing } = await github.rest.issues.listForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + labels: 'ci-failure', + }); + if (existing.length > 0) { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: existing[0].number, + body, + }); + } else { + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title, + body, + labels: ['ci-failure'], + }); + }