Skip to content

tls: hard deprecate tls.createSecurePair#8783

Closed
yorkie wants to merge 1 commit into
nodejs:masterfrom
yorkie:tls/warn-deprecated
Closed

tls: hard deprecate tls.createSecurePair#8783
yorkie wants to merge 1 commit into
nodejs:masterfrom
yorkie:tls/warn-deprecated

Conversation

@yorkie

@yorkie yorkie commented Sep 26, 2016

Copy link
Copy Markdown
Contributor
Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

tls

Description of change

We should use util.deprecated to wrap the deprecated createSecurePair in tls module.

@nodejs-github-bot nodejs-github-bot added the tls Issues and PRs related to the tls subsystem. label Sep 26, 2016
@mscdex

mscdex commented Sep 26, 2016

Copy link
Copy Markdown
Contributor

This should be semver-major right?

@yorkie

yorkie commented Sep 26, 2016

Copy link
Copy Markdown
Contributor Author

It's bug fix, so semver-patch is proper :)

Comment thread lib/tls.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very minor nit:
Looks like majority of existing deprecation warnings in core lib have period . after the last word instead

@imyller imyller left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM with nit fixed

@mscdex

mscdex commented Sep 26, 2016

Copy link
Copy Markdown
Contributor

@nodejs/ctc What is the semver-ness of adding runtime (deprecation) warnings? I believe they can be handled/caught in-process now, but I wasn't sure if that changed policy or not?

@MylesBorins

MylesBorins commented Sep 26, 2016

Copy link
Copy Markdown
Contributor

introducing new warnings has been treated as a semver major afaik /cc @jasnell

The number of breakages that have happened due to changing output on stderr has been surprising to say the least.

@yorkie

yorkie commented Sep 26, 2016

Copy link
Copy Markdown
Contributor Author

Hi I have one question @thealphanerd, introducing new warnings even though it has been marked as deprecated in API docs should be treated as a major?

What I was thinking about is that this function should be with this warning once it's documented as deprecated API, but it doesn't, so this patch is fixing this bug in this way, and this pull-request is not going to deprecate anything else new.

@addaleax

addaleax commented Sep 26, 2016

Copy link
Copy Markdown
Member

@yorkie Introducing new deprecation warnings is a semver-major change, yes, and it doesn’t need to happen just because something is documented as deprecated in the docs.

(Also, maybe relevant: #7964?)

@addaleax addaleax added the semver-major PRs that contain breaking changes and should be released in the next major version. label Sep 26, 2016
@addaleax

Copy link
Copy Markdown
Member

What is the semver-ness of adding runtime (deprecation) warnings? I believe they can be handled/caught in-process now

They can be handled using process.on('warning') but that won’t stop Node from writing them to stderr, unless --no-warnings is passed on the command line.

@ChALkeR

ChALkeR commented Sep 26, 2016

Copy link
Copy Markdown
Member

@yorkie

Doc-deprecation does not always mean runtime-deprecation.

The current process for most API deprecations is to introduce a documentation-only deprecation (aka «soft-deprecate») in a major version, then to introduce a runtime-deprecation in code (aka «hard-deprecate») in some next major version, then remove the deprecated API in some next major version.

It's not a mistake here that it was deprecated in the docs but not in the runtime — it's the usual process. And hard-deprecation is a semver-major, this is not a bug fix.

Though it's most likely possible for 8.0, so let's keep this.

@ChALkeR

ChALkeR commented Sep 26, 2016

Copy link
Copy Markdown
Member

Note: the deprecation process for createSecurePair was started in #6063.

@jasnell

jasnell commented Sep 27, 2016

Copy link
Copy Markdown
Member

I don't believe we have a policy yet on the semver-iness of adding a normal process warning. Adding warnings has broken things in practice, however. Adding a deprecation warning, however, is definitely a semver-major.

This LGTM as a semver-major

@yorkie

yorkie commented Sep 27, 2016

Copy link
Copy Markdown
Contributor Author

Okay, so what's the process of landing this one? Should we land this after v8 has been released?

/cc @ChALkeR @jasnell

@jasnell

jasnell commented Sep 27, 2016

Copy link
Copy Markdown
Member

This would be able to land in master after at least two CTC members have signed off. Since the v7.x branch has already been cut, we would simply not pull it back to that branch. There's no reason to wait until after the v7.0.0 release goes out.

@addaleax addaleax closed this Sep 27, 2016
@addaleax addaleax reopened this Sep 27, 2016
@addaleax

Copy link
Copy Markdown
Member

Sorry, mis-clicked.

Judging from a quick look at #6063, it seems to be advantageous to move towards removing createSecurePair at some point; It would be great if somebody could write down what those advantages would be (and maybe include that in the commit message)?

@yorkie

yorkie commented Sep 28, 2016

Copy link
Copy Markdown
Contributor Author

@addaleax What I can see is that the tls-legacy.js could be removed from source if we absolutely remove this function. But as @ChALkeR pointed out, should we warn in user-land and later remove it in next major version?

@jasnell

jasnell commented Sep 28, 2016

Copy link
Copy Markdown
Member

I'd likely give it a couple of major versions before we considered removing it entirely. There's little harm in letting it sit for a while with the deprecation warning.

@addaleax

Copy link
Copy Markdown
Member

@yorkie Sounds good! Would you mind adding something like The long-term goal here is removing lib/_tls_legacy.js entirely. to the commit message? :)

@yorkie yorkie force-pushed the tls/warn-deprecated branch from aaedf57 to 7324067 Compare October 5, 2016 02:10
@yorkie

yorkie commented Oct 5, 2016

Copy link
Copy Markdown
Contributor Author

Done @addaleax and sorry about missing for few days :(

@addaleax addaleax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@yorkie Thanks! Don’t worry about it, semver-majors are usually not very urgent anyway.

LGTM

@yorkie

yorkie commented Oct 5, 2016

Copy link
Copy Markdown
Contributor Author

Okay, now let's do a confirmation about LGTMs, the CTC @jasnell @addaleax have left LGTM in previous comments/statuses. So could we land this pull-request as semver-major?

Thanks :)

@addaleax

addaleax commented Oct 5, 2016

Copy link
Copy Markdown
Member

So could we land this pull-request as semver-major?

Yup, formally all requirements are fulfilled. This change would likely be released in v8.0.0 in April, so there’s no urge in landing this, but if you want to you can.

@yorkie

yorkie commented Oct 6, 2016

Copy link
Copy Markdown
Contributor Author

Okay, let's land this in v8.0.0 :)

@jasnell

jasnell commented Oct 6, 2016

Copy link
Copy Markdown
Member

This can land now, the v7.x branch has already been cut. I just won't pull this commit over.

@jasnell

jasnell commented Oct 6, 2016

Copy link
Copy Markdown
Member

Actually, you know what... this could use a quick test... just something that verifies that the deprecation warning is emitted.

@jasnell

jasnell commented Nov 18, 2016

Copy link
Copy Markdown
Member

@yorkie ... can you add a test per my request here: #8783 (comment) . After that we can look to get it landed. Thank you!

@MylesBorins

Copy link
Copy Markdown
Contributor

@yorkie want to get a test together so we can land this?

@ChALkeR

ChALkeR commented Dec 31, 2016

Copy link
Copy Markdown
Member

@thealphanerd, @yorkie, remindier: the commit message is wrong here.

This in fact turns a soft (doc-only) deprecation into a hard (runtime) deprecation, but the commit message looks like it corrects an error in the previous deprecation step.

@yorkie

yorkie commented Jan 6, 2017

Copy link
Copy Markdown
Contributor Author

@jasnell @MylesBorins Sorry for delay on testing this PR and added in the latest ef12e41. @ChALkeR Also updated the commit message :)

@yorkie yorkie changed the title tls: should use .deprecated to wrap the deprecated createSecurePair tls: hard deprecate tls.createSecurePair Jan 6, 2017
@yorkie

yorkie commented Jan 6, 2017

Copy link
Copy Markdown
Contributor Author

Fixed some runtime errors :)

@yorkie

yorkie commented Jan 6, 2017

Copy link
Copy Markdown
Contributor Author

@sam-github

Copy link
Copy Markdown
Contributor

PR doesn't touch the docs... it appears it is currently impossible to tell from the docs whether deprecation is doc-only, or runtime, which is not good.

I don't know, @jasnell, @addaleax , someone?, is there way to make this clear in the docs?

Is this something that can be addressed in this PR, for this API, or does it need more wide-spread changes in docs?

@addaleax

Copy link
Copy Markdown
Member

@sam-github This is definitely the kind of information #10116 would provide in the docs

@jasnell

jasnell commented Jan 10, 2017

Copy link
Copy Markdown
Member

@sam-github.... funny you should ask... I have a PR that provides a place to document deprecations that's still sitting waiting for some reviews. It would be excellent if I could get some clear LGTM's on it so I can get it landed. #10116

@sam-github

Copy link
Copy Markdown
Contributor

@jasnell sorry, thought I'd reviewed your #10116, now I have.

@yorkie

yorkie commented Jan 17, 2017

Copy link
Copy Markdown
Contributor Author

Any progress about this PR? requesting more reviews, thank you :)

@sam-github sam-github left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@yorkie LGTM, but I would suggest you write the commit message as "tls.createSecurePair()" --- note the trailing () indicating its a function, not a property

@sam-github

Copy link
Copy Markdown
Contributor

@bnoordhuis @indutny Would be good to get a LGTM from someone who remembers when createSecurePair() was still used. @nodejs/crypto

@yorkie

yorkie commented Feb 27, 2017

Copy link
Copy Markdown
Contributor Author

Ping... able to merge?

@jasnell

jasnell commented Feb 27, 2017

Copy link
Copy Markdown
Member

Please hold off landing this one. I ended up with a largely duplicate pr that we need to reconcile.

@jasnell

jasnell commented Mar 22, 2017

Copy link
Copy Markdown
Member

Closing this. Another PR deprecating this has landed in master

@jasnell jasnell closed this Mar 22, 2017
@yorkie yorkie deleted the tls/warn-deprecated branch March 23, 2017 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-major PRs that contain breaking changes and should be released in the next major version. tls Issues and PRs related to the tls subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants