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.
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: should redirect when nfs adapter support url #522
fix: should redirect when nfs adapter support url #522
Changes from all commits
eddecac
7314f88
7375d74
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
原来这里已经有跳过 db 直接访问 oss 的逻辑,计算 semver 逻辑里一样可以跳过了。
本来还单性可能 oss path 发生变化的情况。
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.
这个改动会导致 registry.npmmirror.com 出现大量 db 查询,我先加一个开关
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.
#527
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.
我补了一个单测
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.
这段代码是一个测试用例,主要负责测试当包版本不存在时的行为。建议在代码审查中注重以下几点:
确认该测试涵盖了所有可能情况
检查是否需要提供更多的上下文或者注释来帮助理解该测试
评估该测试的可读性和可维护性,包括变量和方法命名的清晰度以及代码格式的一致性
确保在修改代码时更新相应的测试用例,并考虑是否需要新增测试用例
在这个具体的代码片段中,测试增加了针对未发布版本的测试,还模拟了 redirectNotFound 和 url 方法。有两个测试用例被添加到测试套件中,一个测试了包版本不存在时的 404 响应,另一个则确保了当指定源注册表时,CNPM 应该将其重定向到该源。
目前代码看起来没有风险和改进的地方。