-
Notifications
You must be signed in to change notification settings - Fork 84
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
fix: rc version should match *
version
#692
Conversation
WalkthroughThe recent updates involve enhancing the Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant Client
participant PackageVersionFileController
participant PackageVersionFileService
participant PackageRegistry
Client->>PackageVersionFileController: Request for package files
PackageVersionFileController->>PackageVersionFileService: Check package version
PackageVersionFileService->>PackageRegistry: Fetch package configuration
PackageRegistry-->>PackageVersionFileService: Return package configuration
PackageVersionFileService-->>PackageVersionFileController: Return version check result
PackageVersionFileController-->>Client: Respond with package files or error
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Outside diff range and nitpick comments (5)
app/core/service/PackageVersionFileService.ts (3)
Line range hint
97-98
: Specify a more precise type instead of usingany
.- this.#unpkgWhiteListAllowPackages = manifest.allowPackages ?? {} as any; - this.#unpkgWhiteListAllowScopes = manifest.allowScopes ?? [] as any; + this.#unpkgWhiteListAllowPackages = manifest.allowPackages ?? {} as Record<string, { version: string }>; + this.#unpkgWhiteListAllowScopes = manifest.allowScopes ?? [] as string[];
Line range hint
198-199
: Use template literals for better readability and consistency.- this.logger.warn('[PackageVersionFileService.syncPackageReadme:warn] remove tmpdir: %s, error: %s', - tmpdir, err); + this.logger.warn(`[PackageVersionFileService.syncPackageReadme:warn] remove tmpdir: ${tmpdir}, error: ${err}`);
Line range hint
301-305
: Remove unnecessary else clause to simplify control flow.- } else if (file.toLowerCase() === 'README') { - fallback = i; - } + if (file.toLowerCase() === 'README') { + fallback = i; + }test/port/controller/PackageVersionFileController/listFiles.test.ts (2)
Line range hint
9-9
: Define a specific type forpublisher
to enhance type safety.let publisher: User; // Assuming User is a defined type
Line range hint
10-10
: Define a specific type foradminUser
to enhance type safety.let adminUser: AdminUser; // Assuming AdminUser is a defined type
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- app/core/service/PackageVersionFileService.ts (1 hunks)
- test/port/controller/PackageVersionFileController/listFiles.test.ts (1 hunks)
Additional Context Used
Biome (16)
app/core/service/PackageVersionFileService.ts (14)
49-49: This type annotation is trivially inferred from its initialization.
97-97: Unexpected any. Specify a different type.
98-98: Unexpected any. Specify a different type.
198-199: Template literals are preferred over string concatenation.
301-305: This else clause can be omitted because previous branches break early.
301-302: This expression always returns false, because the string is converted and will never match
17-20: All these imports are only used as types.
20-21: All these imports are only used as types.
21-22: All these imports are only used as types.
22-23: All these imports are only used as types.
24-25: All these imports are only used as types.
25-26: All these imports are only used as types.
26-27: All these imports are only used as types.
27-28: All these imports are only used as types.
test/port/controller/PackageVersionFileController/listFiles.test.ts (2)
9-9: This variable implicitly has the any type.
10-10: This variable implicitly has the any type.
Additional comments not posted (3)
app/core/service/PackageVersionFileService.ts (2)
119-119
: Ensure proper version matching for non-wildcard configurations.
116-116
: Consider adding a more informative error message or a link to documentation.- throw new ForbiddenError(`"${fullname}" is not allow to unpkg files, see ${unpkgWhiteListUrl}`); + throw new ForbiddenError(`"${fullname}" is not allowed to unpkg files. For more information, see ${unpkgWhiteListUrl}`);Likely invalid or redundant comment.
test/port/controller/PackageVersionFileController/listFiles.test.ts (1)
924-1010
: Ensure consistent handling of release candidate versions.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #692 +/- ##
=======================================
Coverage 96.82% 96.82%
=======================================
Files 181 181
Lines 18014 18014
Branches 2345 2340 -5
=======================================
Hits 17442 17442
Misses 572 572 ☔ View full report in Codecov by Sentry. |
学习了 semver 的一个新知识点。 Learned a semver of new things to know. |
*
version*
version
[skip ci] ## [3.61.1](v3.61.0...v3.61.1) (2024-05-30) ### Bug Fixes * rc version should match `*` version ([#692](#692)) ([0b62238](0b62238))
> Update #692, Declare compatibility using + notation 1. 🤖 Ensure version matching by `semver` --------- > 更新 #692 , 兼容版本声明为 `+` 的场景 1. 🤖 统一通过 `semver` 进行版本匹配判断 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for prerelease versions when checking package version compatibility. - **Tests** - Updated test cases to include operations related to a new object `baz` with version `*`. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
closes cnpm/unpkg-white-list#63
Summary by CodeRabbit
*
) versions, ensuring better compatibility and flexibility.