You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Includes product update to be announced in the next stable release notes
What does this PR do?
This PR adds an explicit process.exit to the Typescript CLI to prevent it from hanging when resources are left open. This is more of a workaround then a fix of a bug in a dependency.
Where should the reviewer start?
How should this be manually tested?
snyk test xlsx
Risk assessment (Low | Medium | High)?
Low
What's the product update that needs to be communicated to CLI users?
Fix edge cases where the CLI would failt to exit properly and just hang.
The test case run snyk test xlsx is placed inside a describe.each(userJourneyWorkflows) block. Unlike the surrounding tests (e.g., line 832), this new test does not utilize the project or env variables provided by the loop; it simply runs a global command. Consequently, this test will execute once for every workflow in the array (e.g., Go, Python, Maven), which is redundant and increases CI duration without adding coverage. It should be moved outside the describe.each block.
test('run `snyk test xlsx` on npm package with redirect',async()=>{const{ code }=awaitrunSnykCLI('test xlsx');expect([0,1]).toContain(code);});
In the needle patch, resp.resume() is called to discard the redirect response body. In Node.js, switching a stream to flowing mode with resume() can lead to an unhandled 'error' event if the stream encounters a network failure before completion. If the needle library has already removed its primary listeners for this response instance during the redirect transition, this could cause the CLI process to crash. A safer approach is to attach a no-op error listener: resp.on('error', () => {}).resume();.
+ resp.resume();
📚 Repository Context Analyzed
This review considered 6 relevant code sections from 4 files (average relevance: 0.97)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Submission Checklist
are release-note ready, emphasizing
what was changed, not how.
What does this PR do?
This PR adds an explicit process.exit to the Typescript CLI to prevent it from hanging when resources are left open. This is more of a workaround then a fix of a bug in a dependency.
Where should the reviewer start?
How should this be manually tested?
Risk assessment (Low | Medium | High)?
Low
What's the product update that needs to be communicated to CLI users?
Fix edge cases where the CLI would failt to exit properly and just hang.