Skip to content

feat: skip oversized versions during sync instead of failing the entire task#1022

Merged
elrrrrrrr merged 4 commits intomasterfrom
copilot/adjust-version-limits
Apr 2, 2026
Merged

feat: skip oversized versions during sync instead of failing the entire task#1022
elrrrrrrr merged 4 commits intomasterfrom
copilot/adjust-version-limits

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

  • Understand the issue: a single oversized version blocks the entire sync task
  • Add new config option largePackageVersionBlockThreshold (default 3) in app/port/config.ts and config/config.default.ts
  • Modify executeTask in PackageSyncerService.ts to skip oversized versions (with counter) instead of failing immediately
  • Modify executeTaskWithPackument in PackageSyncerService.ts with the same logic
  • Update existing tests to reflect the new skip behavior (1 oversized version should be skipped, not fail)
  • Add new tests for threshold behavior (> threshold oversized versions should still fail)
  • Run lint, typecheck, and relevant tests - all passing
  • Fix CI formatting failure (oxfmt) in test files

@fengmk2 fengmk2 marked this pull request as ready for review April 2, 2026 07:56
Copilot AI review requested due to automatic review settings April 2, 2026 07:56
@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 2, 2026

@codex review

@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.largePackageVersionBlockThreshold config (default 3) to tolerate a limited number of oversized versions.
  • Update PackageSyncerService to 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.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 2, 2026

@copilot ci fails https://github.com/cnpm/cnpmcore/actions/runs/23890289564/job/69661846026?pr=1022

Fixed in e9975ee — the two test files needed oxfmt formatting (multi-line assert.match calls collapsed to single lines).

Copilot AI requested a review from fengmk2 April 2, 2026 08:00
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fengmk2 fengmk2 requested a review from elrrrrrrr April 2, 2026 08:33
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.12%. Comparing base (68dfba6) to head (e9975ee).
⚠️ Report is 2 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@elrrrrrrr elrrrrrrr merged commit b17983e into master Apr 2, 2026
16 checks passed
@elrrrrrrr elrrrrrrr deleted the copilot/adjust-version-limits branch April 2, 2026 14:49
fengmk2 pushed a commit that referenced this pull request Apr 2, 2026
[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)
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

🎉 This PR is included in version 4.31.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants