Strategy: Add --silent flag to DEFAULT_CURL_ARGS #12693
Merged
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.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This is a recreation of #12647, as I was encountering persistent CI failures that I didn't think were related to the committed changes (based on what I saw in testing). Digging into this further, it turned out that the failures were, in fact, due to the
#curl_args
commit where I used#uniq
on the returned array. My intention was to avoid having options duplicated betweenargs
andextra_args
(e.g., including--silent
twice), simply for the sake of tidiness, but this approach causes problems because some options can be used more than once (e.g.,--header
).Unfortunately, I modified the related branch, so I couldn't re-open the previous PR. That said, this PR is the same as the last one but I've dropped the
#curl_args
commit.Currently, only
Livecheck::Strategy::PAGE_HEADERS_CURL_ARGS
uses the--silent
option andPAGE_CONTENT_CURL_ARGS
does not (though there's no intention behind this omission). However, the#page_content
method should also use the--silent
flag, to prevent progress bar text (#=#=#
, etc.) from appearing in output.This is an issue because the regex that's used to identify
curl
error messages instderr
(^curl:.+$/
) will fail if leading progress bar text is present. This leads to an ambiguous "cURL failed without a detectable error" message instead of the actual error message(s) fromcurl
.This PR addresses the issue by adding
--silent
toLivecheck::Strategy::DEFAULT_CURL_ARGS
, which bothPAGE_HEADERS_CURL_ARGS
andPAGE_CONTENT_CURL_ARGS
inherit.