-
Notifications
You must be signed in to change notification settings - Fork 14
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
GH-33, add fix_version_dependant #39
Conversation
@@ -19,6 +19,8 @@ type PolicyRuleCriteria struct { | |||
// Security Criteria | |||
MinimumSeverity string `json:"min_severity,omitempty"` // Omitempty is used because the empty field is conflicting with CVSSRange | |||
CVSSRange *PolicyCVSSRange `json:"cvss_range,omitempty"` | |||
// Omitempty is used in FixVersionDependant because an empty field throws an error in Xray below 3.44.3 | |||
FixVersionDependant bool `json:"fix_version_dependant,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code alignment? make fmt
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's broken by the comment, have to fix it manually. make fmt
doesn't capture thing like this, unfortunately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because the comment line is not at the end of the code line.
docs/resources/security_policy.md
Outdated
@@ -119,6 +120,7 @@ Optional: | |||
Optional: | |||
|
|||
- **cvss_range** (Block List, Max: 1) Nested block describing a CVS score range to be impacted. Defined below. (see [below for nested schema](#nestedblock--rule--criteria--cvss_range)) | |||
- **fix_version_dependant** (Boolean) Issues that do not have a fixed version are not generated until a fixed version is available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include default value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-generated. Do we add default values in this case? i don't like the idea to fix manually whatever was generated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we will generate docs the next time, the manual change will be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment below. Add default value to attribute's description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to the description
Type: schema.TypeBool, | ||
Optional: true, | ||
Default: false, | ||
Description: "Issues that do not have a fixed version are not generated until a fixed version is available.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include default value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? There is a default value, but auto-generation didn't pick it up for some reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Artifactory provider, we include the default value as part of the description. The auto-gen plugin will copy that description to the doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
@@ -31,6 +31,7 @@ resource "xray_security_policy" "security1" { | |||
|
|||
criteria { | |||
min_severity = "High" | |||
fix_version_dependant = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HCL alignment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed all HCL formatting in the project, will be in the next commit
@@ -9,6 +9,7 @@ resource "xray_security_policy" "min_severity" { | |||
|
|||
criteria { | |||
min_severity = "High" | |||
fix_version_dependant = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HCL alignment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, fixed
@@ -24,6 +24,7 @@ resource "xray_security_policy" "min_severity" { | |||
|
|||
criteria { | |||
min_severity = "High" | |||
fix_version_dependant = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HCL alignment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, this one is generated from examples/resources/xray_security_policy/resource.tf
HCL formatting is fixed, go formatting is fixed manually. And I don't like the idea of changing an auto-generated document by adding the default value. Thoughts, @alexhung |
Add default value in the description
…ps://github.com/jfrog/terraform-provider-xray into GH-39-update-watch-project-filter-documentation
…ocumentation Update documentation for Ant pattern filter
Adding new field to Security Policy
The field is not backward compatible with previous Xray versions, so I've added omitempty.
Default value is false in the UI.
Added test and documentation updates.