-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Conversation
looks all good and coverage report was uploaded successfully. the test build https://buildkite.com/solana-labs/solana/builds/99028 (ignore the spl test cuz I forgot to rebase when I ran it 😢) |
ARGS+=( | ||
--env CODECOV_ENV | ||
--env CODECOV_TOKEN | ||
--env CODECOV_URL | ||
--env CODECOV_SLUG | ||
--env VCS_COMMIT_ID | ||
--env VCS_BRANCH_NAME | ||
--env VCS_PULL_REQUEST | ||
--env VCS_SLUG | ||
--env VCS_TAG | ||
--env CI_BUILD_URL | ||
--env CI_BUILD_ID | ||
--env CI_JOB_ID | ||
) |
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.
I'd like avoid hard-coding as much as possible. i know i'm opiniated and seldom these envs should change. but i just don't like hard-coding....
seems curl --fail
does the trick.
$ curl -sS --retry 5 --retry-delay 2 --retry-connrefused https://codecov.io/env
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>502 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>502 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>
#!/usr/bin/env bash
# Apache License Version 2.0, January 2004
# https://github.com/codecov/codecov-bash/blob/master/LICENSE
$ curl --fail -sS --retry 5 --retry-delay 2 --retry-connrefused https://codecov.io/env
#!/usr/bin/env bash
# Apache License Version 2.0, January 2004
# https://github.com/codecov/codecov-bash/blob/master/LICENSE
set -e +o pipefail
VERSION="1.0.6"
add()
{
if [ -z "$1" ];
then
return
fi
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.
the problem is that curl
is printing 502 response body. blame flaky codecov infra.
seems their infra changed when i added this at #8263. so blame me as well. ;)
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.
I do this cuz
- we can see what we're passing easily also make it controllable.
- although we pass those env dynamically, we still need to set them manually to machines or we get an empty env in the CI environment
What's the benefit you would like to keep the dynamic environment variable set
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.
(sorry i have to go to chore soon)
What's the benefit you would like to keep the dynamic environment variable set
i'd say a maintenance burden. for example, this pr starts to miss to export some of these envs, which is used for codecov report metadata... these env set can change anytime by codecov.
elif [ "$CI" = "true" ] && [ "$BUILDKITE" = "true" ];
then
add "CI"
add "BUILDKITE"
add "BUILDKITE_BRANCH"
add "BUILDKITE_BUILD_NUMBER"
add "BUILDKITE_JOB_ID"
add "BUILDKITE_BUILD_URL"
add "BUILDKITE_PROJECT_SLUG"
add "BUILDKITE_COMMIT"
also, codocov doc is recommending to call curl
dynamically...
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.
true. it is easy to miss some needed environment variables. just opened another solution for handling curl response code. #32492
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.
thanks for debugging this. however, i want different approach is taken..
use #32494 |
Problem
https://discord.com/channels/428295358100013066/560503042458517505/1129158185052278854
we may get this message when fetching
CODECOV_ENV
seems that we don't handle this error and also I think those environment variables won't change. we can just passed them.
Summary of Changes
pass those environment variables statically instead of a dynamic method, setting via curl.