-
Notifications
You must be signed in to change notification settings - Fork 30
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
SONARIAC-1892 Modify rule S6975: Fix how to fix it section split #4604
base: master
Are you sure you want to change the base?
Conversation
Quality Gate passed for 'rspec-tools'Issues Measures |
Quality Gate passed for 'rspec-frontend'Issues Measures |
=== Code examples | ||
|
||
==== Compliant solution |
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.
I think these missing titles is why the content is not displayed on the Sonar rules website (but is still somehow display everywhere else, the parsing logic must be different)
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 will be good to document in our Xtranet how to write rules. Especially, how it should be defined for IaC technologies that have 2 formats(json/bicep, json/yaml, yaml/properties).
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.
LGTM
@@ -0,0 +1,53 @@ | |||
== How to fix it in ARM Templates |
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.
I'm not sure if arm.json is a good name for the file as ARM is a name of technology. The suprorted languages are Bicep and JSON, so IMO the files should be rename to json.adoc
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.
Indeed! I followed the convention we were already using, I will update every other file then.
Should I also update the header? In Microsoft's documentation, ARM templates seem to imply that it's JSON, and Bicep is not defined as an ARM template, but the line seems blurry. I'd rename it "How to fix it in JSON Templates" (without mentioning ARM to keep it shorter; ARM is already implied by the rule language) and keep "How to fix it in Bicep."
What do you think?
access: 'Allow' | ||
protocol: '*' | ||
destinationPortRange: '*' | ||
sourceAddressPrefix: '*' |
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.
Consider adding Noncompliant
comment.
See: https://github.com/SonarSource/rspec/blob/444c23805989cba3ebdd79d578388f8f6626f596/docs/description.adoc
noncompliant lines should always be highlighted with the corresponding comment “// Noncompliant” optionally followed by some explanation) if that is clearer
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 kinda hard to add Noncompliant
comments to both code examples you mentioned because it's actually a combination of multiple lines that makes it non-compliant. I'll look into it, see what's possible and how we're dealing with similar situations to be consistent 😉
properties: { | ||
permissions: [ | ||
{ | ||
actions: ['*'] |
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.
Consider adding Noncompliant comment
=== Code examples | ||
|
||
==== Compliant solution |
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 will be good to document in our Xtranet how to write rules. Especially, how it should be defined for IaC technologies that have 2 formats(json/bicep, json/yaml, yaml/properties).
Review
A dedicated reviewer checked the rule description successfully for: