Skip to content

Remote Patterns Schema Smoke #289

Remote Patterns Schema Smoke

Remote Patterns Schema Smoke #289

name: Remote Patterns Schema Smoke
# Validates that the live hosted patterns.json is structurally accepted by the
# extension (Valibot schema + RegExp compilation). This is independent of the
# canary, which tests whether regexes *match* live GitHub HTML.
on:
schedule:
# Every 6 hours at :47 past the hour. The interval happens to match
# PATTERN_REFRESH_TTL_MS but is not coupled to it — the smoke test guards
# the hosted config, while the TTL controls how often the extension polls.
- cron: '47 0,6,12,18 * * *'
workflow_dispatch:
inputs:
use_staging_url:
description: >-
Validate the staging branch instead of production (main branch).
Useful for testing config changes on the staging branch before
merging to main. Takes precedence over "Production parity" if both are checked.
type: boolean
default: false
run_production_parity:
description: >-
Run production (main) patterns.json with Act 4 — hosted patterns must
match bundled DEFAULT_PATTERNS (same as npm run test:remote-patterns:production:parity).
Ignored when "Use staging URL" is checked. Scheduled runs never use this (Acts 1–3 only).
type: boolean
default: false
concurrency:
group: remote-patterns-smoke
cancel-in-progress: true
jobs:
smoke:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Install npm dependencies
run: npm install
# URLs: extension/common/constants.ts. Staging → Act 4 parity on; default production → Acts 1–3;
# production + "parity" input → test:remote-patterns:production:parity (see remote-patterns-smoke-utils).
- name: Run remote patterns smoke test
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ inputs.use_staging_url }}" = "true" ]; then
npm run test:remote-patterns:staging
elif [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ inputs.run_production_parity }}" = "true" ]; then
npm run test:remote-patterns:production:parity
else
npm run test:remote-patterns
fi