Skip to content

ci(windows): scope baseline by affected surface - #2599

Merged
Astro-Han merged 3 commits into
apache:mainfrom
liugddx:ci/windows-baseline-impact
Aug 9, 2026
Merged

Astro-Han merged 3 commits into
apache:mainfrom
liugddx:ci/windows-baseline-impact

Conversation

@liugddx

@liugddx liugddx commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

Make the non-blocking Windows baseline consume the existing repository impact plan instead of running every expensive Windows surface for every pull request.

  • skip the Windows runner entirely for documentation-only changes
  • keep install, build, inventory, script checks, and CLI/Electron smoke for ordinary code changes
  • run the Runtime PTY gate only when the Runtime workspace is affected
  • run the full Storage baseline and managed-workspace crash gates only when Storage is affected
  • reuse build:test output in the Windows smoke instead of rebuilding the repository
  • fail safe to the full Windows suite when Git history is unavailable or a global/unknown production file changes

The measured #2523 baseline took 6m31s. Storage and managed-workspace recovery consumed about 4m08s, and smoke rebuilt artifacts that had already been produced. Desktop/UI pull requests should therefore retain Windows startup evidence while avoiding most of that unrelated critical path. Storage and Runtime changes retain their owning Windows evidence.

Refs #2142

Verification

  • node --test scripts/ci-test-plan.test.mjs scripts/windows-baseline-workflow.test.mjs scripts/windows-smoke.test.mjs — 12 pass, 1 Windows-only skip
  • parsed .github/workflows/windows-baseline.yml with the repository YAML dependency
  • Biome check passed for changed JavaScript and package.json files
  • git diff --check passed

中文说明

展开中文说明

本 PR 让非阻塞 Windows baseline 复用仓库现有的影响面计算,不再让所有 PR 都执行全部 Windows 重型测试。

  • 纯文档改动不再占用 Windows runner
  • 普通代码改动仍保留依赖安装、构建、清单检查、脚本测试以及 CLI/Electron 启动 smoke
  • 只有 Runtime 受影响时才运行 Windows PTY gate
  • 只有 Storage 受影响时才运行完整 Storage baseline 和 managed-workspace crash gate
  • Windows smoke 复用 build:test 产物,不再重复构建仓库
  • Git 历史不可用、全局配置或未知生产文件变更时,安全回退到完整 Windows 测试

实测 #2523 的 Windows baseline 总耗时 6 分 31 秒,其中 Storage 与 managed-workspace recovery 约占 4 分 08 秒,smoke 还重复进行了一次构建。调整后,Desktop/UI PR 仍有 Windows 构建和真实启动证据,但不会承担无关的 Storage/Crash 关键路径;Storage 和 Runtime 改动仍保留各自负责的 Windows 证据。

关联 #2142

验证:12 项通过,1 项仅 Windows 环境运行而跳过;workflow YAML 解析、Biome 和 git diff 检查均通过。

Checklist

  • Tests cover the change and fail without it
  • Lint, format, workflow parsing, and affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — CI scheduling changes; product behavior does not
  • No

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tightening the Windows CI scope — reusing the existing planner is a good direction. I found three issues:

  • [P1] build:test cleans the outputs, but Desktop’s build:test does not produce dist-renderer or the runtime resource. The current Windows run already shows the Electron smoke failing with ERR_FILE_NOT_FOUND for dist-renderer/index.html; the check only appears green because the lane is non-blocking. I think the smoke build should explicitly produce all artifacts it consumes.
  • [P2] A change to windows-baseline.yml itself selects Windows, but not the Runtime or Storage surfaces. That means a PR modifying those specialized steps will skip the exact paths it changes.
  • [P2] git diff --name-only reports only the destination of a detected rename, so a cross-surface rename can hide the deleted source path and under-select Windows gates. --no-renames, or parsing both paths from --name-status -z, would keep this fail-safe.

Thanks again for working on this — the overall direction looks good, but these gaps make the scoped evidence less reliable than intended.

@liugddx
liugddx force-pushed the ci/windows-baseline-impact branch from 143ba42 to c831323 Compare August 9, 2026 14:45
@liugddx

liugddx commented Aug 9, 2026

Copy link
Copy Markdown
Member Author

Addressed all three findings in c831323:

  • Smoke now builds only the missing Desktop resources and renderer after build:test, then explicitly verifies both artifacts before launching Electron. It does not restore the duplicate full-repository build.
  • A windows-baseline.yml change now selects both Runtime and Storage gates, so edits to specialized steps exercise those paths.
  • Impact detection now uses git diff --no-renames; a cross-surface Storage-to-Desktop rename regression test confirms both paths remain visible.

I also removed the earlier optimization-evidence comment because smoke had failed under continue-on-error.

Local verification: build:test plus Desktop build:smoke produced dist-renderer/index.html and the runtime filesystem worker; 14 tests pass with 1 Windows-only skip; workflow YAML parsing, Biome, and diff checks pass. Fresh Windows CI is now running.

@liugddx
liugddx requested a review from Astro-Han August 9, 2026 14:52

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — I rechecked the three findings against the current head and the fresh Windows run. They are all addressed:

  • the smoke lane now builds only the missing Desktop renderer and runtime resource, verifies both artifacts, and successfully exercises the real Electron startup path;
  • changes to windows-baseline.yml select both Runtime and Storage gates;
  • impact detection uses --no-renames, with coverage for a cross-surface rename.

The remaining internal Windows baseline failures reproduce on the base revision and are unrelated to this PR. I found no new blocking issues. Approved.

@Astro-Han
Astro-Han merged commit e23b85c into apache:main Aug 9, 2026
12 checks passed
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.

2 participants