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 #143

Merged
merged 9 commits into from
Aug 17, 2023
Merged

Store summary cr objects #143

merged 9 commits into from
Aug 17, 2023

Conversation

rcohencyberarmor
Copy link
Contributor

Overview

rcohencyberarmor added 9 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>
Signed-off-by: rcohencyberarmor <rcohen@armosec.io>
@rcohencyberarmor rcohencyberarmor added the release Create release label Aug 17, 2023
@codiumai-pr-agent-free
Copy link

PR Analysis

  • 🎯 Main theme: Storing summary CR objects
  • 📌 Type of PR: Enhancement
  • 🧪 Relevant tests added: True
  • Focused PR: Yes, the PR is focused on enhancing the way summary CR objects are 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 relevant tests. However, it would be beneficial to add more comments in the code to explain the logic and any assumptions made, especially in complex or critical sections.

  • 🤖 Code feedback:

    • relevant file: repositories/apiserver.go
      suggestion: It's recommended to handle errors as soon as possible. In the function GetCVESummaryK8sResourceName, consider handling the error right after the fmt.Sprintf function. This will make the code more robust and easier to debug. [important]
      relevant line: return fmt.Sprintf(vulnSummaryContNameFormat, kind, name, contName), nil

    • relevant file: repositories/apiserver_test.go
      suggestion: It's good practice to use table-driven tests in Go for testing multiple scenarios. However, the test cases seem to be repetitive with the same expected result. Consider diversifying the test cases to cover more scenarios and edge cases. [medium]
      relevant line: expRes: "Deployment-nginx-nginx",

    • relevant file: repositories/apiserver.go
      suggestion: The constant vulnSummaryContNameFormat is defined but not commented. It's a good practice to comment on public constants and variables to explain their purpose and any specific format they follow. [medium]
      relevant line: vulnSummaryContNameFormat string = "%s-%s-%s" // "--"

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 3b2e952 into main Aug 17, 2023
6 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>

* trigger create image

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
release Create release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants