Repository navigation
feat: landing consolidation phase 2 — consistency, assets, CI, and graceful degradation #184
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
71b984f
feat: landing consolidation phase 2 — consistency, assets, CI, and gr…
ulises-jeremias e2b2e92
fix(ci): remove cache: npm from setup-node — repo has no root lockfile
ulises-jeremias 5e94ed9
fix(ci): start dev server properly in landing-visual workflow
ulises-jeremias ede8be4
fix(ci): fix PORT variable scope and use page.screenshot instead of t…
ulises-jeremias da678fb
fix(ci): fix landing visual test spec and dev server startup
ulises-jeremias a810732
fix(review): address self-review findings
ulises-jeremias 373a2ed
fix(ci): handle webextension dev server in landing-visual
ulises-jeremias 1ecd6a4
fix: address all CodeRabbit review comments
ulises-jeremias 1d41b96
fix: revert landing.spec.ts to page.screenshot (no baselines yet), re…
ulises-jeremias 061deca
fix: fix updateSnapshots value to 'none', handle webextension health …
ulises-jeremias 98de6c1
fix: skip visual tests for webextension (no dev server), fix updateSn…
ulises-jeremias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| name: Landing Visual Regression | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'shared/assets/**' | ||
| - 'templates/**/Landing*' | ||
| - 'templates/**/landing*' | ||
| - 'templates/**/page.module.css' | ||
| - 'templates/**/index.astro' | ||
| - 'templates/**/Newtab.*' | ||
| - 'templates/**/Popup.*' | ||
| - 'scripts/landing-visual/**' | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| visual: | ||
| name: Visual regression on ${{ matrix.template }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| template: | ||
| - react-vite-starter | ||
| - nextjs-starter | ||
| - remix-starter | ||
| - astro-starter | ||
| - webextension-react-vite-starter | ||
| port: | ||
| - 5173 | ||
| include: | ||
| - template: nextjs-starter | ||
| port: 3000 | ||
| - template: astro-starter | ||
| port: 4321 | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||
| with: | ||
| node-version: 22 | ||
|
|
||
| - name: Install Playwright | ||
| working-directory: scripts/landing-visual | ||
| run: | | ||
| npm install | ||
| npx playwright install chromium --with-deps | ||
|
|
||
| - name: Scaffold test project | ||
| id: scaffold | ||
| continue-on-error: true | ||
| run: | | ||
| CI=true npx create-awesome-node-app visual-test-project \ | ||
| -t "file://${PWD}?subdir=templates/${{ matrix.template }}" | ||
| echo "Project scaffolded" | ||
|
|
||
| - name: Start dev server | ||
| if: steps.scaffold.outcome == 'success' | ||
| working-directory: visual-test-project | ||
| run: | | ||
| npm install | ||
| if [ "${{ matrix.template }}" = "nextjs-starter" ]; then | ||
| npm run dev -- --port "${{ matrix.port }}" & | ||
| else | ||
| npm run dev -- --host 0.0.0.0 --port "${{ matrix.port }}" & | ||
| fi | ||
| echo "Waiting for dev server on port ${{ matrix.port }}..." | ||
| for i in $(seq 1 30); do | ||
| curl -sf "http://localhost:${{ matrix.port }}" > /dev/null 2>&1 && echo "Server ready on port ${{ matrix.port }}" && break | ||
| sleep 1 | ||
| done | ||
| curl -sf "http://localhost:${{ matrix.port }}" > /dev/null 2>&1 || { echo "Server failed to start on port ${{ matrix.port }}"; exit 1; } | ||
|
|
||
| - name: Run visual tests | ||
| if: steps.scaffold.outcome == 'success' | ||
| working-directory: scripts/landing-visual | ||
| run: | | ||
| npx playwright test --project=chromium | ||
| env: | ||
| TEMPLATE: ${{ matrix.template }} | ||
| BASE_URL: http://localhost:${{ matrix.port }} | ||
|
|
||
| - name: Upload screenshots (always) | ||
| if: always() && steps.scaffold.outcome == 'success' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: screenshots-${{ matrix.template }} | ||
| path: | | ||
| scripts/landing-visual/test-results/ | ||
| scripts/landing-visual/__screenshots__/ | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Scaffold failures are silently swallowed, job reports success with no tests run.
continue-on-error: trueon the scaffold step means its failure doesn't fail the job. Since all later steps (dev server, Playwright run, screenshot upload) are gated onsteps.scaffold.outcome == 'success'and none of them run/fail in that case, the job conclusion is a false "success" — visual regression silently never executes.🔧 Proposed fix
- name: Scaffold test project id: scaffold - continue-on-error: true run: | CI=true npx create-awesome-node-app visual-test-project \ -t "file://${PWD}?subdir=templates/${{ matrix.template }}" echo "Project scaffolded"If scaffold flakiness needs tolerance, retry instead of masking failure, and add an explicit final step that fails the job when
steps.scaffold.outcome != 'success'.📝 Committable suggestion
🤖 Prompt for AI Agents