Skip to content

Fix CI/CD pipeline: enable repair script, add concurrency controls, fix test configuration#86

Merged
SMSDAO merged 3 commits intomainfrom
copilot/fix-dependency-health-checks
Jan 30, 2026
Merged

Fix CI/CD pipeline: enable repair script, add concurrency controls, fix test configuration#86
SMSDAO merged 3 commits intomainfrom
copilot/fix-dependency-health-checks

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

CI/CD pipeline had 268 failing runs and 14+ automated issues due to repair scripts running in dry-run mode (detecting but not fixing issues), missing concurrency controls causing port conflicts and race conditions, and tests misconfigured for CI environments.

Changes

Enabled active repair mode

  • Removed --dry-run flag from scripts/repair-dependencies.sh calls in v3-build.yaml and dependency-health.yml
  • Changed continue-on-error: truefalse for repair and health check steps
  • Script now fixes dependency issues instead of just reporting them

Added concurrency controls

All 5 workflows now prevent simultaneous runs:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
  cancel-in-progress: true  # false for deploy workflows
  • Build/test workflows: cancel in progress
  • Deploy workflows: do not cancel (prevent incomplete deployments)
  • Scheduled workflow: includes event_name to allow independent cron runs

Fixed test configuration for CI

packages/core-services/package.json:

{
  "test": "vitest run",        // was "vitest" (watch mode)
  "test:watch": "vitest",      // for development
  "test:ci": "vitest run --coverage"
}

Removed -- --watch=false workaround from ci.yml - now handled in package.json.

Fixed error handling

Changed continue-on-error from true to false for critical checks:

  • Repair script execution
  • Health checks
  • Type checking
  • Linting, testing, building

Kept true for informational checks (security audit, oracle analysis).

Impact

  • Workflows will fix issues automatically instead of creating spam issues
  • No more port conflicts or race conditions from parallel runs
  • Tests run properly in CI without hanging
  • Faster feedback via fail-fast on critical errors
Original prompt

Problem Statement

The repository has 14+ open automated "Dependency Health Check Failed" issues and 268 failing workflow runs. The CI/CD pipeline is broken due to:

  1. Dry-run mode preventing actual fixes - Workflows detect issues but never repair them
  2. Test failures - Tests are not properly configured to pass in CI environments
  3. No concurrency controls - Multiple workflows run simultaneously causing conflicts
  4. Daily issue spam - Automated failures create new issues every day

Required Changes

1. Fix Workflow Dry-Run Mode

Files to modify:

  • .github/workflows/v3-build.yaml
  • .github/workflows/dependency-health.yml
  • .github/workflows/ci.yml
  • .github/workflows/deploy.yml

Changes needed:

  • Remove --dry-run flag from all scripts/repair-dependencies.sh calls
  • Allow the repair script to actually fix dependency issues
  • Change from diagnostic-only to active repair mode

2. Add Concurrency Controls

Add concurrency groups to ALL workflow files to prevent simultaneous runs:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

This prevents:

  • Port conflicts (multiple dev servers on same ports)
  • Build race conditions
  • Resource contention
  • Overlapping dependency installations

3. Fix Test Configuration

Current issues:

  • Tests fail with --watch=false flag
  • Vitest configuration may need adjustment
  • Tests marked as continue-on-error: true mask real failures

Required fixes:

  • Update test commands to work in CI (non-interactive mode)
  • Ensure vitest runs without watch mode properly
  • Fix or skip flaky tests appropriately
  • Remove continue-on-error: true where tests should actually pass
  • Add proper test timeouts for CI environment

Files to check/modify:

  • packages/core-services/vitest.config.ts
  • Package.json test scripts in workspace packages
  • Any .spec.ts or .test.ts files with known issues

4. Workflow-Specific Fixes

.github/workflows/v3-build.yaml

- name: Run Repair Script (Issue #66)
  run: |
    bash scripts/repair-dependencies.sh  # REMOVE --dry-run
  continue-on-error: false  # Should fail if repair fails

- name: Type Check
  run: pnpm typecheck
  continue-on-error: false  # Fix type errors, don't mask them

- name: Test
  run: pnpm test
  continue-on-error: false

.github/workflows/dependency-health.yml

- name: Run Repair Script
  run: |
    bash scripts/repair-dependencies.sh  # REMOVE --dry-run
  continue-on-error: false

- name: Run Health Check
  id: health-check
  run: |
    bash scripts/master.sh health --json > health-report.json
    cat health-report.json
  continue-on-error: false

.github/workflows/ci.yml

- name: Test
  run: pnpm test  # REMOVE -- --watch=false, should be in package.json
  continue-on-error: false

- name: Build packages
  run: pnpm -r build
  continue-on-error: false

5. Update Package.json Test Scripts

Ensure all package.json files have proper test scripts for CI:

{
  "scripts": {
    "test": "vitest run",  // Non-watch mode for CI
    "test:watch": "vitest",  // Watch mode for dev
    "test:ci": "vitest run --coverage"
  }
}

Success Criteria

After these changes:

  1. ✅ All workflows should pass on push to main
  2. ✅ Dependency repair actually fixes issues (not just reports them)
  3. ✅ Only one workflow of each type runs at a time
  4. ✅ No more automated issue creation for failed health checks
  5. ✅ Tests pass consistently in CI environment
  6. ✅ Build artifacts are generated successfully
  7. ✅ Type checking passes without errors

Important Constraints

DO NOT CHANGE:

  • Application logic in apps/web, apps/admin, packages/*/src
  • Business code or component implementations
  • Database schemas or API contracts
  • Smart contract code
  • Any feature functionality

ONLY CHANGE:

  • Workflow YAML files in .github/workflows/
  • Test configurations (vitest.config.ts, jest configs)
  • Test scripts in package.json files
  • CI/CD infrastructure code only

Testing Instructions

After implementing changes:

  1. Push to a test branch
  2. Verify all 4 workflows complete successfully
  3. Check that no duplicate workflows run simultaneously
  4. Confirm no new automated issues are created
  5. Validate build artifacts are produced
  6. Ensure tests complete without errors

References

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 30, 2026 11:00
Co-authored-by: SMSDAO <144380926+SMSDAO@users.noreply.github.com>
Co-authored-by: SMSDAO <144380926+SMSDAO@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI/CD pipeline issues with dependency health checks Fix CI/CD pipeline: enable repair script, add concurrency controls, fix test configuration Jan 30, 2026
Copilot AI requested a review from SMSDAO January 30, 2026 11:08
@SMSDAO
Copy link
Member

SMSDAO commented Jan 30, 2026

@copilot apply changes CastQuest V3 Build & Deploy / build (pull_request)
CastQuest V3 Build & Deploy / build (pull_request)Failing after 9s
CI / ci (pull_request)
CI / ci (pull_request)F Dependency Health Check / dependency-health (pull_request)Failing after 3m still 3 test not pass! investigate please when run test its not passing run yur test and if nothing to fix send full report.

@SMSDAO SMSDAO marked this pull request as ready for review January 30, 2026 12:24
Copilot AI review requested due to automatic review settings January 30, 2026 12:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes CI/CD reliability by enabling dependency repair actions, adding workflow-level concurrency controls, and making Vitest run non-interactively in CI.

Changes:

  • Enabled non-dry-run execution of scripts/repair-dependencies.sh and made repair/health/typecheck/lint/test/build steps fail the workflow on error.
  • Added concurrency blocks across workflows to avoid overlapping runs per ref (with deploy workflows not cancelling in-progress runs).
  • Updated packages/core-services test scripts so CI runs vitest run instead of watch mode.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/core-services/package.json Switches tests to non-watch mode by default; adds test:ci for coverage.
.github/workflows/v3-build.yaml Adds concurrency; enables active dependency repair and makes health/typecheck blocking.
.github/workflows/ci.yml Adds concurrency; makes lint/typecheck/test/build steps blocking; removes CI watch workaround.
.github/workflows/dependency-health.yml Adds concurrency; enables active dependency repair and makes health checks blocking.
.github/workflows/deploy.yml Adds concurrency (non-cancelling) and removes BOM from the workflow header.
.github/workflows/deploy-v3.yml Adds concurrency (non-cancelling) for v3 deploy workflow.

Copy link
Member

@SMSDAO SMSDAO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes

@SMSDAO SMSDAO merged commit 8476ebb into main Jan 30, 2026
8 of 11 checks passed
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.

3 participants