Skip to content

stream: validate writable defaultEncoding#46322

Merged
nodejs-github-bot merged 4 commits into
nodejs:mainfrom
marco-ippolito:feat/validate-default-encoding
Jan 30, 2023
Merged

stream: validate writable defaultEncoding#46322
nodejs-github-bot merged 4 commits into
nodejs:mainfrom
marco-ippolito:feat/validate-default-encoding

Conversation

@marco-ippolito

@marco-ippolito marco-ippolito commented Jan 23, 2023

Copy link
Copy Markdown
Member

fixes: #46301
this has to be done for stream.Readable too for consistency. I'll open another pr for readable if this gets approved

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Jan 23, 2023
@ronag ronag added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jan 23, 2023
Comment thread lib/internal/streams/writable.js Outdated
Comment thread test/parallel/test-stream-writable-decoded-encoding.js
Comment thread lib/internal/streams/writable.js Outdated

@mcollina mcollina 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.

What happens if encoding is set and objectMode is set?

@marco-ippolito

Copy link
Copy Markdown
Member Author

What happens if encoding is set and objectMode is set?

in the example m.write({ foo: 'bar' }, 'hex'); ovverrides the default utf8 encoding.
I've added a test

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

@ShogunPanda ShogunPanda 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.

LGTM!

Comment thread lib/internal/streams/writable.js Outdated
@marco-ippolito marco-ippolito requested a review from aduh95 January 25, 2023 09:28
@anonrig anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 25, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 25, 2023
Comment thread test/parallel/test-stream-writable-decoded-encoding.js
@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 25, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 25, 2023
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 26, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 26, 2023
@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 29, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 29, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Comment thread lib/internal/streams/writable.js
@ShogunPanda ShogunPanda added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 30, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 30, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@ShogunPanda ShogunPanda added commit-queue Add this label to land a pull request using GitHub Actions. and removed needs-ci PRs that need a full CI run. labels Jan 30, 2023
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jan 30, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator
Commit Queue failed
- Loading data for nodejs/node/pull/46322
✔  Done loading data for nodejs/node/pull/46322
----------------------------------- PR info ------------------------------------
Title      stream: validate writable defaultEncoding (#46322)
Author     Marco Ippolito  (@marco-ippolito)
Branch     marco-ippolito:feat/validate-default-encoding -> nodejs:main
Labels     semver-major
Commits    4
 - stream: validate writable defaultEncoding
 - stream: test falsy defaultEncoding
 - stream: test object mode
 - stream: refactor code style
Committers 1
 - Marco Ippolito 
PR-URL: https://github.com/nodejs/node/pull/46322
Fixes: https://github.com/nodejs/node/issues/46301
Reviewed-By: Robert Nagy 
Reviewed-By: Matteo Collina 
Reviewed-By: Paolo Insogna 
Reviewed-By: Benjamin Gruenbaum 
Reviewed-By: Yagiz Nizipli 
Reviewed-By: Luigi Pinca 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/46322
Fixes: https://github.com/nodejs/node/issues/46301
Reviewed-By: Robert Nagy 
Reviewed-By: Matteo Collina 
Reviewed-By: Paolo Insogna 
Reviewed-By: Benjamin Gruenbaum 
Reviewed-By: Yagiz Nizipli 
Reviewed-By: Luigi Pinca 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Mon, 23 Jan 2023 21:15:25 GMT
   ✔  Approvals: 6
   ✔  - Robert Nagy (@ronag) (TSC): https://github.com/nodejs/node/pull/46322#pullrequestreview-1266353265
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/46322#pullrequestreview-1267105299
   ✔  - Paolo Insogna (@ShogunPanda): https://github.com/nodejs/node/pull/46322#pullrequestreview-1267507590
   ✔  - Benjamin Gruenbaum (@benjamingr): https://github.com/nodejs/node/pull/46322#pullrequestreview-1267936213
   ✔  - Yagiz Nizipli (@anonrig): https://github.com/nodejs/node/pull/46322#pullrequestreview-1270011746
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/46322#pullrequestreview-1270098666
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2023-01-30T16:05:40Z: https://ci.nodejs.org/job/node-test-pull-request/49252/
- Querying data for job/node-test-pull-request/49252/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 46322
From https://github.com/nodejs/node
 * branch                  refs/pull/46322/merge -> FETCH_HEAD
✔  Fetched commits as a5fd53f8eff7..958633dd2ad9
--------------------------------------------------------------------------------
[main ab718f9c95] stream: validate writable defaultEncoding
 Author: Marco Ippolito 
 Date: Mon Jan 23 22:13:03 2023 +0100
 2 files changed, 31 insertions(+), 1 deletion(-)
[main 57e3f04abe] stream: test falsy defaultEncoding
 Author: Marco Ippolito 
 Date: Tue Jan 24 09:32:37 2023 +0100
 1 file changed, 13 insertions(+)
[main eeb0cd9b48] stream: test object mode
 Author: Marco Ippolito 
 Date: Tue Jan 24 10:07:00 2023 +0100
 1 file changed, 10 insertions(+)
[main 8842b7f615] stream: refactor code style
 Author: Marco Ippolito 
 Date: Wed Jan 25 10:27:25 2023 +0100
 1 file changed, 5 insertions(+), 4 deletions(-)
   ✔  Patches applied
There are 4 commits in the PR. Attempting autorebase.
Rebasing (2/8)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
stream: validate writable defaultEncoding

PR-URL: #46322
Fixes: #46301
Reviewed-By: Robert Nagy ronagy@icloud.com
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Paolo Insogna paolo@cowtech.it
Reviewed-By: Benjamin Gruenbaum benjamingr@gmail.com
Reviewed-By: Yagiz Nizipli yagiz@nizipli.com
Reviewed-By: Luigi Pinca luigipinca@gmail.com

[detached HEAD f2d9d32f1e] stream: validate writable defaultEncoding
Author: Marco Ippolito marcoippolito54@gmail.com
Date: Mon Jan 23 22:13:03 2023 +0100
2 files changed, 31 insertions(+), 1 deletion(-)
Rebasing (3/8)
Rebasing (4/8)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
stream: test falsy defaultEncoding

PR-URL: #46322
Fixes: #46301
Reviewed-By: Robert Nagy ronagy@icloud.com
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Paolo Insogna paolo@cowtech.it
Reviewed-By: Benjamin Gruenbaum benjamingr@gmail.com
Reviewed-By: Yagiz Nizipli yagiz@nizipli.com
Reviewed-By: Luigi Pinca luigipinca@gmail.com

[detached HEAD a06590b30f] stream: test falsy defaultEncoding
Author: Marco Ippolito marcoippolito54@gmail.com
Date: Tue Jan 24 09:32:37 2023 +0100
1 file changed, 13 insertions(+)
Rebasing (5/8)
Rebasing (6/8)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
stream: test object mode

PR-URL: #46322
Fixes: #46301
Reviewed-By: Robert Nagy ronagy@icloud.com
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Paolo Insogna paolo@cowtech.it
Reviewed-By: Benjamin Gruenbaum benjamingr@gmail.com
Reviewed-By: Yagiz Nizipli yagiz@nizipli.com
Reviewed-By: Luigi Pinca luigipinca@gmail.com

[detached HEAD a1ce83cf3d] stream: test object mode
Author: Marco Ippolito marcoippolito54@gmail.com
Date: Tue Jan 24 10:07:00 2023 +0100
1 file changed, 10 insertions(+)
Rebasing (7/8)
Rebasing (8/8)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
stream: refactor code style

PR-URL: #46322
Fixes: #46301
Reviewed-By: Robert Nagy ronagy@icloud.com
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Paolo Insogna paolo@cowtech.it
Reviewed-By: Benjamin Gruenbaum benjamingr@gmail.com
Reviewed-By: Yagiz Nizipli yagiz@nizipli.com
Reviewed-By: Luigi Pinca luigipinca@gmail.com

[detached HEAD 3daaebfb85] stream: refactor code style
Author: Marco Ippolito marcoippolito54@gmail.com
Date: Wed Jan 25 10:27:25 2023 +0100
1 file changed, 5 insertions(+), 4 deletions(-)

Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/4046566650

@ShogunPanda ShogunPanda added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jan 30, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 30, 2023
@nodejs-github-bot nodejs-github-bot merged commit 9e7093f into nodejs:main Jan 30, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 9e7093f

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

Labels

commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

options.defaultEncoding not validated in stream.Writable constructor

10 participants