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: Allow Auto event duration is empty #988

Merged
merged 1 commit into from
Mar 9, 2025

Conversation

weichou1229
Copy link
Member

@weichou1229 weichou1229 commented Mar 7, 2025

Auto event duration should allow empty because the Core Metadata will apply the default value if duration is empty.

Close #987

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/go-mod-core-contracts/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?) not impact
  • 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?) not impact

Testing Instructions

Test core metadata API with empty duration like below

curl 'http://localhost:59881/api/v3/device' \
--header 'Content-Type: application/json' \
--data '[{
    "device": {
      "name": "testDevice",
      "adminState": "UNLOCKED",
      "operatingState": "UP",
      "location": {},
      "serviceName": "device-virtual",
      "profileName": "Random-Boolean-Device",
      "autoEvents": [
        { "interval": "1s", "onChange": false, "sourceName": "Bool", 
       "retention": {"maxCap": 2000, "minCap": 1000, "duration":""}}
      ],
      "protocols": {
        "other": {}
        }
    },
    "apiVersion":"v3"
  }]
'

New Dependency Instructions (If applicable)

 Auto event duration should allow empty because the Core Metadata will apply the default value if duration is empty.

Close edgexfoundry#987

Signed-off-by: bruce <[email protected]>
@weichou1229 weichou1229 requested a review from judehung March 7, 2025 10:10
@codecov-commenter
Copy link

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

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.95%. Comparing base (db8453d) to head (a5c1c90).

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #988   +/-   ##
=======================================
  Coverage   42.95%   42.95%           
=======================================
  Files         119      119           
  Lines        7206     7206           
=======================================
  Hits         3095     3095           
  Misses       3768     3768           
  Partials      343      343           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@judehung judehung left a comment

Choose a reason for hiding this comment

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

LGTM

@judehung judehung requested a review from cloudxxx8 March 7, 2025 12:41
@judehung
Copy link
Member

judehung commented Mar 7, 2025

@cloudxxx8 Do we need to release a new version of contracts for odessa due to this PR?

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 b20d5f4 into edgexfoundry:main Mar 9, 2025
3 checks passed
@cloudxxx8
Copy link
Member

@weichou1229 please pick this commit to the odesa branch

@weichou1229 weichou1229 deleted the issue-987 branch March 10, 2025 04:39
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.

Auto event duration should allow using empty string
4 participants