Skip to content

Replace child_process.exec() with execFile()#288

Merged
mikeharder merged 19 commits intoAzure:mainfrom
mikeharder:exec-file
Mar 24, 2026
Merged

Replace child_process.exec() with execFile()#288
mikeharder merged 19 commits intoAzure:mainfrom
mikeharder:exec-file

Conversation

@mikeharder
Copy link
Copy Markdown
Member

No description provided.

- align with specs repo convention
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Avocado’s command execution helper and its usage sites to prefer child_process.execFile() over exec(), aiming to avoid shell-string execution and improve argument handling.

Changes:

  • Replace the internal child-process wrapper from exec() to execFile() and update call sites (git runner + test).
  • Bump package version to 0.10.6 and add a check script to run build/test/lint/format checks.
  • Document the change in CHANGELOG.md.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/test/child-process-test.ts Updates test to call execFile('node', [...]) instead of executing a shell command string.
src/git.ts Switches git invocation to execFile('git', [cmd, ...args], options) to avoid shell string construction.
src/child-process.ts Replaces the promisified exec wrapper with an execFile wrapper (still enforcing maxBuffer: Infinity).
package.json Bumps version and adds a check script to run common validation tasks.
CHANGELOG.md Adds a 0.10.6 entry describing the migration to execFile().

@mikeharder mikeharder marked this pull request as draft March 24, 2026 07:05
mikeharder and others added 3 commits March 24, 2026 07:08
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
mikeharder and others added 3 commits March 24, 2026 00:11
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
mikeharder and others added 2 commits March 24, 2026 00:13
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@mikeharder mikeharder marked this pull request as ready for review March 24, 2026 18:20
@mikeharder mikeharder merged commit 546986a into Azure:main Mar 24, 2026
15 checks passed
@mikeharder mikeharder deleted the exec-file branch March 24, 2026 22:21
@kurtzeborn kurtzeborn moved this from 🔬 Dev in PR to 🎊 Closed in Azure SDK EngSys 🖥️🖱️⌨️👨‍💻🤯 Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants