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!(coap-server): adjust constructor to HTTP server #1082

Merged
merged 3 commits into from
Sep 14, 2023

Conversation

JKRhb
Copy link
Member

@JKRhb JKRhb commented Sep 13, 2023

As pointed out by @egekorkan in #1028, the CoAP server currently has a different constructor API that differs from its HTTP counterpart.

This PR introduces a CoapServerConfig interface that features the previously defined address and port parameters in order to align it with the HTTP implementation (and probably also other binding implementations). Using this approach will also make it possible to extend the CoAP server more easily in the feature (e.g., with a security configuration).

As this PR introduces a breaking change, however, I suppose merging it should be postponed until the next minor(?) release.

Will resolve #1028.

Copy link
Member

@relu91 relu91 left a comment

Choose a reason for hiding this comment

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

LGTM

@relu91
Copy link
Member

relu91 commented Sep 13, 2023

BTW CI is failing, you have to update also the examples :)

@JKRhb
Copy link
Member Author

JKRhb commented Sep 13, 2023

BTW CI is failing, you have to update also the examples :)

Should be fixed now :)

@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Patch coverage: 61.53% and project coverage change: +0.01% 🎉

Comparison is base (c10fba2) 75.34% compared to head (0cbecdc) 75.35%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1082      +/-   ##
==========================================
+ Coverage   75.34%   75.35%   +0.01%     
==========================================
  Files          80       80              
  Lines       16079    16083       +4     
  Branches     1502     1503       +1     
==========================================
+ Hits        12114    12119       +5     
+ Misses       3926     3925       -1     
  Partials       39       39              
Files Changed Coverage Δ
packages/cli/src/cli-default-servient.ts 69.37% <25.00%> (+0.33%) ⬆️
packages/binding-coap/src/coap-server.ts 78.93% <50.00%> (-0.09%) ⬇️
packages/binding-coap/src/coap.ts 92.98% <100.00%> (+0.32%) ⬆️

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

@egekorkan
Copy link
Member

egekorkan commented Sep 13, 2023

A bit of a dangerous question but why aren't the cli package tests (and build) are failing? This effects the following:

So in other words, we need to reflect this in other places

@JKRhb
Copy link
Member Author

JKRhb commented Sep 13, 2023

Hmm, I guess the build for https://github.com/eclipse-thingweb/node-wot/blob/master/packages/cli/src/cli-default-servient.ts#L137 isn't failing since the corresponding method parameter is typed as any,

@JKRhb
Copy link
Member Author

JKRhb commented Sep 13, 2023

The issue with the CLI package should now be addressed – however, the typing in that package seems to need some more work.

@danielpeintner
Copy link
Member

As this PR introduces a breaking change, however, I suppose merging it should be postponed until the next minor(?) release.

We recently did have a breaking change in binding-http as well in #1070.
I think it is fine to go on...

Anyone opposed to it?

@relu91 relu91 merged commit 46f2d5a into eclipse-thingweb:master Sep 14, 2023
8 checks passed
@JKRhb JKRhb deleted the coap-port branch September 14, 2023 12:57
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.

Discrepency between HTTP and CoAP Server Configuration
4 participants