-
Notifications
You must be signed in to change notification settings - Fork 4
Add --exclude option to filter files during uploads
#269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
joshedney
wants to merge
16
commits into
next
Choose a base branch
from
je/plat-15748-exclude-flag
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+393
−21
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6d0f375
workout what path we're using for the upload file path
joshedney 2cb4639
add exclude flag for the upload cli
joshedney a0b1fab
update tests for the exclude option
joshedney f7df5c8
add changelog entry for the --exclude flag
joshedney 02d2666
configure http/1.1 support for the CLI
joshedney ac848a7
configure http/1.1 support for the CLI
joshedney 27d2e6a
update changelog
joshedney 48f79d0
update changelog
joshedney a59cdc4
bump go version to allow use of http.Protocols
joshedney a2de11c
update go version
joshedney 3bef045
add support for ** globbing on the exclude flag
joshedney 778ea51
Merge pull request #270 from bugsnag/je/plat-15822
joshedney 4366ae0
update exclude flag help text
joshedney 516ef56
add support for ** globbing on the exclude falg
joshedney 356b82d
ensure that we are using the full path for the name of the file uploaded
joshedney 9594d9e
add test for excluding an abs path
joshedney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| Feature: Exclude option tests | ||
|
|
||
| Scenario: Exclude files with wildcard extension pattern | ||
| When I run bugsnag-cli with upload js --upload-api-root-url=http://localhost:$MAZE_RUNNER_PORT --api-key=1234567890ABCDEF1234567890ABCDEF --overwrite --base-url=example.com --exclude=*.map --project-root=features/js/fixtures/js-multiple-maps features/js/fixtures/js-multiple-maps/dist/ | ||
| Then I should receive no sourcemaps | ||
|
|
||
| Scenario: Exclude files matching specific filename pattern | ||
| When I run bugsnag-cli with upload js --upload-api-root-url=http://localhost:$MAZE_RUNNER_PORT --api-key=1234567890ABCDEF1234567890ABCDEF --overwrite --base-url=example.com --exclude=main.js.map --project-root=features/js/fixtures/js-multiple-maps features/js/fixtures/js-multiple-maps/dist/ | ||
| And I wait to receive 1 sourcemap | ||
| Then the sourcemaps are valid for the API | ||
| And the sourcemap payload field "minifiedUrl" equals "example.com/other.js" | ||
|
|
||
| Scenario: Exclude files with multiple patterns | ||
| When I run bugsnag-cli with upload js --upload-api-root-url=http://localhost:$MAZE_RUNNER_PORT --api-key=1234567890ABCDEF1234567890ABCDEF --overwrite --base-url=example.com --exclude=main.js.map --exclude=other.js.map --project-root=features/js/fixtures/js-multiple-maps features/js/fixtures/js-multiple-maps/dist/ | ||
| Then I should receive no sourcemaps | ||
|
|
||
| Scenario: Exclude with path pattern | ||
| When I run bugsnag-cli with upload js --upload-api-root-url=http://localhost:$MAZE_RUNNER_PORT --api-key=1234567890ABCDEF1234567890ABCDEF --overwrite --base-url=example.com --exclude=features/js/fixtures/js-multiple-maps/dist/** --project-root=features/js/fixtures/js-multiple-maps features/js/fixtures/js-multiple-maps/dist/ | ||
| Then I should receive no sourcemaps | ||
|
|
||
| Scenario: Exclude with absolute path | ||
| Given I get the current working directory | ||
| When I run bugsnag-cli with upload js --upload-api-root-url=http://localhost:$MAZE_RUNNER_PORT --api-key=1234567890ABCDEF1234567890ABCDEF --overwrite --base-url=example.com --exclude=$ABS_PATH/features/js/fixtures/js-multiple-maps/dist/other.js.map --project-root=features/js/fixtures/js-multiple-maps features/js/fixtures/js-multiple-maps/dist/ | ||
| And I wait to receive 1 sourcemap | ||
| Then the sourcemaps are valid for the API | ||
| And the sourcemap payload field "minifiedUrl" equals "example.com/main.js" | ||
|
|
||
| Scenario: Exclude with path glob pattern | ||
| When I run bugsnag-cli with upload js --upload-api-root-url=http://localhost:$MAZE_RUNNER_PORT --api-key=1234567890ABCDEF1234567890ABCDEF --overwrite --base-url=example.com --exclude=**/dist/** --project-root=features/js/fixtures/js-multiple-maps features/js/fixtures/js-multiple-maps/dist/ | ||
| Then I should receive no sourcemaps | ||
|
|
||
| Scenario: Upload succeeds when exclude pattern doesn't match | ||
| When I run bugsnag-cli with upload js --upload-api-root-url=http://localhost:$MAZE_RUNNER_PORT --api-key=1234567890ABCDEF1234567890ABCDEF --overwrite --base-url=example.com --exclude=*.log --project-root=features/js/fixtures/js-multiple-maps features/js/fixtures/js-multiple-maps/dist/ | ||
| And I wait to receive 2 sourcemaps | ||
| Then the sourcemaps are valid for the API |
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -117,10 +117,10 @@ type Breakpad struct { | |||||
|
|
||||||
| type Upload struct { | ||||||
| // shared options | ||||||
| Retries int `help:"The number of retry attempts before failing an upload request" default:"0"` | ||||||
| Timeout int `help:"The number of seconds to wait before failing an upload request" default:"300"` | ||||||
| UploadAPIRootUrl string `help:"The upload server hostname, optionally containing port number"` | ||||||
|
|
||||||
| Retries int `help:"The number of retry attempts before failing an upload request" default:"0"` | ||||||
| Timeout int `help:"The number of seconds to wait before failing an upload request" default:"300"` | ||||||
| UploadAPIRootUrl string `help:"The upload server hostname, optionally containing port number"` | ||||||
| Exclude []string `help:"Exclude files matching these patterns. Supports wildcards (*.map), recursive globs (node_modules/**, **/*.test.js) and exact filenames (file.js.map)."` | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| // required options | ||||||
| All DiscoverAndUploadAny `cmd:"" help:"Upload any symbol/mapping files"` | ||||||
| AndroidAab AndroidAabMapping `cmd:"" help:"Process and upload application bundle files for Android"` | ||||||
|
|
||||||
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this change not have a functional effect? Or does it fix an existing limitation for nested files?