Skip to content

buffer: add end parameter#62390

Open
ronag wants to merge 1 commit intomainfrom
buffer-index-of-end
Open

buffer: add end parameter#62390
ronag wants to merge 1 commit intomainfrom
buffer-index-of-end

Conversation

@ronag
Copy link
Copy Markdown
Member

@ronag ronag commented Mar 22, 2026

To limit how far into the buffer we search without allocating an unnecessary subarray.

@ronag ronag requested review from jasnell and mcollina March 22, 2026 09:54
@ronag ronag self-assigned this Mar 22, 2026
@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Mar 22, 2026
@ronag ronag force-pushed the buffer-index-of-end branch 2 times, most recently from 6dc1d1e to f622fff Compare March 22, 2026 09:55
ronag added a commit that referenced this pull request Mar 22, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
@ronag ronag force-pushed the buffer-index-of-end branch from f622fff to b57fa1f Compare March 22, 2026 09:58
ronag added a commit that referenced this pull request Mar 22, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
@ronag ronag force-pushed the buffer-index-of-end branch from b57fa1f to b739413 Compare March 22, 2026 10:08
@ronag ronag marked this pull request as ready for review March 22, 2026 10:08
ronag added a commit that referenced this pull request Mar 22, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
@ronag ronag force-pushed the buffer-index-of-end branch from b739413 to 5690750 Compare March 22, 2026 10:39
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina
Copy link
Copy Markdown
Member

CI does not seem happy

ronag added a commit that referenced this pull request Mar 22, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
@ronag ronag force-pushed the buffer-index-of-end branch from 5690750 to ddbc9cd Compare March 22, 2026 13:36
@ronag ronag added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Mar 22, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 22, 2026

Codecov Report

❌ Patch coverage is 86.13861% with 14 lines in your changes missing coverage. Please review.
βœ… Project coverage is 89.78%. Comparing base (bf1aebc) to head (999b453).
⚠️ Report is 47 commits behind head on main.

Files with missing lines Patch % Lines
src/node_buffer.cc 70.83% 4 Missing and 10 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62390      +/-   ##
==========================================
+ Coverage   89.72%   89.78%   +0.06%     
==========================================
  Files         695      699       +4     
  Lines      214464   216282    +1818     
  Branches    41067    41349     +282     
==========================================
+ Hits       192420   194193    +1773     
- Misses      14106    14188      +82     
+ Partials     7938     7901      -37     
Files with missing lines Coverage Ξ”
lib/buffer.js 99.18% <100.00%> (+0.01%) ⬆️
src/node_buffer.cc 68.03% <70.83%> (-0.17%) ⬇️

... and 84 files with indirect coverage changes

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ronag ronag requested a review from mcollina March 22, 2026 16:00
```

### `buf.includes(value[, byteOffset][, encoding])`
### `buf.includes(value[, byteOffset[, end]][, encoding])`
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.

When we start getting into new optional arguments in the middle like this I think we should consider an alternative signature with an options bag instead...

buf.includes(value, {
  byteOffset: 0,
  end: 10,
  encoding: 'utf8',
});

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

follow up PR?

@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Mar 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Failed to start CI
   ⚠  Commits were pushed since the last approving review:
   ⚠  - buffer: add end parameter
   ✘  Refusing to run CI on potentially unsafe PR
https://github.com/nodejs/node/actions/runs/23542726197

@aduh95
Copy link
Copy Markdown
Contributor

aduh95 commented Apr 2, 2026

There's a conflict to solve

ronag added a commit that referenced this pull request Apr 4, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
@ronag ronag force-pushed the buffer-index-of-end branch from ddbc9cd to c4aecb4 Compare April 4, 2026 18:07
@ronag ronag added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. labels Apr 4, 2026
@ronag ronag requested review from aduh95 and jasnell April 4, 2026 18:07
ronag added a commit that referenced this pull request Apr 4, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
@ronag ronag force-pushed the buffer-index-of-end branch from c4aecb4 to 445df3f Compare April 4, 2026 18:08
@ronag ronag added the review wanted PRs that need reviews. label Apr 7, 2026
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@ronag ronag added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Apr 7, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 7, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@Renegade334 Renegade334 added the semver-minor PRs that contain new features and should be released in the next minor version. label Apr 8, 2026
@ronag ronag requested review from anonrig and lpinca April 8, 2026 16:26
@avivkeller avivkeller added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 9, 2026
@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 Apr 9, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/62390
βœ”  Done loading data for nodejs/node/pull/62390
----------------------------------- PR info ------------------------------------
Title      buffer: add end parameter (#62390)
Author     Robert Nagy <ronagy@icloud.com> (@ronag)
Branch     ronag:buffer-index-of-end -> nodejs:main
Labels     buffer, c++, semver-minor, author ready, needs-ci, review wanted
Commits    1
 - buffer: add end parameter
Committers 1
 - Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/62390
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/62390
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
--------------------------------------------------------------------------------
   β„Ή  This PR was created on Sun, 22 Mar 2026 09:53:58 GMT
   βœ”  Approvals: 1
   βœ”  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/62390#pullrequestreview-4067847074
   βœ”  Last GitHub CI successful
   β„Ή  Last Full PR CI on 2026-04-08T05:43:34Z: https://ci.nodejs.org/job/node-test-pull-request/72552/
- Querying data for job/node-test-pull-request/72552/
βœ”  Build data downloaded
   βœ”  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 62390
From https://github.com/nodejs/node
 * branch                  refs/pull/62390/merge -> FETCH_HEAD
βœ”  Fetched commits as 70c1d6b7314f..445df3f2a63a
--------------------------------------------------------------------------------
[main c26888b5a4] buffer: add end parameter
 Author: Robert Nagy <ronagy@icloud.com>
 Date: Sun Mar 22 10:53:00 2026 +0100
 5 files changed, 195 insertions(+), 58 deletions(-)
   βœ”  Patches applied
--------------------------------------------------------------------------------
   ⚠  Found PR-URL: https://github.com/nodejs/node/pull/62390, skipping..
--------------------------------- New Message ----------------------------------
buffer: add end parameter

To limit how far into the buffer we search without allocating an
unnecessary subarray.

Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

[main 3fb6848c29] buffer: add end parameter
Author: Robert Nagy <ronagy@icloud.com>
Date: Sun Mar 22 10:53:00 2026 +0100
5 files changed, 195 insertions(+), 58 deletions(-)
βœ– 3fb6848c294c6f3d05c60720e0fbe3ac0cf11cd1
βœ” 0:0 no Co-authored-by metadata co-authored-by-is-trailer
βœ” 0:0 skipping fixes-url fixes-url
βœ” 0:0 blank line after title line-after-title
βœ” 0:0 line-lengths are valid line-length
βœ” 0:0 metadata is at end of message metadata-end
βœ– 0:0 Commit must have a PR-URL. pr-url
βœ” 0:0 reviewers are valid reviewers
βœ” 0:0 valid subsystems subsystem
βœ” 0:0 Title is formatted correctly. title-format
βœ” 0:0 Title is <= 50 columns. title-length

β„Ή Please fix the commit message and try again.
Please manually ammend the commit message, by running
git commit --amend
Once commit message is fixed, finish the landing command running
git node land --continue

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

@ronag ronag removed the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Apr 10, 2026
To limit how far into the buffer we search without allocating an
unnecessary subarray.

PR-URL: #62390
Signed-off-by: Robert Nagy <ronay@icloud.com>
@ronag ronag force-pushed the buffer-index-of-end branch from 445df3f to 999b453 Compare April 10, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. review wanted PRs that need reviews. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants