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

added envsubst #91

Merged
merged 2 commits into from
Mar 1, 2021
Merged

added envsubst #91

merged 2 commits into from
Mar 1, 2021

Conversation

bjartek
Copy link
Collaborator

@bjartek bjartek commented Feb 26, 2021

Closes #84

Added envsubst and applied it to loading the proejct file


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@bjartek
Copy link
Collaborator Author

bjartek commented Feb 26, 2021

Should probably also update some documentation somewhere but I do not have the overview to see where that is.

@psiemens
Copy link
Contributor

Thanks for adding this! However, I think it'd a dupe of #87.

Also @sideninja and I thought we could use the ${env:VAR_NAME} syntax. What do you think of that?

@bjartek
Copy link
Collaborator Author

bjartek commented Feb 27, 2021

Ok, I was s little confused.

https://github.com/drone/envsubst is another library that could have been used, I did not review them either that should probably have been done.

From my understanding neither of those librarires support your suggested syntax. If you feel that the cost og implementing your specifix syntax is worth it then do that. However the libraries have many features and emulates envsubst from bash that is a pattern that are well known.

In cases like theese I fins that I like to spend my innvoation points elsewhere and use a standard sollution. The choice however is not mine, it is yours :)

Really happy that we can focus on these issues do that it will be easier to get new devs up to speed with good tools.

@devbugging
Copy link
Contributor

@bjartek I like your implementation and I agree we should leverage the work of others by using a library. I want it to be our choice ;)

The only comment I would have on this implementation is that I think it's a good design decision to put that functionality in this file: https://github.com/onflow/flow-cli/blob/private-config-file/flow/project/cli/config/processor.go

I would keep that design of having a "preprocessor" of config files so the JSON config is not affected by this change, in my current refactoring I also removed loading of files from JSON as I don't think that is the correct place for loading files and hence your change won't work there. Let me know what you think.

@bjartek
Copy link
Collaborator Author

bjartek commented Mar 1, 2021

That makes total sense to me.

@bjartek
Copy link
Collaborator Author

bjartek commented Mar 1, 2021

That file has not been merge yet, can we just merge this and fix it later?

@psiemens
Copy link
Contributor

psiemens commented Mar 1, 2021

That file has not been merge yet, can we just merge this and fix it later?

@bjartek I'm good with that. I'll approve and merge 👍

Copy link
Contributor

@psiemens psiemens left a comment

Choose a reason for hiding this comment

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

Nice and simple 👌

@psiemens psiemens merged commit d71f22b into onflow:master Mar 1, 2021
@psiemens psiemens mentioned this pull request Mar 1, 2021
6 tasks
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.

Configuration for private accounts in environment variables
3 participants