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

fix: manually configure supported env vars #5532

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

j-luong
Copy link
Contributor

@j-luong j-luong commented Oct 16, 2024

Pull Request Submission Checklist

  • Follows CONTRIBUTING guidelines
  • Includes detailed description of changes
  • Contains risk assessment (Low | Medium | High)
  • Highlights breaking API changes (if applicable)
  • Links to automated tests covering new functionality
  • Includes manual testing instructions (if necessary)
  • Updates relevant GitBook documentation (PR link: ___)

Risk Assessment - Medium

The existing behaviour, although not correct, may be used by clients without knowing that it's unintentional. This would lead to breaking changes for them. The fix for them would be to use the intended env var for their purpose.

What does this PR do?

This PR updates the CLI so that it no longer automatically detects supported env vars. The automatic detection led to bugs where ambiguous environment variables (e.g. ORG) would be picked up and used in the CLI.

By explicitly configuring the supported env vars, we can avoid these sorts of bugs (e.g. by requiring namespace prefixes in env vars we want to support).

Where should the reviewer start?

Review the related GAF PR

How should this be manually tested?

@j-luong j-luong force-pushed the fix/CLI-526_onlyReadSnykEnvVars branch 2 times, most recently from 0079678 to 57601c3 Compare October 16, 2024 21:21
Copy link
Contributor

github-actions bot commented Oct 16, 2024

Warnings
⚠️

Since the CLI is unifying on a standard and improved tooling, we're starting to migrate old-style imports and exports to ES6 ones.
A file you've modified is using either module.exports or require(). If you can, please update them to ES6 import syntax and export syntax.
Files found:

  • test/jest/acceptance/iac/capture.spec.ts

Generated by 🚫 dangerJS against 5bfcbe8

@j-luong j-luong force-pushed the fix/CLI-526_onlyReadSnykEnvVars branch 4 times, most recently from 5349534 to 8659e6b Compare October 17, 2024 16:25
@j-luong j-luong force-pushed the fix/CLI-526_onlyReadSnykEnvVars branch from 8659e6b to 06a48e3 Compare October 18, 2024 08:18
@j-luong j-luong marked this pull request as ready for review October 18, 2024 08:26
@j-luong j-luong requested a review from a team as a code owner October 18, 2024 08:26
@j-luong j-luong force-pushed the fix/CLI-526_onlyReadSnykEnvVars branch from 06a48e3 to 5e9980f Compare October 18, 2024 11:52
@j-luong j-luong changed the title fix: only read SNYK_ prefixed env vars fix: manually configure supported env vars Oct 18, 2024
@j-luong j-luong enabled auto-merge October 18, 2024 15:07
@j-luong j-luong force-pushed the fix/CLI-526_onlyReadSnykEnvVars branch from 5e9980f to 905d5d6 Compare October 25, 2024 12:12
@j-luong j-luong force-pushed the fix/CLI-526_onlyReadSnykEnvVars branch from 905d5d6 to 5bfcbe8 Compare October 28, 2024 11:07
@j-luong j-luong merged commit f94c51e into main Oct 28, 2024
7 checks passed
@j-luong j-luong deleted the fix/CLI-526_onlyReadSnykEnvVars branch October 28, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants