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

Add retry and error printing to codecov validation. #2261

Merged
merged 2 commits into from Jun 12, 2019

Conversation

2 participants
@jim
Copy link
Contributor

commented Jun 11, 2019

Description

We added a pre-commit check to validate our codecov config file in an earlier PR. It's been mostly working, but we have started to see intermittent failures in CI from this check. Since the check passes locally and usually on CI with a retry, I am operating under the assumption that the underlying curl statement is failing for one reason or another.

This PR does three things:

  • It modifies the curl command to retry up to 5 times and also consider connection refused errors as retriable.
  • It configures curl to still print out errors, despite running in silent -S mode.
  • If the validation fails, the output of the curl command will be printed to the console to aid in debugging.

Reviewer Notes

I don't write a lot of bash, so while shellcheck is OK with everything, I'd like some human eyes on these changes.

Setup

You can test this out locally by running scripts/pre-commit-codecov-validate after mangling your .codecov file.

@jim jim requested a review from chrisgilmerproj Jun 11, 2019

if [[ ! $output =~ (Valid) ]]; then
echo "$output"
exit 1
fi

This comment has been minimized.

Copy link
@chrisgilmerproj

chrisgilmerproj Jun 11, 2019

Contributor

From PR #2249 I kind of like this better:

/usr/bin/curl -s --data-binary @.codecov.yml https://codecov.io/validate | tee /dev/stderr | grep "Valid!"

I do like your retry though, which is great.

This comment has been minimized.

Copy link
@jim

jim Jun 12, 2019

Author Contributor

I like that more, too.

@chrisgilmerproj
Copy link
Contributor

left a comment

🚀

@jim jim merged commit c530580 into master Jun 12, 2019

19 checks passed

ci/circleci: acceptance_tests_experimental Your tests passed on CircleCI!
Details
ci/circleci: acceptance_tests_local Your tests passed on CircleCI!
Details
ci/circleci: acceptance_tests_staging Your tests passed on CircleCI!
Details
ci/circleci: build_app Your tests passed on CircleCI!
Details
ci/circleci: build_migrations Your tests passed on CircleCI!
Details
ci/circleci: build_tasks Your tests passed on CircleCI!
Details
ci/circleci: build_tools Your tests passed on CircleCI!
Details
ci/circleci: client_test Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_api Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_mymove Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_office Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_tsp Your tests passed on CircleCI!
Details
ci/circleci: pre_deps_golang Your tests passed on CircleCI!
Details
ci/circleci: pre_deps_yarn Your tests passed on CircleCI!
Details
ci/circleci: pre_test Your tests passed on CircleCI!
Details
ci/circleci: server_test Your tests passed on CircleCI!
Details
ci/circleci: server_test_coverage Your tests passed on CircleCI!
Details
codecov/patch Coverage not affected when comparing 22e9e6b...b8edcca
Details
codecov/project/go 58.9% remains the same compared to 22e9e6b
Details

@jim jim deleted the improve-codecov-precommit branch Jun 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.