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

Eval Status: Return repository UUID, populate entity info #2741

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

puerco
Copy link
Contributor

@puerco puerco commented Mar 21, 2024

Summary

This change modifies the evaluation status response to return the repository UUID instead of the slug. It also populates the entity info map with the repository details.

/cc @jhrozek

Fixes #(related issue)

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 March 21, 2024 11:51
@coveralls
Copy link

coveralls commented Mar 21, 2024

Coverage Status

coverage: 46.928% (-0.04%) from 46.963%
when pulling 6378711 on puerco:repo-id
into e6bedd7 on stacklok:main.

JAORMX
JAORMX previously approved these changes Mar 21, 2024
@puerco
Copy link
Contributor Author

puerco commented Mar 21, 2024

Note that this will return the UUID of the repo in the EntityTypedId breaking with the previous mock response:

https://github.com/stacklok/minder/blob/a7680de79d70446fd2248248fdcea8889d32e939/internal/controlplane/handlers_evalstatus.go#L50-L53

@@ -278,6 +278,14 @@ func buildRuleEvaluationStatusFromDBEvaluation(
Msg("error converting severity will use defaults")
}

entityInfo := map[string]string{}
if eval.Entity == db.EntitiesPullRequest {
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this supposed to be db.EntitiesPullRequest or repository?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesome catch, fixed.

@puerco puerco merged commit 2eb9019 into mindersec:main Mar 21, 2024
20 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