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: Delete device profile in use should return 409 #4941

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

jinlinGuan
Copy link
Contributor

close #4937

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?)

Testing Instructions

New Dependency Instructions (If applicable)

@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Project coverage is 31.81%. Comparing base (77e0adc) to head (d76678a).

Files with missing lines Patch % Lines
...nternal/core/metadata/application/deviceprofile.go 0.00% 10 Missing ⚠️
...nternal/core/metadata/application/deviceservice.go 0.00% 10 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4941      +/-   ##
==========================================
- Coverage   31.86%   31.81%   -0.06%     
==========================================
  Files         265      265              
  Lines       19318    19338      +20     
==========================================
- Hits         6156     6152       -4     
- Misses      11770    11792      +22     
- Partials     1392     1394       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? 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

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.

try to move the check logic to the application layer

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.

please add the mock functions for
dbClient.DeviceCountByProfileName and ProvisionWatcherCountByProfileName
also add two new test cases for these new scenarios

close edgexfoundry#4937

Signed-off-by: Ginny Guan <ginny@iotechsys.com>
Copy link

sonarcloud bot commented Oct 7, 2024

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 eff0073 into edgexfoundry:main Oct 7, 2024
6 checks passed
@jinlinGuan jinlinGuan deleted the issue-4937 branch October 7, 2024 07:15
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.

Delete device profile successfully when it uses by device
3 participants