-
Notifications
You must be signed in to change notification settings - Fork 35
feat: migrate patch command to @socketsecurity/[email protected] #1042
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
Merged
Conversation
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment @cursor review or bugbot run to trigger another review on this PR
ba8a337 to
aee59b7
Compare
453e76a to
174fe73
Compare
174fe73 to
92f1cca
Compare
- Replace 'info' test (removed command) with 'scan' (renamed from discover) - Replace 'discover' test with 'scan' (renamed) - Replace 'download' test with 'get' (download is alias) - Replace 'cleanup' test with 'repair' (renamed) - Replace 'rm' test with 'remove' (renamed) These changes align tests with socket-patch v1.2.0 command structure.
…te limiting" This reverts commit 92f1cca.
…ate limiting" This reverts commit 7fb6023.
Resolved conflict in CHANGELOG.md by keeping all changes: - Changed: Updated to @socketsecurity/[email protected] - Changed: Updated Coana CLI to v14.12.148 - Fixed: Heap overflow prevention in large monorepo scans
Version getters should fail if environment variables aren't set, even in test mode, because values should be properly defined in external-tools.json.
Removed tests for commands not in socket-patch v1.2.0: - cleanup (obsolete, repair is the actual command) - discover (obsolete, scan is the actual command) - info (obsolete, merged into get command) - download (obsolete, alias of get command) Renamed: - cmd-patch-rm.test.mts → cmd-patch-remove.test.mts socket-patch v1.2.0 actual commands: get, apply, rollback, remove, list, scan, setup, repair
Added INLINED_SOCKET_CLI_COANA_VERSION, INLINED_SOCKET_CLI_SFW_VERSION, and INLINED_SOCKET_CLI_SOCKET_PATCH_VERSION to .env.test so unit tests can access these values without going through the build process.
0d338b4 to
85db681
Compare
…e duplicates - Replace manual file extension checks with detectExecutableType() for binary vs package detection - Use detectExecutableType in spawnCoanaDlx, spawnCdxgenDlx, spawnSfwDlx, and spawnSocketPatchDlx - Remove duplicate binary.mts (now in @socketsecurity/lib/dlx/binary) - Remove duplicate detection.mts (now in @socketsecurity/lib/shadow and temporary-executor) - Update imports to use @socketsecurity/lib versions - Remove spawnNode usage in favor of direct spawn calls - Remove dynamic spawn import - Update test mocks to reference @socketsecurity/lib paths This eliminates ~900 lines of duplicate code and provides more robust detection using package.json, file extensions, and executable permissions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Migrate patch command to use external [email protected] package.
Note
Shifts patch functionality to the external Socket Patch CLI and wires up version/env plumbing.
socket patchnow forwards all args to@socketsecurity/[email protected]viaspawnSocketPatch(DLX or local override)socket-patchtoexternal-tools.jsonand inlined build metadataINLINED_SOCKET_CLI_SOCKET_PATCH_VERSIONgetSocketPatchVersion,SOCKET_CLI_SOCKET_PATCH_LOCAL_PATH; exports integrated inconstants/env.mtsutils/socket-patch/spawn.mtspasses org slug, API token, and proxy to the external CLIWritten by Cursor Bugbot for commit 69011b8. Configure here.