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

[node-bootstrapper] set ENV variables without intermediate template step #5176

Merged
merged 4 commits into from
Oct 29, 2024

Conversation

r2k1
Copy link
Contributor

@r2k1 r2k1 commented Oct 29, 2024

Remove the intermediate template step when setting environment variables in the node-bootstrapper package.
Type-safety is lost during templating.

This should reduce number of changes required to modify ENV variables and eliminate errors when a function string reference isn't updated after a code change (introduce type-safety).

It also moves us 1 step closer to shell script removal.

@Devinwong
Copy link
Collaborator

Didn't look into cmd can set env before executing. This way is definitely better. Thanks for doing this.

@@ -538,13 +501,13 @@ func getNBCInstance(jsonFilePath string) *nbcontractv1.Configuration {
return nBCB.GetNodeBootstrapConfig()
}

func generateTestDataIfRequested(t *testing.T, folder, cseCmd string) {
func generateTestDataIfRequested(t *testing.T, folder string, cmd *exec.Cmd) {
if os.Getenv("GENERATE_TEST_DATA") == "true" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just seeing this so asking, though it's not part of this PR.
Where is this env var set? ADO pipeline?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk. It looks weird for me. I would delete it.

@r2k1 r2k1 enabled auto-merge (squash) October 29, 2024 03:37
@r2k1 r2k1 merged commit 0f260a8 into master Oct 29, 2024
14 checks passed
@r2k1 r2k1 deleted the r2k1/env branch October 29, 2024 21:52
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.

2 participants