Skip to content

src: remove regex usage for env file parsing #52406

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

IlyasShabi
Copy link
Contributor

@IlyasShabi IlyasShabi commented Apr 7, 2024

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Apr 7, 2024
@IlyasShabi IlyasShabi marked this pull request as ready for review April 7, 2024 15:35
Copy link
Contributor

@climba03003 climba03003 left a comment

Choose a reason for hiding this comment

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

Can you add multiple continues comments in valid.env to ensure it works?

@IlyasShabi
Copy link
Contributor Author

Can you add multiple continues comments in valid.env to ensure it works?

@climba03003 Could you provide me with an example and the expected result?

@climba03003
Copy link
Contributor

climba03003 commented Apr 7, 2024

// .valid.env
#COMMENTED_ENV=should not shown
#COMMENTED_ENV_FOLLOW_COMMENTED_ENV=should not shown
#COMMENTED_ENV_FOLLOW_COMMENTED_ENV_2=should not shown

// test
// Commented environment should be undefined
assert.strictEqual(process.env.COMMENTED_ENV, undefined);
assert.strictEqual(process.env.COMMENTED_ENV_FOLLOW_COMMENTED_ENV, undefined);
assert.strictEqual(process.env.COMMENTED_ENV_FOLLOW_COMMENTED_ENV_2, undefined);

@VoltrexKeyva
Copy link
Member

You should use the snake_case naming convention for local variables and parameters as stated here in the C++ style guide.

Copy link
Member

@anonrig anonrig left a comment

Choose a reason for hiding this comment

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

Small changes but overall I think this is ready to land. Thank you.

@anonrig anonrig 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 Apr 11, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 11, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@IlyasShabi
Copy link
Contributor Author

Flaky tests

@targos
Copy link
Member

targos commented Apr 12, 2024

No. Some dotenv tests are broken on Windows.

See https://ci.nodejs.org/job/node-test-binary-windows-js-suites/27085/RUN_SUBSET=1,nodes=win2016-COMPILED_BY-vs2022-x86/console

(Search for "not ok" in the output)

@anonrig anonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 12, 2024
@anonrig anonrig added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Apr 16, 2024
@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 16, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/52406
✔  Done loading data for nodejs/node/pull/52406
----------------------------------- PR info ------------------------------------
Title      src: remove regex usage for env file parsing (#52406)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     IlyasShabi:dotenv-refacto -> nodejs:main
Labels     c++, author ready, needs-ci, commit-queue-squash
Commits    2
 - src: remove regex usage for env file parsing
 - src: handle empty value without newline at EOF
Committers 1
 - Ilyas Shabi 
PR-URL: https://github.com/nodejs/node/pull/52406
Fixes: https://github.com/nodejs/node/issues/52248
Reviewed-By: Yagiz Nizipli 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/52406
Fixes: https://github.com/nodejs/node/issues/52248
Reviewed-By: Yagiz Nizipli 
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last approving review:
   ⚠  - src: handle empty value without newline at EOF
   ℹ  This PR was created on Sun, 07 Apr 2024 15:34:18 GMT
   ✔  Approvals: 1
   ✔  - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/52406#pullrequestreview-1995581300
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2024-04-16T01:40:19Z: https://ci.nodejs.org/job/node-test-pull-request/58417/
- Querying data for job/node-test-pull-request/58417/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/8699372234

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

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@targos targos added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Apr 17, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 17, 2024
@nodejs-github-bot nodejs-github-bot merged commit 3f88e14 into nodejs:main Apr 17, 2024
58 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 3f88e14

@kibertoad
Copy link
Contributor

@IlyasShabi thank you so much! do you plan to backport to 20.x too?

@kibertoad
Copy link
Contributor

kibertoad commented Apr 27, 2024

@RafaelGSS I don't see this PR in the changelog for 22.0.0, was it somehow excluded for whatever reason? It doesn't seem to be fixed in current V22 either.

@anonrig
Copy link
Member

anonrig commented Apr 27, 2024

cc @nodejs/releasers

aduh95 pushed a commit that referenced this pull request Apr 29, 2024
PR-URL: #52406
Fixes: #52248
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
@targos targos mentioned this pull request Apr 30, 2024
8 tasks
marco-ippolito pushed a commit that referenced this pull request May 2, 2024
PR-URL: #52406
Fixes: #52248
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
PR-URL: #52406
Fixes: #52248
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
@atilkan
Copy link

atilkan commented Jan 21, 2025

Is it possible that with this change inline comments are gone?

# for free to join this conversation on GitHub. Already have an account? # 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. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants