Sitelet https://github.com/flutter/flutter/pull/190691
Skip to content

[flutter_tools] Anchor package version extraction regex in Wasm dry-run - #190691

Merged
auto-submit[bot] merged 3 commits into
flutter:masterfrom
kevmoo:issue-190644
Aug 10, 2026
Merged

auto-submit[bot] merged 3 commits into
flutter:masterfrom
kevmoo:issue-190644

Conversation

@kevmoo

@kevmoo kevmoo commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Anchor the Wasm dry-run package version regex to hosted/pub.dev/<package_name>- so that version-like numbers in ancestor directories (e.g. Flutter SDK version paths like /flutter/3.22.0/) are not matched as the package version.

Fixes #190644

Anchor the Wasm dry-run package version regex to `hosted/pub.dev/<package_name>-` so that version-like numbers in ancestor directories (e.g. Flutter SDK version paths like `/flutter/3.22.0/`) are not matched as the package version.

Fixes flutter#190644
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 7, 2026
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Aug 7, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the regular expression in Dart2WasmTarget to correctly extract package versions when ancestor directories contain numbers, and adds a corresponding test case. Feedback suggests making the domain matching more robust to support pub mirrors and private repositories instead of hardcoding hosted/pub.dev.

Comment thread packages/flutter_tools/lib/src/build_system/targets/web.dart Outdated
…extraction

Refactor package version extraction to use Dart 3 list pattern matching on `package.root.pathSegments` (`[..., 'hosted', _, final packageFolder]`), supporting any hosted pub mirror domain without regex parsing.

Add test coverage for custom pub mirrors and multi-host environments.
@kevmoo
kevmoo requested a review from biggs0125 August 7, 2026 03:06
@kevmoo

kevmoo commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the package version extraction logic in Dart2WasmTarget to use pattern matching on path segments instead of a regular expression on the full URI string. This change allows extracting package versions from custom pub mirrors and prevents issues when ancestor directories contain numbers. Additionally, three new unit tests are added to verify this behavior under various directory structures and hosted domains. I have no feedback to provide.

biggs0125
biggs0125 previously approved these changes Aug 7, 2026
Comment thread packages/flutter_tools/lib/src/build_system/targets/web.dart
Comment thread packages/flutter_tools/lib/src/build_system/targets/web.dart
@kevmoo kevmoo added autosubmit Merge PR when tree becomes green via auto submit App team-web Owned by Web platform team platform-web Web applications specifically e: wasm Issues related to the wasm build of Flutter Web. labels Aug 7, 2026
@biggs0125
biggs0125 self-requested a review August 10, 2026 15:07
@auto-submit
auto-submit Bot added this pull request to the merge queue Aug 10, 2026
Merged via the queue into flutter:master with commit 1f41b0c Aug 10, 2026
37 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 10, 2026
@kevmoo
kevmoo deleted the issue-190644 branch September 4, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD e: wasm Issues related to the wasm build of Flutter Web. platform-web Web applications specifically team-web Owned by Web platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tool][web] Wasm dry run package version extraction incorrectly matches leading path segments

2 participants