-
Notifications
You must be signed in to change notification settings - Fork 87
ci: validate secrets refactor #18772
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
base: master
Are you sure you want to change the base?
Conversation
Jenkins BuildsClick to see older builds (137)
|
2a71da2
to
e0b5773
Compare
4543c69
to
a4ce223
Compare
Introduces --verify-credentials flag which can be passed to status app and it will check for all the necessary credentials provided by status-jenkins-lib. related changes are here : status-im/status-jenkins-lib#120 Adds an Audit stage in jenkins which checks for these credentials, this is an integration test in CI to ensure that bundled app has all the necessary secrets. Shorten existing stage names in Jenkins for better readability.
a4ce223
to
7c9e24c
Compare
let thingsToCheck = getEnv("THINGS_TO_CHECK") | ||
if thingsToCheck.len == 0: | ||
echo "ERROR: THINGS_TO_CHECK environment variable not set" | ||
return 1 |
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.
This seem way to complicated to me. Why can't we write a wrapper around getEnv()
in src/env_cli_vars.nim
:
status-desktop/src/env_cli_vars.nim
Lines 46 to 48 in ac2ac73
const | |
DEFAULT_INFURA_TOKEN = "220a1abb4b6943a093c35d0ce4fb0732" | |
BUILD_INFURA_TOKEN = getEnv(BUILD_TIME_PREFIX & BASE_NAME_INFURA_TOKEN, DEFAULT_INFURA_TOKEN) |
And just check if it's an empty string and fail on that with an assert or something.
I thought we could use existsEnv()
but empty string is an invalid value so just checking that is better.
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.
According to docs static
blocks are executed at built time:
https://nim-lang.org/docs/manual.html#statements-and-expressions-static-statementslashexpression
But I don't see any usage of static
in src/env_cli_vars.nim
or src/constants.nim
.
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 key point is that we want a way that live closest to where the vars are sourced, that way we have a better chance of developers also maintaining that. We could define a mustGetEnv()
that is used only for secrets, or even more explicit ciMustGetEnv()
that only fails on missing value when CI=true
.
Summary
Introduces
--verify-credentials
flag which can be passed to status app and it will check for all the necessary credentials provided bystatus-jenkins-lib
.related changes are here : https://github.com/status-im/status-jenkins-lib/pull/120
Adds an
Audit
stage in jenkins which checks for these credentials, this is an integration test in CI to ensure that bundled app has all the necessary secrets.