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

fix: Add backwards compatability for Device System Events #4121

Conversation

lenny-goodell
Copy link
Member

@lenny-goodell lenny-goodell commented Aug 9, 2022

fixes #4117

Signed-off-by: Leonard Goodell leonard.goodell@intel.com

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?)
    feat: Document Core Metadata Device System Events edgex-docs#830

Testing Instructions

Run Non-secure EdgeX Stack from compose builder

make run no-secty ds-virtual ds-rest`

Stop Core Metadata
In Consul, remove MessageQueue configuration for Core Metadata
Using the branch for this PR
Remove MessageQueue and RequireMessageBus configuration from TOML file
Build Core Metadata docker image locally
Modify generated compose file to switch Core Metadata image to be local image
Restart local Core Metadata image using modified compose file

make up

Verify Core Metadata logs don't show anything about MessageBus and started without error
Using Edgex UI delete a device
Verify that Core Metadata logs show warning that the Device System Event couldn't be published.

Stop Core Metadata image
Remove Core Metadata config from Consul
Restore local TOML file
Rebuild local Core Metadata image
Restart local Core Metadata image using modified compose file

make up

Verify Core Metadata logs do show MessageBus connection info and started without error
Using Consul set Core Metadata log level to Debug
Using Edgex UI delete a device
Verify that Core Metadata logs show debug message that the Device System Event was published.

New Dependency Instructions (If applicable)

fixes edgexfoundry#4117

Signed-off-by: Leonard Goodell <leonard.goodell@intel.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 9, 2022

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 3 Code Smells

No Coverage information No Coverage information
0.5% 0.5% Duplication

@codecov-commenter
Copy link

Codecov Report

Merging #4121 (20b0bae) into main (e18dbdc) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #4121   +/-   ##
=======================================
  Coverage   43.66%   43.66%           
=======================================
  Files         120      120           
  Lines       10617    10617           
=======================================
  Hits         4636     4636           
  Misses       5594     5594           
  Partials      387      387           
Impacted Files Coverage Δ
internal/core/metadata/application/device.go 13.09% <100.00%> (ø)

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

Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

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

LGTM

@cloudxxx8 cloudxxx8 merged commit d0806ca into edgexfoundry:main Aug 10, 2022
@lenny-goodell lenny-goodell deleted the fix-DeviceSystemEvents-bw-compatability branch August 10, 2022 04:42
# This will default to false if not provided in old config. Messagebus is now needed by Device System Events and Service Metrics
# TODO: Remove this setting EdgeX 3.0
RequireMessageBus = true

Copy link
Member

Choose a reason for hiding this comment

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

Didn't get a chance to review this.

Couldn't we just check if MessageQueue or MessageQueue.protocol are set, then assume message bus is required?

[MessageQueue]
Protocol = "redis"

Copy link
Member Author

Choose a reason for hiding this comment

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

I considered that, but that is ambiguous as to if it is missing because of old configuration or just bad configuration. I prefeed it to be explicate.

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.

Backward-incompatible addition of Device System Events
4 participants