You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix /run-skipped-ci command to only run minimum dependency tests (#2006)
## Summary
Fixes the `/run-skipped-ci` command to intelligently detect and run only
the CI checks that were actually skipped on the PR.
### The Problem
The previous implementation was broken because:
1. It tried to guess which tests to run based on a hardcoded list
2. Pro workflows were being skipped on PRs without Pro file changes (via
`detect-changes`)
3. The command wasn't smart about which tests actually needed to be run
### The Solution
The command now **intelligently detects skipped checks** and runs only
what's needed.
## Changes
### 1. Fetch Actual Skipped Checks from PR
The workflow now queries the GitHub API to find checks with
`conclusion='SKIPPED'`:
```javascript
const checks = await github.rest.checks.listForRef({...});
const skippedChecks = checks.data.check_runs.filter(check =>
check.conclusion === 'SKIPPED' && check.status === 'COMPLETED'
);
```
Maps workflow names to files and triggers only workflows with skipped
checks.
### 2. Added `force_run` Input to ALL Workflows
All workflows now support a `force_run` input that bypasses
detect-changes:
**Updated workflows:**
- `main.yml`
- `examples.yml`
- `pro-integration-tests.yml`
- `pro-package-tests.yml`
- `pro-lint.yml`
**How it works:**
```yaml
- name: Detect relevant changes
run: |
# If force_run is true, run everything
if [ "${{ inputs.force_run }}" = "true" ]; then
echo "run_lint=true" >> "$GITHUB_OUTPUT"
echo "run_ruby_tests=true" >> "$GITHUB_OUTPUT"
# ... all other outputs set to true
exit 0
fi
# Normal detect-changes logic...
```
### 3. Fixed Matrix Exclusion Logic
Updated matrix exclusion to run ALL configurations when
`force_run=true`:
```yaml
exclude:
# Skip minimum on PRs UNLESS force_run is true
- ruby-version: ${{ github.event_name == 'pull_request' && inputs.force_run != true && '3.2' || '' }}
node-version: ${{ github.event_name == 'pull_request' && inputs.force_run != true && '20' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && inputs.force_run != true && 'minimum' || '' }}
```
### 4. Improved PR Comments
The PR comment now shows:
- All skipped checks that were detected
- Which workflows were triggered
- Clear explanation that `force_run` bypasses detect-changes
- Handles case where all checks are already running
Example comment:
```
Skipped CI Checks - Trigger Results
Successfully triggered skipped CI checks
**Skipped checks detected:**
- build-dummy-app-webpack-test-bundles (React on Rails Pro - Integration Tests)
- lint-js-and-ruby (React on Rails Pro - Lint)
- dummy-app-integration-tests (Main test)
**Triggered workflows:**
- React on Rails Pro - Integration Tests
- React on Rails Pro - Lint
- Main Tests
**Note:** These workflows will run with force_run: true to bypass detect-changes logic.
```
## Testing
- [x] Verify the workflow queries actual skipped checks from PR
- [x] Test that force_run bypasses detect-changes
- [x] Confirm matrix runs both latest and minimum when triggered
- [x] Check PR comment shows correct information
## Benefits
- **Smart**: Only runs tests that were actually skipped
- **Comprehensive**: Runs all test matrices (latest + minimum
dependencies)
- **Transparent**: Clear PR comments show exactly what's running and why
- **Maintainable**: No hardcoded workflow lists to keep in sync
Generated with Claude Code
<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/shakacode/react_on_rails/2006)
<!-- Reviewable:end -->
---------
Co-authored-by: Claude <[email protected]>
View progress in the [Actions tab](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions).` : ''}
175
228
176
-
View progress in the [Actions tab](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions).` : ''}`;
229
+
${notApplicable.length > 0 ? `\nAll CI checks are already running on this PR. Use this command when you see skipped checks that you want to run.` : ''}`;
0 commit comments