Repository navigation
fix: make npm deprecation reruns idempotent - #694
Conversation
|
This PR changes mirrored Maestro source files in the public repo, but it does not link the matching private source-of-truth PR. Add one of these to the PR body, then re-run the check:
Mirrored files touched:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9847ef80d1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (Array.isArray(value)) { | ||
| return value.some(hasDeprecationValue); | ||
| } |
There was a problem hiding this comment.
Require every matched version to be deprecated
For range targets such as the workflow default >=0.10.8 <=0.10.20, npm view <pkg>@<range> deprecated --json can return one value per matching version (npm docs: ranges matching multiple versions produce a value for each version), but this helper accepts the rerun as successful if any array/object entry has a deprecation message. If npm deprecate returns E422 because only one version in the range was already deprecated while later versions are still missing the field, this exits 0 and the workflow can leave part of the bad release range visible as supported. The verification should ensure all matched versions have a non-empty deprecation value, not just some of them.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e9b50e8b1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const result = await runNpmCommand(npmCommand, npmArgs); | ||
| if (result.status !== 0) { | ||
| const output = `${result.stdout}\n${result.stderr}`; | ||
| if (output.includes("E422") && (await verifyDeprecation(npmCommand, spec))) { |
There was a problem hiding this comment.
Capture E422 output before checking it
When this script is rerun from an interactive terminal, runNpmCommand takes the stdio: "inherit" branch, so result.stdout and result.stderr are empty even though npm printed E422. In that context this check never calls verifyDeprecation, and an already-deprecated target still exits 1, which leaves the new idempotent rerun path working in CI but not for the local/OTP workflow the script supports.
Useful? React with 👍 / 👎.
Summary
Internal PR
Verification