Skip to content

refactor(tools): use asynchronous execa#41227

Open
jamietanna wants to merge 2 commits intomainfrom
refactor/execa-async
Open

refactor(tools): use asynchronous execa#41227
jamietanna wants to merge 2 commits intomainfrom
refactor/execa-async

Conversation

@jamietanna
Copy link
Contributor

Changes

Per #41062

Context

Please select one of the below:

  • This closes an existing Issue: Closes #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe): Claude Sonnet 4.5

Refactor the tools directory to use the async version of execa` ~54k

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

The public repository:

@github-actions github-actions bot requested a review from viceice February 16, 2026 17:24
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

otherwise LGTM

args.push('--strict');
}
const res = exec('pdm', args, {
const res = await exec('pdm', args, {
Copy link
Member

Choose a reason for hiding this comment

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

this always throws on errors

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Throws when we're doing it async? 👍

Copy link
Member

Choose a reason for hiding this comment

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

yes

Base automatically changed from refactor/execa to main February 16, 2026 18:13
Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
return execaSync(cmd, args, {
opts: Options = {},
): Promise<ExecaReturnValue<string>> {
return await execa(cmd, args, {
Copy link
Member

Choose a reason for hiding this comment

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

this now throws on errors, please add the execa option to not throw, so we can check the result for errors

@jamietanna
Copy link
Contributor Author

@viceice should we reject: false on all the invocations here? Or only from the exec function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants