Skip to content

Make Sourcemap upload and inject --ignore paths more intuitive #2951

@szokeasaurusrex

Description

@szokeasaurusrex

Currently, paths passed to the sourcemaps upload and sourcemaps inject subcommands' --ignore argument are always interpreted as being relative to the path(s) being uploaded/injected. In the case where multiple paths are passed to these commands, --ignore ignores the specified ignore path in both of the upload/inject paths.

Current behavior example

Suppose I run the following command:

sentry-cli sourcemaps {inject|upload} path_a path_b \
    --ignore path_a/test \
    --ignore /Users/myuser/Development/my_project/path_a/exclude_files

We will inject/upload sourcemaps in ./path_a and ./path_b, ignoring any files in the following paths:

  • ./path_a/path_a/test
  • ./path_a/Users/myuser/Development/my_project/path_a/exclude_files
  • ./path_b/path_a/test
  • ./path_b/Users/myuser/Development/my_project/path_a/exclude_files

In this example, the behavior is likely not what the user expected.

New behavior

The command above should inject/upload sourcemaps in ./path_a and ./path_b, ignoring any of the files in the following paths:

  • ./path_a/test
  • /Users/myuser/Development/my_project/path_a/exclude_files

In other words, we should stop interpreting the --ignore paths as being relative to the paths to inject/upload. If the paths start with a /, we interpret them as absolute paths; otherwise, we should interpret them as being relative to the current directory (i.e. ./).

Metadata

Metadata

Labels

CLIProduct areaImprovementIssue typev3.0Breaking changes to include in version 3.0.0 of Sentry CLI

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions