Best practices for secrets and local config in this repo #284
Closed
JanPetterMG
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Although
.envandfirmware/include/config/secrets.hare listed in.gitignore, they are currently tracked in Git. This means changes can still be accidentally committed, which is risky and raises the barrier for less experienced contributors. Switching branches can also be cumbersome.Locally, I work around this by splitting secrets per board
#ifdef BOARD_XYZand using separate.env.board-xyzfiles. However, this approach is not suitable for everyone. I have seen PRs wheresecrets.hwas committed accidentally, and not everyone is familiar with partial staging.Ideally, real secrets and local configuration files should not be tracked at all. Template files help, but in practice end-users often miss setup steps described in the main README.
One possible approach is to replace
.envandsecrets.hwith template files and use PlatformIOextra_scriptsto generate the real files on first build if they are missing. This could reduce accidental commits and lower the onboarding barrier, though it is not a perfect solution.I would appreciate input from the community: what approach do you prefer, and are there better or more established patterns to consider?
Beta Was this translation helpful? Give feedback.
All reactions