Skip collection API checks in test (all) job#5044
Conversation
The test (all) job runs when non-collection/non-topic files change (e.g., Gemfile, Rakefile updates). Running the full collection rename/existence API checks (~300 GraphQL calls) is redundant for these changes because: 1. The collections-renames workflow runs hourly to detect and fix renames 2. The test (collections) job already validates collections when collection files are modified This change adds a SKIP_COLLECTION_API_CHECKS env var that causes the expensive API-based rename test to be skipped in the all job, reducing its runtime from ~16 minutes to ~2 minutes.
There was a problem hiding this comment.
Pull request overview
This PR optimizes CI test runtime by skipping expensive GitHub API checks (~300 GraphQL calls) when running the test (all) job. The all job handles non-collection file changes (Gemfile, Rakefile, infrastructure files) where collection rename/existence checks are redundant. These checks are already handled by the hourly collections-renames workflow and the test (collections) job.
Changes:
- Add conditional skip logic to collection API checks test based on
SKIP_COLLECTION_API_CHECKSenvironment variable - Configure workflow to set
SKIP_COLLECTION_API_CHECKS=1for theallmatrix test type
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/collections_test.rb | Add skip guard at the beginning of the rename/removal detection test when SKIP_COLLECTION_API_CHECKS is set |
| .github/workflows/test.yml | Set SKIP_COLLECTION_API_CHECKS environment variable to '1' for the 'all' test matrix type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
For the record, there's a problem: the tests have changed between the time the PR was opened and now, as the |
Summary
test (all)joballjob triggers for non-collection file changes (Gemfile, Rakefile, etc.) where these checks are redundantcollections-renamesworkflow and thetest (collections)jobChanges
test/collections_test.rb: Addskipguard whenSKIP_COLLECTION_API_CHECKSenv var is set.github/workflows/test.yml: SetSKIP_COLLECTION_API_CHECKS=1for theallmatrix typeImpact
Reduces
test (all)runtime from ~16 minutes to ~2 minutes, unblocking dependabot PRs and infrastructure changes.