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

feat(core): add helper function to fetch a TD #1169

Closed

Conversation

danielpeintner
Copy link
Member

fixes #1055

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7ce79cd) 76.52% compared to head (3d86b80) 76.61%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1169      +/-   ##
==========================================
+ Coverage   76.52%   76.61%   +0.08%     
==========================================
  Files          80       80              
  Lines       16705    16725      +20     
  Branches     1616     1618       +2     
==========================================
+ Hits        12784    12814      +30     
+ Misses       3891     3880      -11     
- Partials       30       31       +1     

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

@relu91
Copy link
Member

relu91 commented Nov 23, 2023

Shouldn't we deprecate this helper function and favor the new #1166?

@danielpeintner
Copy link
Member Author

Shouldn't we deprecate this helper function and favor the new #1166?

W.r.t. fetchTD() ... there should be just one piece of code dealing with it, true, point taken 👍.

I am wondering what we should do w.r.t. to the existing fetch(). Remove it? Helpers usually offers static functions, the only exception is fetch() which needs a Servient to work. I would think we should remove the function "on the long run"...

Moreover, there is the interface Resolver which is used by ThingModel code.. this is somewhat not very clear to me.

@danielpeintner danielpeintner marked this pull request as draft November 23, 2023 12:37
@relu91
Copy link
Member

relu91 commented Nov 23, 2023

Yes, I would deprecate the fetch and fetchTD functions in favor of requestThingDescription.

Moreover, there is the interface Resolver which is used by ThingModel code.. this is somewhat not very clear to me.

The interface is there to not depend on the Core from the ThingModelHelpers pov. Users can decide to use the ThingModel helpers without using the Core package and implement their own resolver. I think we can appreciate this choice when we move the tool to a new repo.

@danielpeintner
Copy link
Member Author

Yes, I would deprecate the fetch and fetchTD functions in favor of requestThingDescription.

deprecate fetch is possible but at the moment it is still used.
Let's wait till #1166 has been integrated and take a look to replace all usages.
Anyhow, ThingModel still uses fetch.. I believe.. but let's see...

deprecate fetchTD is not necessary since it hasn't been pushed yet.

@danielpeintner
Copy link
Member Author

Closing in favor of #1183

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.

helper class fetch returning unknown ?
2 participants