feat: complete CI/CD setup with automated testing (phases 1-3)#2
Open
feat: complete CI/CD setup with automated testing (phases 1-3)#2
Conversation
Phase 1 of GitOps implementation: automated quality checks on every push and PR. Added: - GitHub Actions workflow (.github/workflows/ci.yml) that runs on push/PR to main - Quality job: lint, typecheck, test, format check - Build job: verifies Next.js build succeeds - ESLint config (.eslintrc.cjs) for Next.js + TypeScript - Allows up to 1000 warnings during transition - Ignores refs/, scripts/, subgraph/ directories - Prettier config (.prettierrc) for consistent code formatting - Vitest setup (vitest.config.ts, vitest.setup.ts) for unit testing - jsdom environment for React component testing - Sample test file included - Husky pre-commit hook (.husky/pre-commit) with lint-staged - Automatically runs lint/format on staged files before commit - Prevents broken code from being committed Updated: - package.json: added scripts (lint, format, typecheck, test, etc.) - tsconfig.json: excludes vitest config files from type checking All checks pass locally. Build verified before commit per engineering guidelines.
Phase 2 of GitOps implementation: end-to-end testing with mocked web3 services. Added: - Playwright E2E test framework (playwright.config.ts) - Configured for local dev and CI environments - HTML reporter for test results - Automatic retries on CI - Smoke test suite (e2e/smoke.spec.ts) - Verifies landing page loads and renders - Basic navigation accessibility checks - MSW integration for HTTP/GraphQL mocking - MSW mocking layer (e2e/mocks/) - Handlers for Arkiv GraphQL endpoint (/api/graphql) - Mock responses for networkOverview and profile queries - Server setup for request interception - Viem mock transport placeholder (lib/test/viemMockTransport.ts) - Documents approach for RPC mocking if needed - MSW handles HTTP interception for most cases - E2E seed data structure (e2e/fixtures/seed.ts) - Deterministic test data for predictable scenarios - Guarded behind E2E_SEED env var (no secrets) Updated: - package.json: added e2e, e2e:ui, e2e:debug scripts - CI workflow: added e2e job that runs after build - Installs Playwright browsers - Starts Next.js server - Runs E2E tests with mocked services - Uploads test reports as artifacts on failure - Marked continue-on-error initially for stability All checks pass locally. Build verified before commit per engineering guidelines.
Phase 3 of GitOps implementation: team hygiene and quality gates. Added: - PR template (.github/PULL_REQUEST_TEMPLATE.md) - Standardized sections: What, Why, Testing, Checklist - Aligned with ENGINEERING_GUIDELINES.md requirements - Ensures PRs include necessary context and verification - Dependabot config (.github/dependabot.yml) - Weekly npm dependency checks - Auto-opens PRs for security updates - Groups security updates to reduce PR noise - Coverage thresholds (vitest.config.ts) - Set to 0% baseline (prevents backsliding) - Goal: raise to 20% → 40% → 60% → 80% as test suite grows - CI fails if coverage drops below thresholds Updated: - Implementation plan (refs/GITOPS_IMPLEMENTATION_PLAN.md) - Clarified: mocks ONLY for smoke tests - Full E2E tests use REAL Arkiv queries and REAL web3 - Ensures integration testing with actual services, not mocked responses - Updated Phase 2 status to complete - Updated coverage threshold guidance (0% baseline) Note: Branch protection rules must be configured in GitHub repo settings (no code changes needed). See implementation plan for details. All checks pass locally. Build verified before commit per engineering guidelines.
Add comprehensive E2E tests that use REAL Arkiv queries and REAL web3 services. Added: - Real Arkiv integration tests (e2e/arkiv-real.spec.ts) - Tests GraphQL endpoint with real Arkiv indexer queries - Tests network page loading real Arkiv data - Tests profile queries against real Arkiv - Verifies landing page loads without errors - NO MOCKS - uses real services for integration confidence - Updated smoke tests (e2e/smoke.spec.ts) - Clearly marked as mocked tests for fast checks - Separated from real integration tests - Updated Playwright config - Clarified smoke vs real test distinction - Real tests explicitly disable mocks Updated: - CI workflow (.github/workflows/ci.yml) - Runs smoke tests (mocked) first for fast feedback - Runs real Arkiv tests (real services) separately - Real tests marked continue-on-error (may fail if Arkiv/RPC unavailable) - This ensures we test actual integration, not just mocked responses Testing approach: - Smoke tests: Fast, mocked, CI-friendly (basic rendering checks) - Real tests: Full integration with real Arkiv/web3 (production-like confidence) - Balance between speed (smoke) and confidence (real E2E) All checks pass locally. Build verified before commit per engineering guidelines.
Auto-fixed by lint-staged during previous commit. Changes let to const for variables that are never reassigned.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Best practice: Husky git hooks are only needed locally, not in CI. Setting HUSKY=0 prevents potential issues during pnpm install in CI environments while keeping hooks functional for local development.
Update prepare script to check for CI environment variable (set by GitHub Actions) and HUSKY=0 before running husky. This ensures husky only runs locally, preventing install failures in CI while maintaining hooks for local development.
CI was using pnpm 9 but lockfile was generated with pnpm 8.6.0. Update all CI jobs to use pnpm 8.6.0 to match local environment and prevent lockfile version mismatch errors.
17f731c to
3097cab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Complete GitOps implementation with CI/CD pipeline, automated testing, and team hygiene tools.
Why
Establish automated quality gates to prevent broken code from reaching main and ensure consistent code quality across the team.
Testing
pnpm format:check && pnpm lint && pnpm typecheck && pnpm test && pnpm build)Checklist
pnpm buildsucceeds)Changes Summary
Phase 1 - Foundation:
Phase 2 - Real Testing:
Phase 3 - Team Hygiene:
Notes