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

feat: Add env override capability for common configuration #4449

Merged
merged 3 commits into from
Mar 16, 2023

Conversation

lenny-goodell
Copy link
Member

closes #4448

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)
    TBD

Testing Instructions

Run non-secure EdgeX stack
Build core-common-config from this branch
Set the following

  • export ALL_SERVICES_WRITABLE_TELEMETRY_INTERVAL=50s
  • export APP_SERVICES_WRITABLE_TELEMETRY_METRICS_MESSAGESRECEIVED=true
  • export DEVICE_SERVICES_WRITABLE_TELEMETRY_METRICS_EVENTSSENT=true

run common config from command line

  • ./core-common-config-bootstrapper -cp -cf configuration.yaml -o

verify consul has the appropriate overridden values
verify logs contain the following:

"Variables override of 'app-services/Writable/Telemetry/Metrics/MessagesReceived' by environment variable: APP_SERVICES_WRITABLE_TELEMETRY_METRICS_MESSAGESRECEIVED=true"
"Variables override of 'all-services/Writable/Telemetry/Interval' by environment variable: ALL_SERVICES_WRITABLE_TELEMETRY_INTERVAL=50s"
"Variables override of 'device-services/Writable/Telemetry/Metrics/EventsSent' by environment variable: DEVICE_SERVICES_WRITABLE_TELEMETRY_METRICS_EVENTSSENT=false"
"Common configuration loaded from file with 3 overrides applied"
"Common configuration has been pushed to into Configuration Provider with overrides applied"

New Dependency Instructions (If applicable)

jim-wang-intel
jim-wang-intel previously approved these changes Mar 15, 2023
Signed-off-by: Leonard Goodell <[email protected]>
ejlee3
ejlee3 previously approved these changes Mar 15, 2023
Copy link
Contributor

@ejlee3 ejlee3 left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2023

Codecov Report

Merging #4449 (adf2e47) into main (d51f32b) will not change coverage.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##             main    #4449   +/-   ##
=======================================
  Coverage   41.73%   41.73%           
=======================================
  Files         106      106           
  Lines        9749     9749           
=======================================
  Hits         4069     4069           
  Misses       5333     5333           
  Partials      347      347           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@lenny-goodell lenny-goodell merged commit 98f26a0 into edgexfoundry:main Mar 16, 2023
@lenny-goodell lenny-goodell deleted the overrides branch March 16, 2023 14:25
@farshidtz
Copy link
Member

As expected by #4448, the snap tests have started failing since this change because the overrides no longer apply on top of configurations coming from config provider: Common configuration loaded from the Configuration Provider. No overrides applied

Need to change the snap tests to no longer test that.

@MonicaisHer

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.

[Common Config Bootstrapper] Apply env overrides to values only when loaded from file
5 participants