feat: skip oversized versions during sync instead of failing the entire task#1022
feat: skip oversized versions during sync instead of failing the entire task#1022
Conversation
…nfigurable threshold Agent-Logs-Url: https://github.com/cnpm/cnpmcore/sessions/61e18140-29bb-4d4e-bb57-56584e133159 Co-authored-by: fengmk2 <[email protected]>
Agent-Logs-Url: https://github.com/cnpm/cnpmcore/sessions/61e18140-29bb-4d4e-bb57-56584e133159 Co-authored-by: fengmk2 <[email protected]>
|
@codex review |
Agent-Logs-Url: https://github.com/cnpm/cnpmcore/sessions/26b13fce-9e26-4656-9f39-9efdc8ed32fc Co-authored-by: fengmk2 <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR improves package sync resilience by skipping oversized package versions (up to a configurable threshold) rather than failing the entire sync task, preventing a single large version from permanently blocking other versions from syncing.
Changes:
- Add
cnpmcore.largePackageVersionBlockThresholdconfig (default3) to tolerate a limited number of oversized versions. - Update
PackageSyncerServiceto skip oversized versions under the threshold and fail only once the threshold is exceeded. - Extend/update sync tests to cover “skip under threshold” and “fail when exceeding threshold” for both sync code paths.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
app/core/service/PackageSyncerService.ts |
Track oversized-version count; skip oversized versions up to threshold and fail when exceeded (applied to both sync flows). |
app/port/config.ts |
Document and type the new largePackageVersionBlockThreshold configuration option. |
config/config.default.ts |
Provide default threshold value (3). |
test/core/service/PackageSyncerService/executeTask.test.ts |
Update/add tests for skipping oversized versions under threshold and failing when exceeding threshold. |
test/core/service/PackageSyncerService/executeTaskWithPackument.test.ts |
Mirror test updates for the packument-enabled sync flow. |
Fixed in e9975ee — the two test files needed |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1022 +/- ##
==========================================
+ Coverage 94.11% 94.12% +0.01%
==========================================
Files 211 211
Lines 8603 8619 +16
Branches 1699 1701 +2
==========================================
+ Hits 8097 8113 +16
Misses 506 506 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
[skip ci] ## 4.31.0 (2026-04-02) * feat: skip oversized versions during sync instead of failing the entire task (#1022) ([b17983e](b17983e)), closes [#1022](#1022) * chore(deps): update codecov/codecov-action action to v6 (#1017) ([68dfba6](68dfba6)), closes [#1017](#1017) * chore(deps): update dependency oxfmt to ^0.43.0 (#1020) ([a833241](a833241)), closes [#1020](#1020) * chore(deps): update dependency oxlint-tsgolint to ^0.19.0 (#1011) ([7d1a6b9](7d1a6b9)), closes [#1011](#1011) * chore(deps): update dependency typescript to v6 (#1015) ([50b74b3](50b74b3)), closes [#1015](#1015)
|
🎉 This PR is included in version 4.31.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
largePackageVersionBlockThreshold(default 3) inapp/port/config.tsandconfig/config.default.tsexecuteTaskinPackageSyncerService.tsto skip oversized versions (with counter) instead of failing immediatelyexecuteTaskWithPackumentinPackageSyncerService.tswith the same logic