-
Notifications
You must be signed in to change notification settings - Fork 15
chore: refactor workflows for improved parallelization #303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Split reusable workflows into parallel jobs and consolidate build/version: **Reusable Workflows:** - reusable-security.yml: Split into parallel jobs (audit, codeql, osv-scan, sbom) - reusable-validate.yml: Split into parallel jobs (test, lint) with optional changeset validation **Main Workflow:** - Consolidate build-once + version jobs into single 'build' job - Update all job dependencies to reference 'build' instead of 'build-once' and 'version' - Add version/tag outputs to build job for downstream consumption **PR Workflow:** - Simplify status checks to validate, security, docker (removed redundant checks) - Update comments to reflect new parallel job structure This improves CI performance by running independent checks concurrently. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors GitHub Actions workflows to improve CI performance by parallelizing independent security and validation checks that previously ran sequentially.
Key changes:
- Split monolithic validation and security workflows into parallel jobs
- Consolidated build phases to reduce complexity and workflow execution time
- Updated dependency chains to reflect new parallel structure
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
.github/workflows/reusable-validate.yml |
Split single validate job into parallel test and lint jobs, moved changeset validation to lint job |
.github/workflows/reusable-security.yml |
Split single security job into 4 parallel jobs: audit , codeql , osv-scan , and sbom |
.github/workflows/pr.yml |
Simplified to use consolidated reusable workflows, removed individual job definitions |
.github/workflows/main.yml |
Consolidated build-once and version jobs into single build job, updated all downstream dependencies |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
SONAR_TOKEN: | ||
description: 'SonarCloud authentication token' | ||
required: false | ||
required: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing SONAR_TOKEN
from required: false
to required: true
is a breaking change that could cause existing workflows to fail if they don't provide this secret. Consider keeping it optional or documenting this breaking change.
required: true | |
required: false |
Copilot uses AI. Check for mistakes.
# Documents all dependencies for supply chain security | ||
# ============================================================================= | ||
osv-scan: | ||
if: inputs.run-osv-scan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OSV scanner action is now called directly in the osv-scan
job, but the previous implementation had error handling with || true
to prevent failures. The reusable workflow may not have the same failure handling, potentially causing the job to fail when vulnerabilities are found.
if: inputs.run-osv-scan | |
if: inputs.run-osv-scan | |
continue-on-error: true |
Copilot uses AI. Check for mistakes.
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
# Custom script validates changesets and determines version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --check-only
flag was removed from the version script call, but the comment on line 130 still says 'Only checks for version changes, doesn't update files'. This creates a mismatch between the comment and the actual behavior.
# Custom script validates changesets and determines version | |
# Custom script validates changesets, determines version, and updates files as needed |
Copilot uses AI. Check for mistakes.
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
Add a table-format Trivy scan step that outputs to console logs before the SARIF scan. This makes vulnerability findings visible in GitHub Actions logs without requiring navigation to the Security tab. The console scan doesn't fail the build - only the SARIF scan does. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
uses: google/osv-scanner-action/.github/workflows/[email protected] | ||
with: | ||
# Scan entire project including all manifests (package.json, pnpm-lock.yaml) | ||
scan-args: |- | ||
./ | ||
permissions: | ||
security-events: write # Required to upload findings to Security tab | ||
actions: read | ||
contents: read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The osv-scan job uses a different reusable workflow pattern compared to the other jobs in this file. Consider maintaining consistency by implementing OSV scanning as steps within a job, similar to the audit and codeql jobs.
Copilot uses AI. Check for mistakes.
permissions: | ||
security-events: write # Required to upload findings to Security tab | ||
actions: read | ||
contents: read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The permissions block should be defined at the workflow level rather than within a job that uses an external reusable workflow. Move these permissions to the top-level permissions section of the calling workflow.
permissions: | |
security-events: write # Required to upload findings to Security tab | |
actions: read | |
contents: read |
Copilot uses AI. Check for mistakes.
Switch from SARIF to table format to make vulnerability details visible in GitHub Actions logs for easier debugging. This temporarily disables SARIF upload to GitHub Security tab in favor of immediate visibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This reverts commit 102e51d.
Modified reusable-docker.yml to always upload SARIF results to GitHub Security even when vulnerabilities are found. The workflow now: - Runs Trivy scan with continue-on-error to prevent immediate failure - Uploads SARIF results (always runs via if: always() condition) - Fails the workflow after upload if vulnerabilities were detected This ensures the Security tab receives vulnerability data while maintaining the security gate that prevents builds with critical/high vulnerabilities. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
SONAR_TOKEN: | ||
description: 'SonarCloud authentication token' | ||
required: false | ||
required: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing SONAR_TOKEN from required: false
to required: true
is a breaking change that could cause existing workflows to fail if they don't provide this secret.
Copilot uses AI. Check for mistakes.
Added artifact upload step for trivy-results.sarif to enable debugging and inspection of vulnerability scan results. The artifact: - Is uploaded with event-specific naming (e.g., trivy-results-pull_request-SHA) - Uses retention of 7 days - Always uploads via if: always() condition - Complements the existing GitHub Security upload This allows developers to download and inspect the raw SARIF file without needing to view it only in the Security tab. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Removed the duplicate Trivy console output scan step. The workflow now: - Runs a single Trivy scan that generates SARIF output - Uses continue-on-error to prevent immediate failure - Uploads SARIF to GitHub Security (always runs) - Uploads SARIF as downloadable artifact (always runs) - Fails the workflow after uploads if vulnerabilities were found This eliminates redundancy while maintaining the same security gate and improving workflow efficiency. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
# Does not fail immediately to allow SARIF upload | ||
id: trivy-sarif | ||
if: steps.build-config.outputs.can_load == 'true' || !contains(inputs.platforms, ',') | ||
continue-on-error: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using 'continue-on-error: true' could mask critical security vulnerabilities. While the workflow later fails in a separate step, this pattern could be bypassed if the later step is modified or removed.
Copilot uses AI. Check for mistakes.
Simplified the Trivy vulnerability scanning workflow by: - Removing continue-on-error and manual failure checking - Letting Trivy action fail naturally if vulnerabilities found - Keeping if: always() on uploads to ensure SARIF reaches GitHub Security - Removing redundant exit-code and step ID configurations This cleaner pattern follows the recommended approach from Trivy documentation and reduces workflow complexity while maintaining the same security guarantees. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Enhanced Trivy vulnerability scanning to include: - Explicit exit-code: '1' to fail on vulnerabilities - Multiple scanner types: vulnerabilities, secrets, misconfigurations, licenses - Latest Trivy version for up-to-date vulnerability database This provides more comprehensive security coverage beyond just vulnerability scanning, including secret detection, configuration issues, and license compliance. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
category: 'osv-scan' # Separate category from CodeQL | ||
osv-scan: | ||
if: inputs.run-osv-scan | ||
uses: google/osv-scanner-action/.github/workflows/[email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OSV scanner version is hardcoded here but the comment in the original workflow mentioned checking quarterly for new versions. Consider using a workflow input parameter to make version updates easier to manage.
Copilot uses AI. Check for mistakes.
Simplified the Trivy SARIF artifact name from: trivy-results-{event_name}-{sha} to: trivy-{sha} This is cleaner and still provides unique identification via the commit SHA, which is the most important identifier for tracking scan results. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Added debugging configuration to Trivy scan: - Set hide-progress: false to show scan progress in logs - Set TRIVY_DEBUG: 'true' environment variable for detailed debugging This will help diagnose why the scan is reporting findings when the SARIF file shows only MEDIUM/LOW severity vulnerabilities. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Changed Trivy configuration to set ignore-unfixed: true, which means: - Only report vulnerabilities that have available fixes - Ignore vulnerabilities without fixes (not actionable) - Still scan for CRITICAL,HIGH severity issues - Still run all scanners (vuln,secret,misconfig,license) This prevents build failures for vulnerabilities that cannot be fixed and focuses attention on actionable security issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Changed Trivy severity filter from CRITICAL,HIGH to all severities. Now the build will fail on ANY fixable vulnerability, ensuring all security issues with available fixes are addressed. Configuration: - severity: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL (all severities) - ignore-unfixed: true (only fixable vulnerabilities) - exit-code: 1 (fail on any findings) This ensures comprehensive security coverage while remaining actionable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ignore-unfixed: false # Include unfixed CVEs | ||
exit-code: '1' # Fail workflow if vulnerabilities found | ||
trivyignores: '.trivyignore' # Use ignore file for false positives | ||
severity: 'UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scanning for UNKNOWN and LOW severity vulnerabilities while setting exit-code to '1' may cause builds to fail unnecessarily. Consider limiting severity to 'MEDIUM,HIGH,CRITICAL' or using ignore-unfixed appropriately.
severity: 'UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL' | |
severity: 'MEDIUM,HIGH,CRITICAL' |
Copilot uses AI. Check for mistakes.
Added explicit OpenSSL package upgrade in Dockerfile production stage: - libcrypto3: 3.5.1-r0 → 3.5.4-r0 - libssl3: 3.5.1-r0 → 3.5.4-r0 Fixed vulnerabilities: - CVE-2025-9230 (MEDIUM): Out-of-bounds read/write in RFC 3211 KEK Unwrap - CVE-2025-9231 (MEDIUM): Timing side-channel in SM2 algorithm on ARM64 - CVE-2025-9232 (LOW): Out-of-bounds read in HTTP client no_proxy Trivy scan now passes with 0 vulnerabilities. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
Summary
Refactors GitHub Actions workflows to improve CI performance by running independent checks in parallel instead of sequentially.
Changes
Reusable Workflows:
reusable-security.yml
: Split into 4 parallel jobs:audit
: Security audit of dependenciescodeql
: CodeQL static analysisosv-scan
: OSV vulnerability scanningsbom
: Software Bill of Materials generationreusable-validate.yml
: Split into 2 parallel jobs:test
: Run tests with coverage and SonarQube scanlint
: Run all linting checks, workflow validation, and optional changeset validationMain Workflow (
main.yml
):build-once
+version
jobs into singlebuild
jobbuild
jobbuild
job for downstream consumptionPR Workflow (
pr.yml
):validate
,security
,docker
Performance Impact
Jobs that previously ran sequentially now run in parallel:
Files Changed
.github/workflows/main.yml
(-72 lines).github/workflows/pr.yml
(-72 lines).github/workflows/reusable-security.yml
(+100 lines, split into 4 jobs).github/workflows/reusable-validate.yml
(+85 lines, split into 2 jobs)Net change: -72 lines, improved structure and parallelization
🤖 Generated with Claude Code