Repository navigation
fix(coverage): match the cloud source-map path candidates - #3320
Merged
Merged
Conversation
Add tests/fixtures/source-map-path-contract.json, a public fixture of source-map path cases with the expected ordered candidate list. The Rust check of `fallow coverage upload-source-maps` now runs every case, and Fallow Cloud runs the same file against its implementation, so a drift between the two fails a test. The fixture found four differences, now fixed in the CLI: - `webpack:///@scope/app/./src/x.ts` lost its first segments as a webpack namespace. A `/` right after `webpack://` means no namespace. - An empty `sourceRoot` added a leading `/`. It is now ignored. - The parent-directory candidates used the map path as given, so `dist/../out/a.js.map` gave a `dist` candidate. The map path is now canonicalized first. - Empty candidates are no longer listed.
Collaborator
Author
|
Released in v3.33.1. |
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.
Summary
The pre-upload warning of
fallow coverage upload-source-maps(#3298, #3310) copies the path rules that Fallow Cloud uses to resolvesources[]entries. Until now, nothing kept the two implementations equal.This PR adds
tests/fixtures/source-map-path-contract.json, a public fixture of path cases. Each case givesraw,sourceRoot(ornull),mapPath, and the expected ordered candidate list. A new test insource_map_sources.rsruns every case throughsource_candidates. Fallow Cloud vendors the same file at a pinned commit and runs it against its implementation, so a rule change on one side fails a test.The cases cover tsc dist-relative sources,
sourceRoot: "/"withrootDir: src, webpack namespaces (./and../forms),webpack:///, Angular CLI workspace-relative sources, Turbopack[project]/,file:///sources, percent encoding (invalid%zz, truncated%4,%+1,%FF, multi-byte, double decode%2541), Windows drives, backslashes, and map paths with.,..and doubled slashes.Fixes found by the fixture
webpack:///@scope/app/./src/x.tslost@scope/appas a webpack namespace. A/right afterwebpack://now means no namespace.sourceRootadded a leading/. It is now ignored.dist/../out/a.js.mapgave adist/...candidate. The map path is now canonicalized first.Each fix is necessary: reverting any one of them alone fails a named fixture case.
Verification
cargo test -p fallow-cli --lib coverage::source_map_sources: pass.npm run verify:fastandnpm run verify:full: pass. The full run does not include the release jobs or the network and real-project smoke tests.fallow coverage upload-source-maps --dry-runon a public Storybook Angular webpack build (nl-design-system/rijkshuisstijl-community) gives the same warning with 3.33.0 and with this branch.