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.
What is this?
Asset discovery issues are typically debugged with the
--verbose
flag, or by setting the environment variablePERCY_LOGLEVEL=debug
. While this option prints detailed logs throughout the toolchain, including asset discovery, it only does just that — prints detailed logs. However, when debugging asset discovery issues, the constant uploading of any snapshots results in a hit to screenshot usage. It would be beneficial while debugging asset discovery issues to simply not send any snapshots at all, or not even create a build to begin with.This PR introduces a
--debug
flag, which not only enables debug logs just like the--verbose
flag, but additionally disables snapshot uploads via a new coreskipUploads
option. This option mirrors the existing (but unused)deferUploads
option. The two options do the same thing, with the addition of theskipUploads
option skipping the deferred uploads altogether. The--debug
flag could also be an entrypoint for future asset discovery debugging features.The
start()
method was adjusted slightly to remove the Percy token check. This token doesn't need to be set when not uploading snapshots or creating builds. The token is also checked before any API call by client, such as the first task of thestart()
method, creating a build; this check is also already deferred when uploads are deferred. The creation of the deferred task was also moved outside of the try-catch block since there is nothing to catch until the task is run and awaited on.