Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
238 changes: 219 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,245 @@
name: CI - Pull Request Checks
name: CI/CD Pipeline

# Only run on pull requests targeting main branch
# Trigger on push to main/develop and all pull requests
on:
push:
branches: [main, develop]
pull_request:
branches: [ main ]
branches: [main, develop]

# Cancel in-progress runs for same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Code Quality & Testing
# Code quality checks
quality:
name: Code Quality & Linting
runs-on: ubuntu-latest

steps:
# Checkout the repository code
- name: Checkout code
uses: actions/checkout@v4

# Setup Node.js environment with caching for faster installs
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

# Install dependencies using npm ci (clean install)
# This ensures consistent dependency versions across CI runs
- name: Install dependencies
run: npm ci

# Run ESLint to check code quality and style
# This catches potential bugs and enforces coding standards
- name: Run linter
- name: Run ESLint
run: npm run lint
continue-on-error: true # Don't fail the build on linting warnings

# Run Vitest test suite
# Validates that all unit and integration tests pass
- name: Check for unused imports
run: npx eslint . --ext .js,.jsx --quiet
continue-on-error: true
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 9, 2026

Choose a reason for hiding this comment

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

P1: Production deployment step should not have continue-on-error: true. A failed production deploy will silently appear successful, undermining the manual approval gate. Remove this or replace with proper error handling/notifications.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yml, line 39:

<comment>Production deployment step should not have `continue-on-error: true`. A failed production deploy will silently appear successful, undermining the manual approval gate. Remove this or replace with proper error handling/notifications.</comment>

<file context>
@@ -1,45 +1,245 @@
-      # Validates that all unit and integration tests pass
+      - name: Check for unused imports
+        run: npx eslint . --ext .js,.jsx --quiet
+        continue-on-error: true
+  
+  # TypeScript type checking
</file context>
Fix with Cubic


# TypeScript type checking
typecheck:
name: TypeScript Type Check
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Type check
run: npm run typecheck || echo "Type checking skipped (migration in progress)"
continue-on-error: true
Comment on lines +59 to +61
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

typecheck is effectively non-blocking: the command swallows failures (|| echo ...) and the step also has continue-on-error: true. This means type errors will not fail CI, which undermines the “quality/typecheck gates” goal. Consider making typecheck required on at least main/protected branches (or only allow non-blocking behavior temporarily via a conditional).

Copilot uses AI. Check for mistakes.

# Run tests
test:
name: Unit & Integration Tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test:run

# Check for high/critical security vulnerabilities
# Only fails on high or critical severity issues
- name: Security audit
- name: Generate coverage report
run: npm run test:coverage
continue-on-error: true

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage/lcov.info
flags: unittests
name: codecov-interact
fail_ci_if_error: false
continue-on-error: true

# Security scanning
security:
name: Security Scan
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run npm audit
run: npm audit --audit-level=high
continue-on-error: true # Don't fail on advisory issues
continue-on-error: true
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

npm audit --audit-level=high is configured with continue-on-error: true, so high-severity vulnerabilities will not fail CI. If the intention is to keep it informational for now, consider at least failing on main/release branches (or adding an allowlist policy) so known high/critical issues can’t be shipped unnoticed.

Suggested change
continue-on-error: true
continue-on-error: ${{ !(github.ref == 'refs/heads/main' || github.base_ref == 'main') }}

Copilot uses AI. Check for mistakes.

- name: Check for secrets
uses: trufflesecurity/trufflehog@main
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 9, 2026

Choose a reason for hiding this comment

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

P1: Pinning trufflehog to @main is a supply-chain security risk — any commit to the main branch will run in your CI. Pin to a specific version tag (e.g., @v3.88.0) or commit SHA.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yml, line 120:

<comment>Pinning `trufflehog` to `@main` is a supply-chain security risk — any commit to the main branch will run in your CI. Pin to a specific version tag (e.g., `@v3.88.0`) or commit SHA.</comment>

<file context>
@@ -1,45 +1,245 @@
+        continue-on-error: true
+      
+      - name: Check for secrets
+        uses: trufflesecurity/trufflehog@main
+        with:
+          path: ./
</file context>
Suggested change
uses: trufflesecurity/trufflehog@main
uses: trufflesecurity/trufflehog@v3.88.0
Fix with Cubic

with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
continue-on-error: true
Comment on lines +119 to +125
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Using trufflesecurity/trufflehog@main is not pinned and can change unexpectedly, which is a supply-chain risk for CI. Pin this action to a tagged release or a commit SHA.

Copilot uses AI. Check for mistakes.

# Build application
build:
name: Build Application
needs: [quality, typecheck, test]
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build for production
run: npm run build
env:
NODE_ENV: production

- name: Check build size
run: |
echo "Build size:"
du -sh dist/
echo "Detailed breakdown:"
du -h dist/* | sort -hr | head -20

- name: Upload build artifacts
uses: actions/upload-artifact@v3
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 9, 2026

Choose a reason for hiding this comment

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

P0: actions/upload-artifact@v3 was deprecated on Jan 30, 2025 and will cause workflow failures. Upgrade to @v4. The same applies to actions/download-artifact@v3 used in the deploy jobs.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yml, line 159:

<comment>`actions/upload-artifact@v3` was deprecated on Jan 30, 2025 and will cause workflow failures. Upgrade to `@v4`. The same applies to `actions/download-artifact@v3` used in the deploy jobs.</comment>

<file context>
@@ -1,45 +1,245 @@
+          du -h dist/* | sort -hr | head -20
+      
+      - name: Upload build artifacts
+        uses: actions/upload-artifact@v3
+        with:
+          name: dist-${{ github.sha }}
</file context>
Suggested change
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
Fix with Cubic

with:
name: dist-${{ github.sha }}
path: dist/
retention-days: 7

# Deploy to staging (develop branch only)
deploy-staging:
name: Deploy to Staging
needs: [build, security]
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
runs-on: ubuntu-latest
environment:
name: staging
url: https://staging-interact.vercel.app

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: dist-${{ github.sha }}
path: dist/

- name: Deploy to Vercel (Staging)
uses: amondnet/vercel-action@v25
id: vercel-deploy
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
scope: ${{ secrets.VERCEL_ORG_ID }}
working-directory: ./
continue-on-error: true

Comment on lines +185 to +195
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

Both deploy steps use continue-on-error: true on the actual Vercel deployment, so the workflow can report success even if deployment fails. This is risky operationally (especially for production) and makes failures easy to miss. Remove continue-on-error for deployment steps (or gate it behind a manual override) so failed deploys fail the job.

Copilot uses AI. Check for mistakes.
- name: Comment on PR with deployment URL
if: github.event_name == 'pull_request'
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 9, 2026

Choose a reason for hiding this comment

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

P2: This step is unreachable. The parent job's if condition requires github.event_name == 'push', so the step condition github.event_name == 'pull_request' can never be true. If the intent is to comment on PRs for staging previews, this logic needs to be in a separate job triggered by pull_request events.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yml, line 197:

<comment>This step is unreachable. The parent job's `if` condition requires `github.event_name == 'push'`, so the step condition `github.event_name == 'pull_request'` can never be true. If the intent is to comment on PRs for staging previews, this logic needs to be in a separate job triggered by `pull_request` events.</comment>

<file context>
@@ -1,45 +1,245 @@
+        continue-on-error: true
+      
+      - name: Comment on PR with deployment URL
+        if: github.event_name == 'pull_request'
+        uses: actions/github-script@v6
+        with:
</file context>
Fix with Cubic

uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ Staging deployment complete!\n\nURL: ${{ steps.vercel-deploy.outputs.preview-url }}'
})
continue-on-error: true

Comment on lines +195 to +208
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

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

The “Comment on PR with deployment URL” step can never run because deploy-staging only runs on push events (if: ... && github.event_name == 'push'), but this step requires a pull_request event. Either remove the step, or change the deployment strategy to run a preview deploy on PRs and then comment there.

Suggested change
- name: Comment on PR with deployment URL
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ Staging deployment complete!\n\nURL: ${{ steps.vercel-deploy.outputs.preview-url }}'
})
continue-on-error: true

Copilot uses AI. Check for mistakes.
# Deploy to production (main branch only, manual approval required)
deploy-production:
name: Deploy to Production
needs: [build, security]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
environment:
name: production
url: https://interact.vercel.app

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: dist-${{ github.sha }}
path: dist/

- name: Deploy to Vercel (Production)
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: '--prod'
scope: ${{ secrets.VERCEL_ORG_ID }}
working-directory: ./
continue-on-error: true

- name: Create deployment notification
run: |
echo "🚀 Production deployment completed!"
echo "Commit: ${{ github.sha }}"
echo "Deployed by: ${{ github.actor }}"
continue-on-error: true
Loading
Loading