-
Notifications
You must be signed in to change notification settings - Fork 8
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
Networkpolicy v1beta1 support #86
Conversation
Signed-off-by: David Wertenteil <[email protected]>
Signed-off-by: David Wertenteil <[email protected]>
PR Description updated to latest commit (da3cffa) |
PR Analysis
PR Feedback💡 General suggestions: The PR is well-structured and the changes are logically grouped. The use of conversion functions to handle the transition between v1 and v1beta1 versions is a good approach. However, it would be beneficial to add more comments in the code to explain the logic and the purpose of the conversion functions. 🤖 Code feedback:
✨ Usage guide:Overview:
With a configuration file, use the following template:
See the review usage page for a comprehensive guide on using this tool. |
Signed-off-by: Matthias Bertschy <[email protected]>
Summary:
|
Signed-off-by: Matthias Bertschy <[email protected]>
4d87235
to
cf628ea
Compare
Summary:
|
User description
Sorry, we do not accept changes directly against this repository. Please see
CONTRIBUTING.md for information on where and how to contribute instead.
Type
Enhancement
Description
GenerateNetworkPolicy
function innetworkpolicy.go
to use thev1beta1
version ofNetworkNeighbors
andKnownServer
. The function now converts these objects to theirv1
counterparts, generates the network policy using thev1
objects, and then converts the generated policy back tov1beta1
.convertGeneratedNetworkPolicy
,convertNetworkNeighbors
, andconvertKnownServersList
to handle these conversions.TestGeneratedNetworkPolicyStorage_Get
ingeneratednetworkpolicy_test.go
to reflect the changes in theGeneratedNetworkPolicy
object. TheAPIVersion
has been updated fromspdx.softwarecomposition.kubescape.io/v1beta1
tospdx.softwarecomposition.kubescape.io
.softwarecomposition
andnetworkpolicy
ingeneratednetworkpolicy.go
to reflect the changes in the package structure.Changes walkthrough
networkpolicy.go
pkg/apis/softwarecomposition/v1beta1/networkpolicy/networkpolicy.go
The
GenerateNetworkPolicy
function has been refactored touse the
v1beta1
version ofNetworkNeighbors
andKnownServer
. The function now converts these objects totheir
v1
counterparts, generates the network policy usingthe
v1
objects, and then converts the generated policyback to
v1beta1
. The functionconvertGeneratedNetworkPolicy
,convertNetworkNeighbors
,and
convertKnownServersList
are added to handle theseconversions.
generatednetworkpolicy_test.go
pkg/registry/file/generatednetworkpolicy_test.go
The test
TestGeneratedNetworkPolicyStorage_Get
has beenupdated to reflect the changes in the
GeneratedNetworkPolicy
object. TheAPIVersion
has beenupdated from
spdx.softwarecomposition.kubescape.io/v1beta1
to
spdx.softwarecomposition.kubescape.io
.generatednetworkpolicy.go
pkg/registry/file/generatednetworkpolicy.go
The import paths for
softwarecomposition
andnetworkpolicy
have been updated to reflect the changes inthe package structure.
✨ Usage guide:
Overview:
The
describe
tool scans the PR code changes, and generates a description for the PR - title, type, summary, walkthrough and labels. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.When commenting, to edit configurations related to the describe tool (
pr_description
section), use the following template:With a configuration file, use the following template:
Enabling\disabling automation
meaning the
describe
tool will run automatically on every PR, will keep the original title, and will add the original user description above the generated description.the tool will replace every marker of the form
pr_agent:marker_name
in the PR description with the relevant content, wheremarker_name
is one of the following:type
: the PR type.summary
: the PR summary.walkthrough
: the PR walkthrough.Note that when markers are enabled, if the original PR description does not contain any markers, the tool will not alter the description at all.
Custom labels
The default labels of the
describe
tool are quite generic: [Bug fix
,Tests
,Enhancement
,Documentation
,Other
].If you specify custom labels in the repo's labels page or via configuration file, you can get tailored labels for your use cases.
Examples for custom labels:
Main topic:performance
- pr_agent:The main topic of this PR is performanceNew endpoint
- pr_agent:A new endpoint was added in this PRSQL query
- pr_agent:A new SQL query was added in this PRDockerfile changes
- pr_agent:The PR contains changes in the DockerfileThe list above is eclectic, and aims to give an idea of different possibilities. Define custom labels that are relevant for your repo and use cases.
Note that Labels are not mutually exclusive, so you can add multiple label categories.
Make sure to provide proper title, and a detailed and well-phrased description for each label, so the tool will know when to suggest it.
More PR-Agent commands
See the describe usage page for a comprehensive guide on using this tool.