Skip to content
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

feat: snapshot and upload --dry-run flag #486

Merged
merged 2 commits into from
Mar 17, 2020
Merged

feat: snapshot and upload --dry-run flag #486

merged 2 commits into from
Mar 17, 2020

Conversation

wwilsman
Copy link
Contributor

Purpose

When honing in your file globs for the upload and snapshot commands, it can be exhaustive to keep creating new Percy builds. This adds a --dry-run (or -d) flag to both commands which will not create a new Percy build and print the list of matching paths.

Approach

For the snapshot command, the snapshot service is responsible for parsing the paths. At that point in the command execution, a build has already been created and the local server started. The resulting paths also have the localhost URL and port attached which is not desirable for printing just the paths. For this command, the glob parsing was copy and pasted into another command method which is called when --dry-run is provided.

For the upload command, the build is created after glob parsing. So we can safely handle the --dry-run parameter in the snapshotAll method and exit early after printing matching paths.

There were no unit tests for the upload command so the snapshot command tests were copied over and adjusted accordingly.

@wwilsman wwilsman requested a review from Robdel12 March 17, 2020 21:36
Copy link
Contributor

@Robdel12 Robdel12 left a comment

Choose a reason for hiding this comment

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

🏁 This is rad

@wwilsman wwilsman merged commit 6e259a3 into master Mar 17, 2020
@delete-merged-branch delete-merged-branch bot deleted the ww/dry-run branch March 17, 2020 22:13
djones pushed a commit that referenced this pull request Mar 17, 2020
# [0.26.0](v0.25.0...v0.26.0) (2020-03-17)

### Features

* snapshot and upload --dry-run flag ([#486](#486)) ([6e259a3](6e259a3))
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.

None yet

2 participants