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

refactor!: Use bool types for command parameters to be more consistent #1279

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

jinlinGuan
Copy link
Contributor

@jinlinGuan jinlinGuan commented Jan 12, 2023

BREAKING CHANGE: ds-pushevent and ds-returnevent to use bool true/false instead of yes/no

related: edgexfoundry/go-mod-core-contracts#782

Signed-off-by: Ginny Guan [email protected]

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/device-sdk-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?)
    docs: Update docs to use true/false for ds-pushevent and ds-returnevent in 3.0 edgex-docs#917 and the Swagger file in this repo

Testing Instructions

build core-command and device-virtual docker images based on the changes and run docker-compose.yml
The following commands work as expected:

curl http://localhost:59882/api/v2/device/name/Random-Boolean-Device/Bool\?ds-pushevent\=true
curl http://localhost:59882/api/v2/device/name/Random-Boolean-Device/Bool\?ds-pushevent\=false
curl http://localhost:59882/api/v2/device/name/Random-Boolean-Device/Bool\?ds-return\=true
curl http://localhost:59882/api/v2/device/name/Random-Boolean-Device/Bool\?ds-return\=false

and the following commands return errors as expected:

curl http://localhost:59882/api/v2/device/name/Random-Boolean-Device/Bool\?ds-pushevent\=yes
curl http://localhost:59882/api/v2/device/name/Random-Boolean-Device/Bool\?ds-pushevent\=no
curl http://localhost:59882/api/v2/device/name/Random-Boolean-Device/Bool\?ds-return\=yes
curl http://localhost:59882/api/v2/device/name/Random-Boolean-Device/Bool\?ds-return\=no

New Dependency Instructions (If applicable)

@codecov-commenter
Copy link

Codecov Report

Merging #1279 (7fb1df8) into main (8541928) will not change coverage.
The diff coverage is 50.00%.

@@           Coverage Diff           @@
##             main    #1279   +/-   ##
=======================================
  Coverage   50.28%   50.28%           
=======================================
  Files          27       27           
  Lines        2442     2442           
=======================================
  Hits         1228     1228           
  Misses       1108     1108           
  Partials      106      106           
Impacted Files Coverage Δ
internal/controller/http/command.go 69.23% <50.00%> (ø)

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

@cloudxxx8
Copy link
Member

please modify the swagger file as well

BREAKING CHANGE: ds-pushevent and ds-returnevent to use bool true/false instead of yes/no

related: edgexfoundry/go-mod-core-contracts#782

Signed-off-by: Ginny Guan <[email protected]>
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 881f109 into edgexfoundry:main Jan 30, 2023
@jinlinGuan jinlinGuan deleted the issue-780-sdk branch February 1, 2023 10:18
@lenny-goodell
Copy link
Member

@jinlinGuan , this PR modified the wrong swagger file. There is a V3 file that needs to be updated.
Also the V2 file needs to be removed and the Jenkinsfile here needs to be changed to point to V3
https://github.com/edgexfoundry/device-sdk-go/blob/main/Jenkinsfile#L24

@lenny-goodell
Copy link
Member

@jinlinGuan , I created issue for this here: #1299

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.

4 participants