Skip to content

ci(snyk): run Snyk weekly via scheduled caller, not per-PR#233

Merged
williaby merged 1 commit into
mainfrom
feat/snyk-weekly-scheduling
Jun 29, 2026
Merged

ci(snyk): run Snyk weekly via scheduled caller, not per-PR#233
williaby merged 1 commit into
mainfrom
feat/snyk-weekly-scheduling

Conversation

@williaby

Copy link
Copy Markdown
Collaborator

Why

Snyk hosted tests are metered: the org plan caps the monthly test count, and the limit was being exhausted. The in-code per-PR driver was self-test.yml, which invoked python-snyk.yml + python-snyk-iac.yml with the real SNYK_TOKEN on every push and PR touching a workflow file.

run-snyk already defaults false in python-standard-stack.yml and no consumer repo opts in, so this self-test path was the only in-code per-PR Snyk consumer.

What

Move Snyk to a weekly schedule, mirroring the established sbom-nightly.yml pattern (SBOM is deliberately kept out of per-PR self-test and runs only via its scheduled caller).

  • New snyk-weekly.ymlschedule (Mon 03:43 UTC, off-peak/non-:00, offset from sbom-nightly and dependency-provenance-weekly) + workflow_dispatch. Single scheduled entry point for both Snyk reusables, with the same contents: read + security-events: write permission contract as sbom-nightly.yml.
  • Remove test-python-snyk and test-python-snyk-iac from self-test.yml — pull requests no longer trigger metered Snyk scans. A maintainer changing either reusable validates via the new caller's workflow_dispatch.
  • Doc notes in both reusables' usage headers: downstream callers that opt into run-snyk: true should wire Snyk on schedule:, not pull_request:.

Verification

  • actionlint .github/workflows/snyk-weekly.yml clean; all four touched workflows parse.
  • No uses:.*python-snyk invocation remains in self-test.yml.
  • pre-commit passed (yamllint, markdownlint, no-em-dash, secret scans, commitizen).
  • Signed commit (ED25519).

Note (out of scope, separate surface)

The 200-tests/month exhaustion ("docker and open source tests") is most likely dominated by the Snyk SCM/GitHub-App integration posting a PR check per imported target (williaby has ~36 targets), which is an org-level Snyk setting, not workflow code. This PR fixes the code surface; disabling the integration's per-PR checks (and relying on Snyk's recurring scheduled scan) is a follow-up in the Snyk UI/API.

Generated with Claude Code

Snyk hosted tests are metered (the org plan caps the monthly test count),
so invoking python-snyk.yml + python-snyk-iac.yml from per-PR self-test.yml
exhausted the quota. Move both behind a dedicated weekly scheduled caller,
mirroring the sbom-nightly.yml pattern.

- Add snyk-weekly.yml: schedule (Mon 03:43 UTC) + workflow_dispatch caller for
  python-snyk.yml and python-snyk-iac.yml; same security-events:write permission
  contract as sbom-nightly.yml.
- Remove test-python-snyk and test-python-snyk-iac jobs from self-test.yml so
  pull requests no longer trigger metered Snyk scans.
- Document the weekly-schedule (not pull_request) convention in both reusables'
  usage headers for downstream callers that opt into run-snyk: true.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@williaby, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f8b9af8c-cde8-4648-b954-fba680b9ed27

📥 Commits

Reviewing files that changed from the base of the PR and between 6b52133 and 7764555.

📒 Files selected for processing (5)
  • .github/workflows/python-snyk-iac.yml
  • .github/workflows/python-snyk.yml
  • .github/workflows/self-test.yml
  • .github/workflows/snyk-weekly.yml
  • CHANGELOG.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/snyk-weekly-scheduling

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@williaby williaby enabled auto-merge June 29, 2026 20:46
@williaby williaby added this pull request to the merge queue Jun 29, 2026
Merged via the queue into main with commit bf5e82a Jun 29, 2026
34 of 35 checks passed
@williaby williaby deleted the feat/snyk-weekly-scheduling branch June 29, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant