-
Notifications
You must be signed in to change notification settings - Fork 143
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
chore: remove env file usage from tests #3960
Conversation
ef24518
to
212c5ba
Compare
708cdf4
to
36e80d9
Compare
212c5ba
to
7620f93
Compare
7620f93
to
7a4c242
Compare
toolchains/workspace-pnpm/macros.bzl
Outdated
"env_file": attrs.option( | ||
attrs.string(), | ||
doc = """File name and relative path for env variables required.""", | ||
"app_env": attrs.dict( |
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.
We have build_env
(for things like next build) and env
(for test-runner like jest) attributes in other places. I chose to go with app_env
(for application code) here but open to alternatives
7a4c242
to
e0753bc
Compare
e0753bc
to
ee19170
Compare
config_file = "test/unit/jest.config.js", | ||
env_file = ".env", |
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.
env_json = "//dev:api-env"
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.
Context: these variables are pretty much dev environment related so nesting at the dev/
dir level makes sense
76adbe8
to
0c3f0e3
Compare
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
7652397 | Triggered | Generic High Entropy Secret | ee19170 | core/api/BUCK | View secret |
7652397 | Triggered | Generic High Entropy Secret | c987f79 | dev/env.json | View secret |
7652397 | Triggered | Generic High Entropy Secret | c987f79 | dev/Tiltfile | View secret |
7652397 | Triggered | Generic High Entropy Secret | 0c3f0e3 | core/api/BUCK | View secret |
7652397 | Triggered | Generic High Entropy Secret | 0c3f0e3 | dev/env.json | View secret |
7652397 | Triggered | Generic High Entropy Secret | 19400b9 | dev/core-bundle/serve-env.json | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
toolchains/workspace-pnpm/macros.bzl
Outdated
run_cmd_args.add(ctx.attrs.env_json_target) | ||
if hasattr(ctx.attrs, 'env_json'): | ||
run_cmd_args.add("--env-json") | ||
run_cmd_args.add(cmd_args(ctx.attrs.env_json)) |
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.
you don't need to double wrap in cmd_args
... in the code I showed you it was required to 'merge' the path (there were 2 arguments).
f9cbbd4
to
424b579
Compare
5e5162c
to
19400b9
Compare
Description
Follow-up task would be to cleanup other places the env files are referenced and then to delete them.
TODO
:Tiltfile
andBUCK
files