Skip to content

Conversation

@bergzand
Copy link
Member

@bergzand bergzand commented Oct 3, 2018

Contribution description

According to the IANA defines, there is only CoAP content-formats. and no CoAP content types. This PR merges the list of content types into the list of content formats and replaces all COAP_CT_.*occurences in our code with COAP_FORMAT_.*. I merged into the COAP_FORMAT_ options because those were more often used than the COAP_CT_ defines.

Not sure whether to call this an API_CHANGE, but all example code uses COAP_FORMAT_, so the old defines "should" not have been used outside our implementations, but if somebody wants to call this an api change I'm fine with it.

Testing procedure

A small test to verify that the .well-known/core still has content number 40 should be enough here.

Issues/PRs references

None

@bergzand bergzand added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: run tests If set, CI server will run tests on hardware for the labeled PR Area: CoAP Area: Constrained Application Protocol implementations labels Oct 3, 2018
@jia200x jia200x added this to the Release 2018.10 milestone Oct 4, 2018
Copy link
Member

@smlng smlng left a comment

Choose a reason for hiding this comment

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

(minimal) tested ACK

@smlng smlng added Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines labels Oct 8, 2018
@smlng
Copy link
Member

smlng commented Oct 8, 2018

one thing: isn't this somehow an API CHANGE? Some RIOT external APP could use the old defines, right?

@smlng smlng added the Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. label Oct 8, 2018
@bergzand
Copy link
Member Author

bergzand commented Oct 8, 2018

one thing: isn't this somehow an API CHANGE? Some RIOT external APP could use the old defines, right?

Yeah, that's why I mentioned it in the opening post. If everybody nicely based their applications on our examples it should not be a problem, but that's a huge if there. Anyway, I'm fine with this being considered an API change.

@smlng
Copy link
Member

smlng commented Oct 8, 2018

I guess it's good to have the label for documentation and release changelog creation.

@smlng
Copy link
Member

smlng commented Oct 8, 2018

though I'd like to have second ACK on this one then, too

@bergzand
Copy link
Member Author

bergzand commented Oct 8, 2018

I guess it's good to have the label for documentation and release changelog creation.

Fair enough

though I'd like to have second ACK on this one then, too

Agreed

Thanks for the review!

Copy link
Member

@kb2ma kb2ma left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this issue, @bergzand! The COAP_CT_xxx constants predate the merge of nanocoap and gcoap, and I agree it's time to disable these. I also agree it's worthwhile to consider existing users of the COAP_CT macros, although I expect there are few of them.

So, does it make sense to mark the COAP_CT_xxx macros as deprecated for a couple of releases? I would like to see us get into this mechanism for nanocoap/gcoap as the API will be evolving for function names. For example, coap_put_option_ct() (with the same problem as these macros) should change to coap_opt_put_format() or something like that. So, it makes sense to me to deprecate the current function name for a while.

Besides that, this work tests fine for me.

@jia200x
Copy link
Member

jia200x commented Oct 10, 2018

So, does it make sense to mark the COAP_CT_xxx macros as deprecated for a couple of releases? I would like to see us get into this mechanism for nanocoap/gcoap as the API will be evolving for function names. For example, coap_put_option_ct() (with the same problem as these macros) should change to coap_opt_put_format() or something like that. So, it makes sense to me to deprecate the current function name for a while.

I'm +1 for adding a @deprecated tag to these macros

@bergzand
Copy link
Member Author

Restored the removed defines and added a @deprecated tag with a message to them.

@kb2ma
Copy link
Member

kb2ma commented Oct 14, 2018

Thanks, @bergzand. The deprecated tag really stands out in Doxygen. This all looks good and tests fine for me.

There are a few uses of the "deprecated" tag in the code base. I don't know about historical use though. So, I would like to merge this PR, and then I plan to send create an RFC Issue to confirm there is no concern with this approach systematically for evolving the gcoap/nanocoap APIs forward. It helps to have an example. :-)

@smlng, any concerns? If not, I'm ready to squash and go.

deprecated

@kb2ma
Copy link
Member

kb2ma commented Oct 14, 2018

Link is an improvement (thanks @miri64), and bold looks even better. Unfortunately the use of black color for text means it doesn't stand out as a link.

deprecated2

@bergzand
Copy link
Member Author

Unfortunately the use of black color for text means it doesn't stand out as a link.

Yeah, also noticed that, not sure if we can fix that without modifying the css file.

@smlng
Copy link
Member

smlng commented Oct 15, 2018

Looks good to me, please squash

@bergzand bergzand force-pushed the pr/coap/merge_ct_format branch from f4547c5 to 43bdf4e Compare October 15, 2018 07:38
@bergzand bergzand force-pushed the pr/coap/merge_ct_format branch from 43bdf4e to d76cf06 Compare October 15, 2018 07:40
Replaces all occurences of COAP_CT_.* with COAP_FORMAT_.*
COAP_CT_ style defines for the content types are deprecated in favour of
COAP_FORMAT_ style defines. COAP_FORMAT_ is expanded to include any
missing content type that was available with COAP_CT_.
@bergzand bergzand force-pushed the pr/coap/merge_ct_format branch from d76cf06 to 8ee2bc5 Compare October 15, 2018 07:44
@bergzand
Copy link
Member Author

Squashed and rebased. I've reworded the second commit message to better reflect the current changes.

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 15, 2018
@smlng
Copy link
Member

smlng commented Oct 15, 2018

@bergzand you broke the core 😉 I'll rerun Murdock

@smlng smlng added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: run tests If set, CI server will run tests on hardware for the labeled PR labels Oct 15, 2018
@kb2ma
Copy link
Member

kb2ma commented Oct 15, 2018

I saw the build failure. What went wrong?

Also, and this is drifting off topic, but when is it appropriate to tag with 'run tests'? I looked around yesterday for more background, but could not find an answer.

@bergzand
Copy link
Member Author

@bergzand you broke the core wink I'll rerun Murdock

But how...?

@smlng
Copy link
Member

smlng commented Oct 15, 2018

@bergzand I was joking, I think the test is flawed or at least not deterministic in results on native

@kb2ma kb2ma merged commit cec477a into RIOT-OS:master Oct 15, 2018
@kb2ma
Copy link
Member

kb2ma commented Oct 15, 2018

Thanks everyone for talking this through and improvements.

@bergzand
Copy link
Member Author

Now we only have to remember to actually remove the defines in a release or two :)

@bergzand bergzand deleted the pr/coap/merge_ct_format branch October 15, 2018 09:49
@miri64
Copy link
Member

miri64 commented Oct 15, 2018

Now we only have to remember to actually remove the defines in a release or two :)

At some point we need to go through this list anyway and start removing stuff ;-)

@jia200x
Copy link
Member

jia200x commented Oct 15, 2018

Great! Thanks so much to everyone involved!

At some point we need to go through this list anyway and start removing stuff ;-)

+1. There could be some kind of automation between releases :)

@miri64
Copy link
Member

miri64 commented Oct 15, 2018

I think letting some bot remove stuff from our code is something that would lead to desaster.

@miri64
Copy link
Member

miri64 commented Oct 15, 2018

(also the interval deprecated should be removed is something that should very much be decided on a case-by-case basis)

@kb2ma
Copy link
Member

kb2ma commented Oct 15, 2018

Thanks all for the comments! I plan to post a deprecation RFC in the next few days, and will look for consensus on a trial approach to this workflow.

BTW @miri64, I know I have seen that "Deprecated List" in Doxygen hundreds of times as I click into something else, but it didn't register in my mind that it existed when I looked for existing deprecated code. Thanks for calling that out.

@jia200x
Copy link
Member

jia200x commented Oct 15, 2018

I think letting some bot remove stuff from our code is something that would lead to desaster.

I mean something to warn that a feature should be deprecated. We could tag the time somehow.
Never intended to automatically remove tags but more into the direction of inform maintainers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: CoAP Area: Constrained Application Protocol implementations CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants