Files
taskplaner/.planning/phases/09-ci-pipeline/09-04-PLAN.md
Thomas Richter 49e1c90f37 docs(09): create phase plan
Phase 09: CI Pipeline Hardening
- 4 plan(s) in 3 wave(s)
- Wave 1: Infrastructure setup (09-01)
- Wave 2: Tests in parallel (09-02, 09-03)
- Wave 3: CI integration (09-04)
- Ready for execution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 23:23:27 +01:00

6.7 KiB

phase, plan, type, wave, depends_on, files_modified, autonomous, user_setup, must_haves
phase plan type wave depends_on files_modified autonomous user_setup must_haves
09-ci-pipeline 04 execute 3
09-02
09-03
.gitea/workflows/build.yaml
false
service why env_vars dashboard_config
slack Pipeline failure notifications
name source
SLACK_WEBHOOK_URL Slack App settings -> Incoming Webhooks -> Create new webhook -> Copy URL
task location
Create Slack app with incoming webhook https://api.slack.com/apps -> Create New App -> From scratch -> Add Incoming Webhooks
truths artifacts key_links
Pipeline runs type checking before Docker build
Pipeline runs unit tests with coverage before Docker build
Pipeline runs E2E tests before Docker build
Pipeline fails fast when tests or type checking fail
Slack notification sent on pipeline failure
Test artifacts (coverage, playwright report) are uploaded
path provides contains
.gitea/workflows/build.yaml CI pipeline with test jobs npm run check
path provides contains
.gitea/workflows/build.yaml Unit test step npm run test:coverage
path provides contains
.gitea/workflows/build.yaml E2E test step npm run test:e2e
from to via pattern
.gitea/workflows/build.yaml package.json scripts npm run commands npm run (check|test:coverage|test:e2e)
from to via pattern
build job test job needs: test needs:\s*test
Integrate tests into Gitea Actions pipeline with fail-fast behavior and Slack notifications.

Purpose: Ensure tests run automatically on every push/PR and block deployment when tests fail. This is the final piece that makes the test infrastructure actually protect production.

Output: Updated CI workflow with test job that runs before build, fail-fast on errors, and Slack notification on failure.

<execution_context> @/home/tho/.claude/get-shit-done/workflows/execute-plan.md @/home/tho/.claude/get-shit-done/templates/summary.md </execution_context>

@.planning/PROJECT.md @.planning/phases/09-ci-pipeline/09-RESEARCH.md @.planning/phases/09-ci-pipeline/09-02-SUMMARY.md @.planning/phases/09-ci-pipeline/09-03-SUMMARY.md

@.gitea/workflows/build.yaml @package.json

Task 1: Add test job to CI pipeline .gitea/workflows/build.yaml Update .gitea/workflows/build.yaml to add a test job that runs BEFORE build:
  1. Add new test job at the beginning of jobs section:
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        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 type check
        run: npm run check -- --output machine

      - name: Install Playwright browsers
        run: npx playwright install --with-deps chromium

      - name: Run unit tests with coverage
        run: npm run test:coverage

      - name: Run E2E tests
        run: npm run test:e2e
        env:
          CI: true

      - name: Upload test artifacts
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: test-results
          path: |
            coverage/
            playwright-report/
            test-results/
          retention-days: 7
  1. Modify existing build job to depend on test:
  build:
    needs: test
    runs-on: ubuntu-latest
    # ... existing steps ...

This ensures build only runs if tests pass (fail-fast behavior). YAML syntax is valid: python3 -c "import yaml; yaml.safe_load(open('.gitea/workflows/build.yaml'))" Build job has needs: test dependency Test job added to pipeline. Build job depends on test job (fail-fast).

Task 2: Add Slack notification on failure .gitea/workflows/build.yaml Add a notify job that runs on failure:
  notify:
    needs: [test, build]
    runs-on: ubuntu-latest
    if: failure()
    steps:
      - name: Notify Slack on failure
        env:
          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
        run: |
          curl -X POST -H 'Content-type: application/json' \
            --data "{\"text\":\"Pipeline failed for ${{ gitea.repository }} on ${{ gitea.ref }}\"}" \
            $SLACK_WEBHOOK_URL

Note: Using direct curl to Slack webhook rather than a GitHub Action for maximum Gitea compatibility (per RESEARCH.md recommendation).

The SLACK_WEBHOOK_URL secret must be configured in Gitea repository settings by the user (documented in user_setup frontmatter). YAML syntax is valid Notify job has if: failure() condition Notify job depends on both test and build Slack notification configured for pipeline failures.

Complete CI pipeline with test job, fail-fast behavior, artifact upload, and Slack notification 1. Review the updated .gitea/workflows/build.yaml file structure 2. Verify the job dependency chain: test -> build -> (notify on failure) 3. Confirm test job includes all required steps: - Type checking (svelte-check) - Unit tests with coverage (vitest) - E2E tests (playwright) 4. If ready to test in CI: - Push a commit to trigger the pipeline - Monitor Gitea Actions for the test job execution - Verify build job waits for test job to complete 5. (Optional) Set up SLACK_WEBHOOK_URL secret in Gitea to test failure notifications Type "approved" to confirm CI pipeline is correctly configured, or describe any issues found 1. .gitea/workflows/build.yaml has test job with: - Type checking step - Unit test with coverage step - E2E test step - Artifact upload step 2. Build job has `needs: test` (fail-fast) 3. Notify job runs on failure with Slack webhook 4. YAML is valid syntax 5. Pipeline can be triggered on push/PR

<success_criteria>

  • CI-02 satisfied: Unit tests run in pipeline before build
  • CI-03 satisfied: Type checking runs in pipeline
  • CI-04 satisfied: E2E tests run in pipeline
  • CI-05 satisfied: Pipeline fails fast on test/type errors (needs: test)
  • Slack notification on failure (per CONTEXT.md decision)
  • Test artifacts uploaded for debugging failed runs </success_criteria>
After completion, create `.planning/phases/09-ci-pipeline/09-04-SUMMARY.md`