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(configuration): add handling for custom configuration section in c… #1082

Merged
merged 3 commits into from
Apr 14, 2022

Conversation

jenmwms
Copy link
Contributor

@jenmwms jenmwms commented Apr 13, 2022

…onfig response

Fixes #1035

Signed-off-by: Jennifer Williams jennifer.m.williams@intel.com

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

From app-functions-sdk-go/app-service-template use make build and run the new service ./new-app-service. Make a REST call using Postman or curl to query the service configurations to be returned in the response:
http://localhost:59740/api/v2/config

Observe at the bottom of the config struct is the previously missing AppCustom configurations, now included as CustomConfiguration:

        "CustomConfiguration": {
            "AppCustom": {
                "ResourceNames": "Boolean, Int32, Uint32, Float32, Binary",
                "SomeValue": 123,
                "SomeService": {
                    "Host": "localhost",
                    "Port": 9080,
                    "Protocol": "http"
                }
            }
        }

Note - The app custom contents are nested under CustomConfiguration. This is due to a limitation of in-lining with direct versus indirect struct types (I'll let him expand/explain more detail). We (Lenny and I) agree that next best option is using interfaces.UpdatableConfig and naming the field CustomConfiguration.

@jenmwms jenmwms changed the title fix(customConfig): add handling for custom configuration section in c… fix(configuration): add handling for custom configuration section in c… Apr 13, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 13, 2022

Codecov Report

Merging #1082 (523ae7b) into main (3803d9a) will increase coverage by 0.01%.
The diff coverage is 68.42%.

@@            Coverage Diff             @@
##             main    #1082      +/-   ##
==========================================
+ Coverage   68.79%   68.80%   +0.01%     
==========================================
  Files          36       36              
  Lines        2919     2936      +17     
==========================================
+ Hits         2008     2020      +12     
- Misses        798      803       +5     
  Partials      113      113              
Impacted Files Coverage Δ
internal/app/service.go 53.51% <0.00%> (-0.50%) ⬇️
internal/webserver/server.go 21.87% <0.00%> (-0.71%) ⬇️
internal/controller/rest/controller.go 90.24% <100.00%> (+1.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3803d9a...523ae7b. Read the comment docs.

…response

Fixes edgexfoundry#1035

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
@jenmwms jenmwms force-pushed the 1035_app_functions_appcustom branch from 1e4aa30 to e6bb99e Compare April 13, 2022 21:00
Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
Copy link
Member

@lenny-goodell lenny-goodell left a comment

Choose a reason for hiding this comment

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

LGTM

@lenny-goodell lenny-goodell merged commit e072562 into edgexfoundry:main Apr 14, 2022
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.

/api/v2/config doesn't return Custom Config sections
3 participants