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

Store summary cr objects #142

Merged
merged 8 commits into from
Aug 17, 2023
Merged

Store summary cr objects #142

merged 8 commits into from
Aug 17, 2023

Conversation

rcohencyberarmor
Copy link
Contributor

Overview

rcohencyberarmor added 8 commits August 16, 2023 14:37
Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
…ry-CR-objects

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
…ry-CR-objects

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
@codiumai-pr-agent
Copy link

PR Analysis

  • 🎯 Main theme: Storing summary CR objects and changing the way resource names are generated
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: True
  • Focused PR: Yes, the PR is focused on changing how resource names are generated and stored.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • General suggestions: The PR seems to be well-structured and focused on a specific enhancement. It's good to see that the changes are accompanied by corresponding updates in the test cases. However, it would be beneficial to include more context or explanation in the PR description about why these changes are necessary and how they improve the system.

  • 🤖 Code feedback:

    • relevant file: repositories/apiserver.go
      suggestion: Consider handling the error returned by fmt.Sprintf in the GetCVESummaryK8sResourceName function. While fmt.Sprintf doesn't usually return an error, it's a good practice to handle errors for all functions that return one. [medium]
      relevant line: return fmt.Sprintf(vulnSummaryContNameFormat, kind, name, contName), nil

    • relevant file: repositories/apiserver_test.go
      suggestion: It would be beneficial to add more diverse test cases to ensure the GetCVESummaryK8sResourceName function works as expected in various scenarios. Currently, all test cases have the same expected result, which might not cover all possible use cases. [medium]
      relevant line: expRes: "Deployment-nginx-nginx",

How to use

To invoke the PR-Agent, add a comment using one of the following commands:
/review [-i]: Request a review of your Pull Request. For an incremental review, which only considers changes since the last review, include the '-i' option.
/describe: Modify the PR title and description based on the contents of the PR.
/improve: Suggest improvements to the code in the PR.
/ask <QUESTION>: Pose a question about the PR.

To edit any configuration parameter from 'configuration.toml', add --config_path=new_value
For example: /review --pr_reviewer.extra_instructions="focus on the file: ..."
To list the possible configuration parameters, use the /config command.

@github-actions
Copy link

Summary:

  • License scan: failure
  • Credentials scan: success
  • Vulnerabilities scan: failure
  • Unit test: success
  • Go linting: success

@rcohencyberarmor rcohencyberarmor merged commit defa739 into main Aug 17, 2023
6 of 7 checks passed
dwertent pushed a commit that referenced this pull request Dec 31, 2023
* store workload name in the summary object

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* change error

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* get name from instance id

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* should return err

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* add to test desired input

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

* change the summary object name

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>

---------

Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
Co-authored-by: rcohencyberarmor <rcohen@armosec.io>
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.

None yet

2 participants