-
Notifications
You must be signed in to change notification settings - Fork 11
Fix dist missing issue for npm package installing #151
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
Conversation
Pull Request Test Coverage Report for Build 2081376736
💛 - Coveralls |
ligangty
left a comment
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.
Something needs to change as comments. And I'd suggest to add a unit test to verify this case.
charon/constants.py
Outdated
| MANIFEST_SUFFIX = ".txt" | ||
| DEFAULT_ERRORS_LOG = "errors.log" | ||
|
|
||
| NRRC_REGISTRY = "npm.registry.redhat.com" |
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.
I think we should leave this out as a configuration item below each "target", as it is not same in different environments. We can set this as DEFAULT_NRRC_REGISTRY with a default value(for example "localhost" ) if it is not specified in configuration,
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.
@ligangty If for multi targets uploading, and configuring different registries with the targets, it has to handle the different metadata content-generating for different target/env, I want to confirm there will be any such case we will encounter in prod/stage?
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.
Yes there will be such case. We will not prevent user to upload one tarball to both prod/stage in one time.
charon/utils/archive.py
Outdated
|
|
||
|
|
||
| def __parse_npm_package_version_paths(path: str) -> list: | ||
| def _del_none(d): |
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.
I remember there is a same func in npm.py, if so, please remove it and reuse this one.
charon/utils/archive.py
Outdated
| shasum = digest(path, HashType.SHA1) | ||
| dist = dict() | ||
| dist["tarball"] = tarball_link | ||
| dist["shasum"] = shasum |
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 is also a "integrity" item in this dist section, which has "sha512-xxxxxx" value.
* Add registry in target bucket configuration * Different registries dist-tarball gen for multi-targets * Tarball integrity computing for dist support * Add unit testings for dist gen computing against s3
ligangty
left a comment
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.
Generally looks good except a small performance point.
charon/pkgs/npm.py
Outdated
| valid_dirs = __get_path_tree(valid_paths, target_dir) | ||
|
|
||
| # main_target = targets[0] | ||
| client = S3Client(aws_profile=aws_profile, dry_run=dry_run) |
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.
To save performance, we don't need to initiate this client multi times for different targets.
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.
@ligangty, fixed, thanks!
ligangty
left a comment
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.
LGTM
No description provided.