socket fix: remove obsolete overrides and pins it previously wrote
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 15/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp, java, typescript
- Lĩnh vực
- build-system, cli, security
Hướng nghiên cứu
This is a design request, not a bug fix. Start by finding the socket fix command entry point in this repository and how it hands changes to the bundled Coana CLI, which is not in the repo. Confirm whether any cleanup of previously written constraints exists. Done means a maintainer-agreed design for ownership tracking, removal criteria and a dry-run report, not a patch.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
socket fix can force a safe version of a transitive dependency by writing an override or equivalent constraint, using each ecosystem's mechanism (see "Supported Ecosystems" in https://docs.socket.dev/docs/socket-fix): for example dependencyManagement in Maven, PackageVersion or PackageReference with NuGet Central Package Management, or overrides/resolutions in JavaScript package managers.
Once a parent dependency is upgraded and the normal graph selects a safe version on its own, the constraint is no longer needed, but it stays in the project and must be found and removed manually. This request is for socket fix to remove the constraints it previously wrote when they are no longer necessary.
Problem
Obsolete pins add noise to manifests and hide the versions the graph would normally select. They can also cause hidden regressions:
- Maven: a
dependencyManagemententry overrides the version chosen through the parent, so after a parent upgrade the build can keep resolving the lower pinned version without warning. - NuGet CPM: a stale transitive pin lower than what an upgraded parent requires fails restore with NU1109 (package downgrade detected), and the pin must be found by hand.
JavaScript overrides are opt-in via --allow-overrides, but Maven and NuGet constraints are written as part of the normal fix, so they accumulate with no comparable opt-in.
Current behavior
Socket CLI 1.12.1 has no documented way to find and remove obsolete constraints, and I found no such logic in this repository. Changes are delegated to the bundled Coana CLI 15.13.3, which is not in the repo, so I cannot claim internal cleanup does not exist. Users have no explicit way to request, preview or verify it.
The only alternative is a separate process around socket fix (record each pin, remove it temporarily, re-resolve, rescan, restore if needed), which duplicates work the fix engine already does and is fragile on multi-project solutions.
Requested behavior
An explicit, documented, opt-in capability (for example --prune-overrides) that:
- identifies constraints previously written by Socket;
- re-resolves without each one, with the project's own tooling;
- removes it if no longer necessary, otherwise keeps or restores it;
- keeps lockfiles consistent;
- reports what was removed, kept, skipped or not evaluable, with a reason (
still-required,modified-by-user,resolution-upgraded,could-not-evaluate).
--no-apply-fixes, --json and --output-file could be reused for a dry-run report.
Ownership: only remove constraints Socket can reliably identify as its own, which implies keeping some provenance (a marker comment, a ledger, etc.; the mechanism is up to you). User-managed or user-modified constraints are never touched, at most reported as cleanup candidates.
Removal criteria: remove only if resolution without the constraint succeeds in every affected project or module, the package is gone from the graph or its resolved version is not a downgrade (per the ecosystem's version semantics), and no new known advisory is introduced. A removal that changes the resolved version (for example a stale pin masking a newer parent-selected version) must be reported explicitly, and could sit behind a separate option.
Edge cases: a Directory.Packages.props shared by many projects (related to #1674), a PackageReference added by Socket, and a parent POM dependencyManagement entry inherited by several modules must all be checked across every consumer before removal.
Scope
General socket fix capability, not tied to one package manager. Maven and NuGet CPM are my use cases.
Environment
Written against this version combination:
| Component | Version |
|---|---|
| Socket CLI | 1.12.1 |
| Coana CLI (bundled) | 15.13.3 |
- Ngôn ngữ chính
- TypeScript
- Star
- 335
- Fork
- 74
- Merge trung bình
- 1 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 91
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SocketDev/socket-cli
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
SocketDev/socket-cli#1655 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SocketDev/socket-cli#1160 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
SocketDev/socket-cli#1691 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 38/100
SocketDev/socket-cli#1690 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
SocketDev/socket-cli#1689 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của SocketDev/socket-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Broken links in the docsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
🔊 a11y
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
betagouv/mon-entreprise#4726 ·
Maintainer thường phản hồi trong vòng 9 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Deltares/fews-pi-requests#357 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug confirmed js v6
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày