{{ message }}
Repository navigation
fix: resolve win32 product.json path in native policy smoke fixture (build fix for vscode-engineering#3813) - #335152
Merged
Ross Wollman (rwoll) merged 2 commits intoSep 8, 2026
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused change reuses established Windows build-path discovery while preserving existing macOS and Linux behavior.
Pull request overview
Fixes Windows native-policy smoke tests by resolving the packaged product manifest from nested build layouts.
Changes:
- Adds and exports a platform-aware
getBuildProductPathhelper. - Uses the helper in the native policy fixture.
File summaries
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Ross Wollman (rwoll)
marked this pull request as ready for review
September 8, 2026 20:58
Ross Wollman (rwoll)
enabled auto-merge
September 8, 2026 20:58
Ross Wollman (rwoll)
approved these changes
Sep 8, 2026
Ross Wollman (rwoll)
approved these changes
Sep 8, 2026
Ross Wollman (rwoll)
left a comment
Member
There was a problem hiding this comment.
This looks good. We missed the packaged-build layout in our test matrix: GitHub PR checks run from source, while the failing Azure DevOps job uses --build.
🤖 Posted via Copilot.
Raymond Zhao (rzhao271)
approved these changes
Sep 8, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cea11743-4d3d-48b7-9b6d-8028b722593d
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.

Build failure
The "Native Policy Plumbing" smoke tests (Electron, Windows) fail in their
before allhook withENOENT: no such file or directory, open '...\VSCode-win32-x64\resources\app\product.json'. Both Policy Plumbing tests throw before any assertion runs, failing the Windows Electron smoke stage onmain.Root cause
test/smoke/src/areas/policy/nativePolicy.tsresolved the built product manifest on Windows by joiningresources/app/product.jsonontopath.dirname(getBuildElectronPath(options.codePath))— effectively the root of the build output. However, the Windows built app nests its payload inside a subdirectory (e.g.VSCode-win32-x64).getBuildElectronPathitself accounts for this: for win32 it uses thefindFilePathhelper intest/automation/src/electron.ts, which searches one level of subdirectories forresources/app/product.json. The fixture bypassed that logic and assumed the file lived directly under the root, sofs.readFileSynchit a non-existent path and threw.How the fix works
Added an exported
getBuildProductPath(root)helper intest/automation/src/electron.tsthat resolvesproduct.jsonper-platform, reusing the existingfindFilePathsubdirectory search on win32 (the same mechanismgetBuildElectronPath/getBuildVersionalready use).nativePolicy.tsnow callsgetBuildProductPath(options.codePath)instead of hand-rolling the path, so the Windows nested layout is handled correctly and darwin/linux behavior is preserved. This corrects the invalid path producer rather than guarding the consumer or swallowing the error.Rollback evaluation
Recommendation: Do not roll back. Public culprit: PR #335107 (commit
644fe2ac), which introduced the fixture. The regression is isolated to new test-fixture path resolution with no product/runtime/schema impact, and this fix-forward is a small, bounded correction that reuses existing, proven path-resolution logic. Reverting would only remove the new smoke coverage. Owners to consult:@rwollValidation
Source inspection only.
getBuildElectronPath(win32) andgetBuildVersion(win32) already rely onfindFilePathto locateresources/app/product.jsonwithin a subdirectory of the build root, confirming the nested layout; the new helper reuses the identical resolution. TypeScript type checking / smoke test execution could not be run in this environment (thetscand build tooling were unavailable to the agent).Risk
Low. The change is confined to test automation/smoke code, adds a helper that mirrors existing behavior, and leaves the non-Windows paths functionally unchanged.
Recommended reviewer
Recommended owner:
@rwollFixes microsoft/vscode-engineering#3813