Skip to content
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

Added trustedSum in checker module #474

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

NishantBansal2003
Copy link
Contributor

1. Does this PR affect any open issues?(Y/N) and add issue references:

re #394

  • N
  • Y

2. What is the scope of this PR (e.g. component or file name):

kcl-lang/kpm/pkg/checker

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

This PR contains an isolated implementation of the checker module to validate KPM third-party dependencies. The changes have not yet been integrated with KPM third-party dependencies; integration will be done in the future once the checker module design is finalised. The PR includes:

  • SumChecker, which validates the dependency checksums in kclPkg.
  • getTrustedSum, which gives the trusted sum of the dependency from OCI manifest
  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

@coveralls
Copy link

coveralls commented Sep 3, 2024

Pull Request Test Coverage Report for Build 10988739521

Details

  • 91 of 118 (77.12%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 42.083%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/checker/checker.go 79 106 74.53%
Totals Coverage Status
Change from base Build 10957376966: 0.4%
Covered Lines: 3524
Relevant Lines: 8374

💛 - Coveralls

@NishantBansal2003
Copy link
Contributor Author

Getting issues with unit tests on Windows while running the script; any help would be appreciated. I will look into it.

@NishantBansal2003
Copy link
Contributor Author

cc: @zong-zhe

@NishantBansal2003
Copy link
Contributor Author

NishantBansal2003 commented Sep 6, 2024

Hey @Peefy, @zong-zhe,
I'm getting stuck on this error when running unit tests on Windows, specifically when executing the script. Is there any way to reproduce and fix this issue locally(in macOS)?
Thanks!

@NishantBansal2003
Copy link
Contributor Author

PTAL
cc: @zong-zhe

@Peefy
Copy link
Contributor

Peefy commented Sep 12, 2024

cc @zong-zhe

pkg/checker/checker.go Outdated Show resolved Hide resolved
pkg/checker/checker.go Show resolved Hide resolved
pkg/checker/checker.go Outdated Show resolved Hide resolved
}

// WithChecker adds a new Checker to DepChecker.
func WithChecker(checker Checker) DepCheckerOption {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is WithCheckers more appropriate ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the intent was to add checkers to DepChecker one by one, I named it WithChecker to emphasise that it includes a single checker at each step. Let me know if you think another name would be more suitable!

Copy link
Contributor

Choose a reason for hiding this comment

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

Try adding a WithCheckers method, one array at a time.

Signed-off-by: Nishant Bansal <nishant.bansal.282003@gmail.com>
Copy link
Contributor

@zong-zhe zong-zhe left a comment

Choose a reason for hiding this comment

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

LGTM

@zong-zhe zong-zhe merged commit 090741f into kcl-lang:main Sep 23, 2024
6 checks passed
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.

4 participants