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

Drop internal trusty REST code in favor of client from trusty-sdk #3523

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

puerco
Copy link
Contributor

@puerco puerco commented Jun 5, 2024

Summary

This commit modifies the trusty evaluator to use the API client from
stacklok/trusty-sdk-go isntead of the in tree pacakge which is now
removed.

DO NOT MERGE: For review purposes, this is pulling the trusty-sdk @ HEAD, once stacklok/trusty-sdk-go#14 merges, I'll cut a new release and repush to pull on the tag.

Signed-off-by: Adolfo García Veytia (Puerco) [email protected]

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

@puerco puerco requested a review from a team as a code owner June 5, 2024 00:58
Copy link
Contributor

@stacklokbot stacklokbot left a comment

Choose a reason for hiding this comment

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

Dependency Information

Minder analyzed the dependencies introduced in this pull request and detected that some dependencies do not meet your security profile.

📦 Dependency: github.com/stacklok/trusty-sdk-go

Trusty Score: 3.7

Scoring details
Component Score
User activity 5.7
Repository activity 1.7
From activity
Package activity 3.7
Provenance 10
Malicious false
Proof of Origin (Provenance)

This package can be linked back to its source code using a historical provenance map.

We were able to correlate a significant number of git tags and tagged releases in this package’s source code to versions of the published package. This mapping creates a strong link from the package back to its source code repository, verifying proof of origin.

Published package versions 1
Number of git tags or releases 1
Versions matched to tags or releases 1

@puerco puerco changed the title Minder sdk Drop internal trusty REST code in favor of client from trusty-sdk Jun 5, 2024
Comment on lines +101 to +110
// createOrUpdateEvalStatus takes care of recording the rule evaluation results.
// This function inserts into the database:
//
// - The rule evaluation parameters (profile, repo, artifact, entity, etc).
// - The rule evaluation status and details.
// - The remediation status and details.
// - The alert status and details.
//
// If the error in the evaluation status resolves to an errors.ErrEvaluationSkipSilently,
// no details are stored or logged.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just noticed I pulled an unchecked check from another branch I was working on.. I'll leave it in the PR, it is only expanding the function documentation elsewhere.

@coveralls
Copy link

Coverage Status

coverage: 52.8% (+0.1%) from 52.676%
when pulling 1ea0d35 on puerco:minder-sdk
into 54d663d on stacklok:main.

@coveralls
Copy link

Coverage Status

coverage: 52.795% (+0.1%) from 52.676%
when pulling b5432e7 on puerco:minder-sdk
into 54d663d on stacklok:main.

dmjb
dmjb previously approved these changes Jun 5, 2024
@rdimitrov rdimitrov marked this pull request as draft June 5, 2024 10:18
@rdimitrov
Copy link
Member

@dmjb - I've noticed you approved it, but @puerco mentions he wants to release the sdk before merging so I've converted this to draft until it's ready 👍

@coveralls
Copy link

Coverage Status

coverage: 53.251% (+0.1%) from 53.148%
when pulling 250ef40 on puerco:minder-sdk
into a21f1dd on stacklok:main.

@puerco
Copy link
Contributor Author

puerco commented Jun 6, 2024

OK, the trusty sdk has a new release. This should be ready.

@puerco puerco marked this pull request as ready for review June 6, 2024 13:56
@jhrozek
Copy link
Contributor

jhrozek commented Jun 12, 2024

@puerco the code looks good, but because we took our sweet time reviewing, there are now some conflicts in go.mod and sum. If you rebase, I'll approve right away. Sorry for the delays.

puerco added 2 commits June 13, 2024 12:54
This commit modifies the trusty evaluator to use the API client from
stacklok/trusty-sdk-go isntead of the in tree pacakge which is now
removed.

Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
@coveralls
Copy link

Coverage Status

coverage: 53.367% (+0.1%) from 53.269%
when pulling 4d1a119 on puerco:minder-sdk
into 958e546 on stacklok:main.

@rdimitrov rdimitrov merged commit 6ddc76e into mindersec:main Jun 13, 2024
21 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.

6 participants