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

src: remove regex usage for env file parsing #52406

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.

src/node_dotenv.cc Outdated Show resolved Hide resolved
test/parallel/test-dotenv.js Outdated Show resolved Hide resolved
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.

src/node_dotenv.cc Show resolved Hide resolved
src/node_dotenv.cc Outdated Show resolved Hide resolved
src/node_dotenv.cc Outdated Show resolved Hide resolved
src/node_dotenv.cc Outdated Show resolved Hide resolved
src/node_dotenv.cc Show resolved Hide resolved
@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
src/node_dotenv.cc Outdated Show resolved Hide resolved
@anonrig anonrig 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. labels 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
@targos targos mentioned this pull request Apr 30, 2024
8 tasks
marco-ippolito pushed a commit that referenced this pull request May 2, 2024
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
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. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants