Repository navigation
fix(config): load only CORE_-prefixed environment variables - #2200
Conversation
|
I have read the CLA Document and I hereby sign the CLA |
|
Hey @jay23606 👋 thanks for the PR! This comment updates automatically as you push changes -- think of it as your PR's live scoreboard! PR Checks✅ DCO Sign-off -- All commits have valid sign-offs. Nice work! ❌ GPG Signature -- Heads up! The following commits don't have a verified GPG signature:
You'll need to sign your commits with GPG (e.g. ✅ Merge Conflicts -- No merge conflicts detected. Smooth sailing! ❌ Issue Link -- Almost there! You are not assigned to the following linked issues: #2199. Please ensure you are assigned to all linked issues before opening a PR. You can comment ⏳ All checks must pass before this PR can be reviewed. You've got this! |
|
Thanks @jay23606 for opening the issue. Please start here https://github.com/hyperledger-labs/fabric-smart-client/blob/main/CONTRIBUTING.md and follow the guidelines on how to get started. Thanks |
|
@jay23606 shall we close this PR? |
|
No, this PR still addresses the configuration bug: “Use EnvCorePrefix (CORE_) as the environment filter and add a regression test proving CORE_ overrides still apply while COREPACK_ variables are ignored.” The focused regression test passes. |
|
Alright, cool. In that case, can you please assign the corresponding issue yourself, then fix the PR checks as listed above. |
|
Hi @jay23606 Thanks again for opening this PR. Please claim the corresponding issue and cleanup the PR as advised by the bot (#2200 (comment)). Thank you for your help. |
6a0a01a to
fd779fb
Compare
mbrandenburger
left a comment
There was a problem hiding this comment.
Thank you @jay23606 for your help.
Signed-off-by: jay23606 <4602056+jay23606@users.noreply.github.com>
Filter the MSP management config by CORE_ as well, and fold the provider regression check into TestEnvSubstitution. Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
Use assert for the independent checks in TestGetConfig_EnvPrefix. Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
196ab4f to
dabb947
Compare
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
Bug
Environment loading matched every variable whose name starts with
CORE, while the key transform strippedCORE_. Unrelated variables such asCOREPACK_ENABLE_AUTO_PIN, which Node's corepack sets on many developer machines, kept their full name and became configuration keys (corepack.enable.auto.pin). The MSP management config inplatform/fabric/core/msp/mgmthad the same mismatch.Change
platform/view/services/config:setupEnvfilters byEnvCorePrefix(CORE_), the same prefix it strips.platform/fabric/core/msp/mgmt:getConfigfilters and strips with oneenvPrefix = "CORE_"constant.TestEnvSubstitutionsetsCOREPACK_ENABLE_AUTO_PINalongside theCORE_overrides and asserts nocorepack.*key is loaded.TestGetConfig_EnvPrefixchecks the same for the MSP config and thatCORE_PEER_LOCALMSPTYPEis still read.Testing
go test -race ./platform/view/services/config/... ./platform/fabric/core/msp/mgmt/...passes.TestEnvSubstitutionandTestGetConfig_EnvPrefixfail on the straycorepack.enable.auto.pinkey.golangci-lintreports no issues in either package.Fixes #2199