Skip to content

Conversation

@yma955
Copy link
Member

@yma955 yma955 commented Mar 31, 2022

No description provided.

@yma955 yma955 requested review from jdcasey and ligangty March 31, 2022 23:39
@coveralls
Copy link

coveralls commented Mar 31, 2022

Pull Request Test Coverage Report for Build 2081376736

  • 58 of 64 (90.63%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 78.322%

Changes Missing Coverage Covered Lines Changed/Added Lines %
charon/cmd/command.py 1 3 33.33%
charon/config.py 10 12 83.33%
charon/pkgs/npm.py 17 19 89.47%
Totals Coverage Status
Change from base Build 1979011723: 0.2%
Covered Lines: 1503
Relevant Lines: 1919

💛 - Coveralls

Copy link
Member

@ligangty ligangty left a 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.

MANIFEST_SUFFIX = ".txt"
DEFAULT_ERRORS_LOG = "errors.log"

NRRC_REGISTRY = "npm.registry.redhat.com"
Copy link
Member

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,

Copy link
Member Author

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?

Copy link
Member

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.



def __parse_npm_package_version_paths(path: str) -> list:
def _del_none(d):
Copy link
Member

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.

shasum = digest(path, HashType.SHA1)
dist = dict()
dist["tarball"] = tarball_link
dist["shasum"] = shasum
Copy link
Member

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
Copy link
Member

@ligangty ligangty left a 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.

valid_dirs = __get_path_tree(valid_paths, target_dir)

# main_target = targets[0]
client = S3Client(aws_profile=aws_profile, dry_run=dry_run)
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ligangty, fixed, thanks!

Copy link
Member

@ligangty ligangty left a comment

Choose a reason for hiding this comment

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

LGTM

@yma955 yma955 merged commit 5945ce8 into Commonjava:main Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants