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

Fix fixpath for controls C-0077 and C-0076 #523

Merged
merged 9 commits into from
Oct 12, 2023
Merged

Conversation

YiscahLevySilas1
Copy link
Collaborator

@YiscahLevySilas1 YiscahLevySilas1 commented Oct 12, 2023

PR Type:

Bug fix


PR Description:

This PR addresses an issue with the path formatting in the label usage rules. The changes involve updating the path strings in the Rego rules and the corresponding test files to use square brackets for accessing label keys, which is the correct syntax for accessing map elements in Rego. The changes are made in two rule files and their corresponding test files.


PR Main Files Walkthrough:

files:

rules/k8s-common-labels-usage/raw.rego: Updated the path strings in the Rego rules to use square brackets for accessing label keys.
rules/k8s-common-labels-usage/test/cronjob/expected.json: Updated the expected path strings in the test file to reflect the changes made in the corresponding Rego rule.
rules/k8s-common-labels-usage/test/pod/expected.json: Updated the expected path strings in the test file to reflect the changes made in the corresponding Rego rule.
rules/k8s-common-labels-usage/test/workload-fail/expected.json: Updated the expected path strings in the test file to reflect the changes made in the corresponding Rego rule.
rules/label-usage-for-resources/raw.rego: Updated the path strings in the Rego rules to use square brackets for accessing label keys.
rules/label-usage-for-resources/test/cronjob/expected.json: Updated the expected path strings in the test file to reflect the changes made in the corresponding Rego rule.
rules/label-usage-for-resources/test/workload-fail/expected.json: Updated the expected path strings in the test file to reflect the changes made in the corresponding Rego rule.


User Description:

Overview

YiscahLevySilas1 and others added 7 commits October 9, 2023 16:32
Signed-off-by: YiscahLevySilas1 <[email protected]>
…85-fix-control-C-0262

Signed-off-by: YiscahLevySilas1 <[email protected]>
Signed-off-by: YiscahLevySilas1 <[email protected]>
…golibrary into SUB-2185-fix-control-C-0262

Signed-off-by: YiscahLevySilas1 <[email protected]>
…85-fix-control-C-0262

Signed-off-by: YiscahLevySilas1 <[email protected]>
Signed-off-by: YiscahLevySilas1 <[email protected]>
@codiumai-pr-agent-free
Copy link
Contributor

PR Analysis

  • 🎯 Main theme: Fixing path formatting in label usage rules
  • 📝 PR summary: This PR addresses an issue with the path formatting in the label usage rules. The changes involve updating the path strings in the Rego rules and the corresponding test files to use square brackets for accessing label keys, which is the correct syntax for accessing map elements in Rego.
  • 📌 Type of PR: Bug fix
  • 🧪 Relevant tests added: Yes
  • ⏱️ Estimated effort to review [1-5]: 2, because the changes are straightforward and involve only the modification of path strings in the Rego rules and the corresponding test files.
  • 🔒 Security concerns: No security concerns found

PR Feedback

  • 💡 General suggestions: The changes made in this PR seem to be correct and necessary for the proper functioning of the label usage rules. The use of square brackets for accessing label keys is indeed the correct syntax for accessing map elements in Rego. The corresponding changes in the test files are also appropriate.

  • 🤖 Code feedback:

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 [--extended]: Suggest improvements to the code in the PR. Extended mode employs several calls, and provides a more thorough feedback.
/ask <QUESTION>: Pose a question about the PR.
/update_changelog: Update the changelog based on the PR's contents.

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.

itsmeital
itsmeital previously approved these changes Oct 12, 2023
Signed-off-by: YiscahLevySilas1 <[email protected]>
itsmeital
itsmeital previously approved these changes Oct 12, 2023
Signed-off-by: YiscahLevySilas1 <[email protected]>
@github-actions
Copy link
Contributor

Summary:

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

@YiscahLevySilas1 YiscahLevySilas1 merged commit e07de44 into master Oct 12, 2023
26 checks passed
@YiscahLevySilas1 YiscahLevySilas1 deleted the fix-fixpath branch February 11, 2024 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants