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

tls: hard deprecate tls.createSecurePair #8783

Closed
wants to merge 1 commit into from

Conversation

yorkie
Copy link
Contributor

@yorkie yorkie commented Sep 26, 2016

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
Copy link
Contributor

mscdex commented Sep 26, 2016

This should be semver-major right?

@yorkie
Copy link
Contributor Author

yorkie commented Sep 26, 2016

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

lib/tls.js Outdated
exports.createSecurePair = require('_tls_legacy').createSecurePair;
exports.createSecurePair = internalUtil.deprecate(function() {
require('_tls_legacy').createSecurePair.apply(null, arguments);
}, 'tls.createSecurePair is deprecated. Use tls.TLSSocket instead');
Copy link
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

Copy link
Member

@imyller imyller left a comment

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
Copy link
Contributor

mscdex commented Sep 26, 2016

@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
Copy link
Contributor

MylesBorins commented Sep 26, 2016

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
Copy link
Contributor Author

yorkie commented Sep 26, 2016

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
Copy link
Member

addaleax commented Sep 26, 2016

@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
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
Copy link
Member

ChALkeR commented Sep 26, 2016

@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
Copy link
Member

ChALkeR commented Sep 26, 2016

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

@jasnell
Copy link
Member

jasnell commented Sep 27, 2016

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
Copy link
Contributor Author

yorkie commented Sep 27, 2016

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

/cc @ChALkeR @jasnell

@jasnell
Copy link
Member

jasnell commented Sep 27, 2016

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
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
Copy link
Contributor Author

yorkie commented Sep 28, 2016

@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
Copy link
Member

jasnell commented Sep 28, 2016

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
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
Copy link
Contributor Author

yorkie commented Oct 5, 2016

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

Copy link
Member

@addaleax addaleax left a comment

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
Copy link
Contributor Author

yorkie commented Oct 5, 2016

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
Copy link
Member

addaleax commented Oct 5, 2016

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
Copy link
Contributor Author

yorkie commented Oct 6, 2016

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

@jasnell
Copy link
Member

jasnell commented Oct 6, 2016

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

@jasnell
Copy link
Member

jasnell commented Oct 6, 2016

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

@jasnell
Copy link
Member

jasnell commented Nov 18, 2016

@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
Contributor

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

@ChALkeR
Copy link
Member

ChALkeR commented Dec 31, 2016

@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
Copy link
Contributor Author

yorkie commented Jan 6, 2017

@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
Copy link
Contributor Author

yorkie commented Jan 6, 2017

Fixed some runtime errors :)

@yorkie
Copy link
Contributor Author

yorkie commented Jan 6, 2017

@sam-github
Copy link
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
Member

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

@jasnell
Copy link
Member

jasnell commented Jan 10, 2017

@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
Contributor

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

@yorkie
Copy link
Contributor Author

yorkie commented Jan 17, 2017

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

Copy link
Contributor

@sam-github sam-github left a comment

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
Contributor

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

@yorkie
Copy link
Contributor Author

yorkie commented Feb 27, 2017

Ping... able to merge?

@jasnell
Copy link
Member

jasnell commented Feb 27, 2017

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

@jasnell
Copy link
Member

jasnell commented Mar 22, 2017

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