Skip to content

feat: ignore path list for web#340

Open
buenaflor wants to merge 19 commits intomainfrom
feat/add-ignore-path-list-for-web
Open

feat: ignore path list for web#340
buenaflor wants to merge 19 commits intomainfrom
feat/add-ignore-path-list-for-web

Conversation

@buenaflor
Copy link
Copy Markdown
Contributor

@buenaflor buenaflor commented Jul 1, 2025

📜 Description

Adds support for ignoring files and directories when uploading sourcemaps and sources for Flutter Web

💡 Motivation and Context

Closes #329

💚 How did you test it?

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 1, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against af96d33

@buenaflor buenaflor changed the title ignore path list for web feat: ignore path list for web Jul 1, 2025
@buenaflor buenaflor marked this pull request as ready for review July 14, 2025 15:27
@buenaflor buenaflor requested a review from stefanosiano as a code owner July 14, 2025 15:27
Comment on lines 3 to +10
class ConfigFormatter {
static String formatConfig(
String config, ConfigFileType fileType, String? url) {
// Add URL if provided
if (url != null) {
config = _addUrlPrefix(config, fileType, url);
String config,
ConfigFileType fileType,
String? url,
) {
if (url?.isNotEmpty == true) {
config = _addUrlPrefix(config, fileType, url!);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

eventually we should rewrite the test to not rely on things like normalizing the pubspec and properties file to a string.

adding more and more business logic to test code is generally not good

Copilot AI review requested due to automatic review settings March 20, 2026 09:39
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 20, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • Ignore path list for web by buenaflor in #340

Internal Changes 🔧

Release

  • Fix changelog-preview permissions by BYK in #373
  • Switch from action-prepare-release to Craft by BYK in #371

Other

  • (deps) Bump actions/checkout from 4 to 5 by dependabot[bot] in #350
  • Use pull_request_target for changelog preview by BYK in #372

Other

  • internal: Instrument plugin with Sentry tracing & error by buenaflor in #381

🤖 This preview updates automatically when you update the PR.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for configuring a web-specific ignore list so unwanted files/directories can be excluded when uploading Flutter Web sourcemaps and (optionally) sources, addressing #329.

Changes:

  • Introduces ignore_web_source_paths config (args + pubspec.yaml + sentry.properties) and threads it through Configuration.
  • Adds --ignore flags to the sentry-cli sourcemaps upload invocation and uses glob matching to exclude ignored files during web file enumeration.
  • Updates tests and changelog to cover/document the new configuration.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/utils/config_formatter.dart Enhances test-only config formatting to support list-like values for properties/yaml fixtures.
test/plugin_test.dart Asserts --ignore is appended to the sourcemaps upload command when configured.
test/configuration_values_test.dart Adds coverage for parsing ignore_web_source_paths from args, yaml, and properties.
test/configuration_test.dart Verifies merged configuration exposes ignoreWebSourcePaths with correct precedence/defaults.
pubspec.yaml Adds glob dependency for ignore-pattern matching.
lib/src/utils/config-reader/yaml_config_reader.dart Adds getList support for YAML list values.
lib/src/utils/config-reader/properties_config_reader.dart Adds getList support for comma-separated values in properties.
lib/src/utils/config-reader/no_op_config_reader.dart Implements getList returning null.
lib/src/utils/config-reader/fallback_config_reader.dart Adds getList delegation to primary/fallback readers.
lib/src/utils/config-reader/config_reader.dart Extends ConfigReader interface with getList.
lib/src/configuration_values.dart Adds ignoreWebSourcePaths to config values + parsing from args/readers/merge.
lib/src/configuration.dart Stores ignoreWebSourcePaths on loaded configuration with default [].
lib/sentry_dart_plugin.dart Adds glob-based ignore filtering for web file enumeration + passes --ignore to sourcemaps upload.
CHANGELOG.md Documents the new ignore_web_source_paths feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@buenaflor buenaflor marked this pull request as draft March 20, 2026 10:20
- Filter empty strings after comma-split in `fromArguments` and `getList`
  to handle trailing commas gracefully
- Strip bracket syntax (`[`/`]`) in `PropertiesConfigReader.getList` so
  users can write `key=[a, b]` in sentry.properties without breaking Glob

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@buenaflor buenaflor requested a review from Copilot March 23, 2026 10:42
@buenaflor
Copy link
Copy Markdown
Contributor Author

@sentry review

@buenaflor buenaflor marked this pull request as ready for review March 23, 2026 10:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Normalize backslash path separators to forward slashes before glob
  matching to ensure ignore patterns work cross-platform
- Add doc comment to ignoreWebSourcePaths for consistency with other
  configuration fields

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Prevent source upload to upload anything in the folder

3 participants