Skip to content

Conversation

rayark1
Copy link
Contributor

@rayark1 rayark1 commented Mar 12, 2025

Previously, parseEnv would create multiple environment variables if a single line contained multiple ‘=‘ characters (e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as the key-value delimiter, and the rest of the line is treated as the value.

Fixes: #57411

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/config
  • @nodejs/performance

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. config Issues or PRs related to the config subsystem needs-ci PRs that need a full CI run. labels Mar 12, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: nodejs#57411
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 90.23%. Comparing base (c3ed292) to head (1ac38ad).
Report is 163 commits behind head on main.

Files with missing lines Patch % Lines
src/node_dotenv.cc 75.00% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57421      +/-   ##
==========================================
- Coverage   90.23%   90.23%   -0.01%     
==========================================
  Files         630      629       -1     
  Lines      185219   184859     -360     
  Branches    36248    36215      -33     
==========================================
- Hits       167140   166811     -329     
+ Misses      11048    11018      -30     
+ Partials     7031     7030       -1     
Files with missing lines Coverage Δ
src/node_dotenv.cc 83.59% <75.00%> (-2.12%) ⬇️

... and 61 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.

@Armanidashh

This comment was marked as off-topic.

rayark1 and others added 2 commits March 14, 2025 04:14
@aduh95
Copy link
Contributor

aduh95 commented Mar 14, 2025

Also, we should keep a test case for the unquoted version A=B=C, either to verify it throws, or whatever behavior that we can get consensus on.

@rayark1 rayark1 force-pushed the fix/57411 branch 2 times, most recently from c7267a5 to 255c299 Compare March 14, 2025 18:37
@rayark1
Copy link
Contributor Author

rayark1 commented Mar 23, 2025

I have incorporated all the review comments and added the corresponding test cases. Please let me know if there are any further suggestions or improvements needed.

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Mar 23, 2025
Copy link
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

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 1, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 5, 2025
@aduh95 aduh95 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 Apr 6, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 6, 2025
@nodejs-github-bot nodejs-github-bot merged commit e6a0d77 into nodejs:main Apr 6, 2025
75 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in e6a0d77

JonasBa pushed a commit to JonasBa/node that referenced this pull request Apr 11, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: nodejs#57411
PR-URL: nodejs#57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 1, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 2, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
aduh95 pushed a commit that referenced this pull request May 6, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
RafaelGSS pushed a commit that referenced this pull request May 14, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
aduh95 pushed a commit that referenced this pull request May 16, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
aduh95 pushed a commit that referenced this pull request May 17, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
aduh95 pushed a commit that referenced this pull request May 19, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
@ghost ghost mentioned this pull request Jun 8, 2025
marco-ippolito pushed a commit that referenced this pull request Aug 18, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Aug 20, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Aug 20, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Aug 23, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Aug 25, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Aug 25, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Aug 25, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Aug 25, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Aug 26, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
marco-ippolito pushed a commit that referenced this pull request Aug 27, 2025
Previously, parseEnv would create multiple environment
variables if a single line contained multiple ‘=‘ characters
(e.g. A=B=C would become { A: ‘B=C’, B: ‘C’ }).
This commit ensures that only the first ‘=‘ is used as
the key-value delimiter, and the rest of the line is treated
as the value.

Fixes: #57411
PR-URL: #57421
Reviewed-By: Daniel Lemire <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
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. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. config Issues or PRs related to the config subsystem needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

util.parseEnv creates additional environment variables when equal sign is in value
8 participants