Skip to content

fix(ratewise): GA E2E gate 回歸監測窗補強+Lighthouse smoke paths 擴充 Authority Guide - #657

Merged
s123104 merged 2 commits into
experiment/ratewise-product-2026h2from
fix/ga-e2e-guard-and-smoke-paths
Jul 6, 2026
Merged

fix(ratewise): GA E2E gate 回歸監測窗補強+Lighthouse smoke paths 擴充 Authority Guide#657
s123104 merged 2 commits into
experiment/ratewise-product-2026h2from
fix/ga-e2e-guard-and-smoke-paths

Conversation

@s123104

@s123104 s123104 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Closes #344

Summary

兩個獨立的測試/CI 守門補強,均不影響 runtime 使用者可見行為(單一 patch changeset 涵蓋)。

Commit 1:GA E2E hostname gate 回歸監測窗補強

回應 PR #629 review thread A5(discussion_r3526164835)

  • 問題ga-defer-lcp.spec.ts 非正式 host 分支僅等 300ms 即斷言零 GA config,短於 ANALYTICS_INIT_DELAY_MS(6s)。若 hostname gate([bug] GA4 於 staging 無環境 gate 照常外送,QA 流量污染正式資料 #606)回歸,GA 會在約 6 秒後初始化,而測試已提前通過,形同未受保護。
  • 修法HAS_BUILT_GA_RUNTIME && !IS_PRODUCTION_HOST 情境改等待完整 analytics 初始化窗口(init delay 6s+idle timeout 2s+1s buffer)後再取樣斷言零 config;等待值鏡射 src/config/performance.ts 預設並尊重 VITE_ANALYTICS_INIT_DELAY_MS / VITE_ANALYTICS_IDLE_TIMEOUT_MS env 覆寫(該檔依賴 import.meta.env,Playwright node 端無法直接 import)。斷言本身不放寬;無 GA runtime 建置維持 300ms 短取樣,避免無謂 e2e 時間成本。
  • 驗證:本地實跑兩分支——localhost(gate 分支,config=0,取樣延後至 ~9s)6/6 通過;PLAYWRIGHT_BASE_URL=https://app.haotool.org 正式站 host 分支 config=1 通過。

Commit 2:Lighthouse CI smoke paths 擴充(#344

  • LIGHTHOUSE_CI_SMOKE_PATHS 新增 3 篇 Authority Guide:/sell-rate-vs-mid-rate//cash-vs-spot-rate//card-rate-guide/(canonical trailing slash)。
  • seo-paths.config.mjssrc/config/seo-paths.ts 雙 SSOT 同步(verify-ssot-sync 通過);不新增第二份 URL 清單。
  • 消費點確認:.lighthouserc.cjsscripts/lighthouse-production.mjsscripts/lighthouse-ci.sh 均由 APP_CONFIG.lighthouseSmokePaths 展開,實際 dump 展開結果為 6 條 URL 正確。
  • docs/SEO_MASTER_SSOT.md B4 敘述同步。

Test plan

  • ga-defer-lcp.spec.ts 本地實跑(offline-pwa-chromium)6/6 通過(localhost gate 分支)
  • 正式站 host 分支實跑通過(config 恰 1 次)
  • seo-paths.test.ts 37/37 通過;verify-ssot-sync 綠燈
  • pre-commit(lint-staged/typecheck/prettier/SSOT/版本守門)與 pre-push(typecheck+全套 vitest+build:ratewise)全過
  • CI Lighthouse smoke 於 6 條 URL 上穩定(PR checks 觀察)

稽核

  • changeset:單一 patch(測試與 CI 覆蓋改善,無使用者可見行為變更)
  • 002:兩筆 reward(+1/+1,累計 +171→+172;base 檔頭為 +170,多線並行後合者請 rebase 重算)

Made with Cursor

haotool and others added 2 commits July 7, 2026 03:53
- 非正式 host 且內嵌 GA runtime 分支改等待完整 analytics 初始化窗口(6s+2s idle+1s buffer)再斷言零 config
- 等待值鏡射 src/config/performance.ts 預設並尊重 VITE_ANALYTICS_* env 覆寫,斷言本身不放寬
- 無 GA runtime 建置維持 300ms 短取樣,避免無謂 e2e 時間成本
- 002 新增 reward 紀錄(本次 +1,累計 +171)

測試:playwright ga-defer-lcp.spec.ts offline-pwa-chromium 全 6 例通過(含正式站 host 分支實跑)

Co-authored-by: Cursor <cursoragent@cursor.com>
- LIGHTHOUSE_CI_SMOKE_PATHS 新增 sell-rate-vs-mid-rate、cash-vs-spot-rate、card-rate-guide(#344)
- seo-paths.config.mjs 與 src/config/seo-paths.ts 雙 SSOT 同步,canonical trailing slash
- 消費點不變:.lighthouserc.cjs、lighthouse-production.mjs、lighthouse-ci.sh 均由 APP_CONFIG 取得
- SEO_MASTER_SSOT B4 敘述同步;新增 patch changeset;002 新增 reward(本次 +1,累計 +172)

測試:verify-ssot-sync 通過;seo-paths.test.ts 37 例通過;三個消費點展開清單驗證正確

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

✅ SEO 審計通過!所有 2026 標準驗證項目都符合要求。

  • ✅ Sitemap 2026 標準
  • ✅ Breadcrumb Schema
  • ✅ JSON-LD 結構化數據
  • ✅ 內部連結結構

@s123104
s123104 merged commit 17647b9 into experiment/ratewise-product-2026h2 Jul 6, 2026
11 checks passed
@s123104
s123104 deleted the fix/ga-e2e-guard-and-smoke-paths branch July 6, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant