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

fs: undeprecate lchown() #21498

Merged
merged 1 commit into from
Jun 27, 2018
Merged

fs: undeprecate lchown() #21498

merged 1 commit into from
Jun 27, 2018

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Jun 24, 2018

uv_fs_lchown() exists, as of libuv 1.21.0. fs.lchown() can now be undeprecated. This commit also adds tests, as there were none. As with fs.chown() and fs.fchown(), the tests are somewhat limited.

Fixes: #19868

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the libuv Issues and PRs related to the libuv dependency or the uv binding. label Jun 24, 2018
@cjihrig
Copy link
Contributor Author

cjihrig commented Jun 24, 2018


<a id="DEP0038"></a>
### DEP0038: fs.lchownSync(path, uid, gid)

Type: Documentation-only

The [`fs.lchownSync(path, uid, gid)`][] API is deprecated.
The [`fs.lchownSync(path, uid, gid)`][] API was previously deprecated. As of
Copy link
Member

Choose a reason for hiding this comment

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

Given it was never hard-deprecated or removed - I'm not sure it's not best to remove this entirely.

doc/api/fs.md Outdated
@@ -1918,6 +1920,8 @@ changes:
pr-url: https://github.com/nodejs/node/pull/7897
description: The `callback` parameter is no longer optional. Not passing
it will emit a deprecation warning with id DEP0013.
- version: v0.4.7
Copy link
Member

Choose a reason for hiding this comment

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

I also think it makes sense to remove the deprecation entirely since there is no effect about this being deprecated in earlier versions and it was doc-deprecated anyway.

doc/api/fs.md Outdated
pr-url: https://github.com/nodejs/node/pull/XXXXX-replace
description: This API is no longer deprecated.
- version: v10.0.0
description: This API is deprecated.
Copy link
Member

Choose a reason for hiding this comment

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

I don't see a point in keeping this deprecation regardless of the other one since fsPromises is experimental

const int argc = args.Length();
CHECK_GE(argc, 3);

BufferValue path(env->isolate(), args[0]);

This comment was marked as off-topic.

@@ -0,0 +1,50 @@
'use strict';

const common = require('../common');
Copy link
Member

Choose a reason for hiding this comment

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

If there are other tests you think we should add to lchown, let me know and we'll make good-first-issues out of them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're pretty light on chown(), fchown(), and lchown() happy path tests in general. My guess is because of platform support and getting the uid and gid parts right on the CI.

@benjamingr
Copy link
Member

Code of commit 5a08026 LGTM but would prefer it if someone with more libuv experience approves :)

Nice work!

@cjihrig cjihrig force-pushed the lchown branch 3 times, most recently from 11cd3f4 to ea9d597 Compare June 27, 2018 14:37
uv_fs_lchown() exists, as of libuv 1.21.0. fs.lchown() can now
be undeprecated. This commit also adds tests, as there were
none.

PR-URL: nodejs#21498
Fixes: nodejs#19868
Reviewed-By: Wyatt Preul <[email protected]>
@cjihrig
Copy link
Contributor Author

cjihrig commented Jun 27, 2018

Updated as requested.

CI: https://ci.nodejs.org/job/node-test-pull-request/15652/
The inspector failures on Windows are not related.

@cjihrig cjihrig merged commit 7ff50f9 into nodejs:master Jun 27, 2018
@cjihrig cjihrig deleted the lchown branch June 27, 2018 15:39
targos pushed a commit that referenced this pull request Jun 28, 2018
uv_fs_lchown() exists, as of libuv 1.21.0. fs.lchown() can now
be undeprecated. This commit also adds tests, as there were
none.

PR-URL: #21498
Fixes: #19868
Reviewed-By: Wyatt Preul <[email protected]>
@ChALkeR
Copy link
Member

ChALkeR commented Jul 1, 2018

@nodejs/tsc

According the the git history, this is the first commit which removes deprecation numbers from the documentation. Is that intended?

@Trott
Copy link
Member

Trott commented Jul 1, 2018

@ChALkeR As long as the deprecation number is never re-used, I'm personally OK with removing a deprecation number from the docs if it is unused in the corresponding Node.js version. (I'm also OK with leaving it in, with or without an indication that it is no longer used.)

@targos targos mentioned this pull request Jul 3, 2018
targos added a commit that referenced this pull request Jul 3, 2018
Notable changes:

* build:
  * Node.js should now be about 60% faster to startup than the previous version,
    thanks to the use V8's code cache feature for core modules. [#21405](#21405)
* dns:
  * An experimental promisified version of the dns module is now available. Give
    it a try with `require('dns').promises`. [#21264](#21264)
* fs:
  * `fs.lchown` has been undeprecated now that libuv supports it. [#21498](#21498)
* lib:
  * `Atomics.wake` is being renamed to `Atomics.notify` in the ECMAScript
    specification ([reference](tc39/ecma262#1220)).
    Since Node.js now has experimental support for worker threads, we are being
    proactive and added a `notify` alias, while emitting a warning if
    `wake` is used. [#21413](#21413) [#21518](#21518)
* n-api:
  * Add API for asynchronous functions. [#17887](#17887)
* util:
  * `util.inspect` is now able to return a result instead of throwing when the
    maximum call stack size is exceeded during inspection. [#20725](#20725)
* vm:
  * Add `script.createCachedData()`. This API replaces the `produceCachedData`
    option of the `Script` constructor that is now deprecated. [#20300](#20300)
* worker:
  * Support for relative paths has been added to the `Worker` constructor. Paths
    are interpreted relative to the current working directory. [#21407](#21407)

PR-URL: #21629
targos added a commit that referenced this pull request Jul 4, 2018
Notable changes:

* dns:
  * An experimental promisified version of the dns module is now available. Give
    it a try with `require('dns').promises`. [#21264](#21264)
* fs:
  * `fs.lchown` has been undeprecated now that libuv supports it. [#21498](#21498)
* lib:
  * `Atomics.wake` is being renamed to `Atomics.notify` in the ECMAScript
    specification ([reference](tc39/ecma262#1220)).
    Since Node.js now has experimental support for worker threads, we are being
    proactive and added a `notify` alias, while emitting a warning if
    `wake` is used. [#21413](#21413) [#21518](#21518)
* n-api:
  * Add API for asynchronous functions. [#17887](#17887)
* util:
  * `util.inspect` is now able to return a result instead of throwing when the
    maximum call stack size is exceeded during inspection. [#20725](#20725)
* vm:
  * Add `script.createCachedData()`. This API replaces the `produceCachedData`
    option of the `Script` constructor that is now deprecated. [#20300](#20300)
* worker:
  * Support for relative paths has been added to the `Worker` constructor. Paths
    are interpreted relative to the current working directory. [#21407](#21407)

PR-URL: #21629
targos added a commit that referenced this pull request Jul 4, 2018
Notable changes:

* dns:
  * An experimental promisified version of the dns module is now available. Give
    it a try with `require('dns').promises`. [#21264](#21264)
* fs:
  * `fs.lchown` has been undeprecated now that libuv supports it. [#21498](#21498)
* lib:
  * `Atomics.wake` is being renamed to `Atomics.notify` in the ECMAScript
    specification ([reference](tc39/ecma262#1220)).
    Since Node.js now has experimental support for worker threads, we are being
    proactive and added a `notify` alias, while emitting a warning if
    `wake` is used. [#21413](#21413) [#21518](#21518)
* n-api:
  * Add API for asynchronous functions. [#17887](#17887)
* util:
  * `util.inspect` is now able to return a result instead of throwing when the
    maximum call stack size is exceeded during inspection. [#20725](#20725)
* vm:
  * Add `script.createCachedData()`. This API replaces the `produceCachedData`
    option of the `Script` constructor that is now deprecated. [#20300](#20300)
* worker:
  * Support for relative paths has been added to the `Worker` constructor. Paths
    are interpreted relative to the current working directory. [#21407](#21407)

PR-URL: #21629
@tniessen tniessen added fs Issues and PRs related to the fs subsystem / file system. deprecations Issues and PRs related to deprecations. labels Sep 8, 2018
@tniessen tniessen mentioned this pull request Sep 9, 2018
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecations Issues and PRs related to deprecations. fs Issues and PRs related to the fs subsystem / file system. libuv Issues and PRs related to the libuv dependency or the uv binding.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants