Skip to content

Commit cc25104

Browse files
authored
update docs with instructions for customizable PR/MR comments (#2197)
* add component on creating custom PR and MR comments * add component to required pages * update supported link types * add screenshot
1 parent df744a1 commit cc25104

File tree

8 files changed

+39
-0
lines changed

8 files changed

+39
-0
lines changed

docs/semgrep-appsec-platform/azure-pr-comments.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ tags:
1010

1111
<!-- vale off -->
1212

13+
import CustomComments from "/src/components/procedure/_customize_pr_mr_comments.mdx"
1314
import DeploymentJourney from "/src/components/concept/_deployment-journey.mdx"
1415
import CommentTriggers from "/src/components/reference/_comment-triggers.mdx"
1516
import PrCommentsInSast from "/src/components/procedure/_pr-comments-in-sast.mdx"
@@ -115,6 +116,10 @@ steps:
115116
116117
<CommentsInSupplyChain />
117118
119+
## Customize PR comments
120+
121+
<CustomComments comment_type="PR" link_type="HTML, Markdown, and plaintext" />
122+
118123
## Next steps
119124
120125
<NextAfterComments />

docs/semgrep-appsec-platform/bitbucket-cloud-pr-comments.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ tags:
1111

1212
<!-- vale off -->
1313

14+
import CustomComments from "/src/components/procedure/_customize_pr_mr_comments.mdx"
1415
import Tabs from '@theme/Tabs';
1516
import TabItem from '@theme/TabItem';
1617
import TroubleshootingPrLinks from "/src/components/reference/_troubleshooting-pr-links.mdx"
@@ -205,6 +206,10 @@ Bitbucket Premium provides [<i class="fas fa-external-link fa-xs"></i> access co
205206
Only rules set to the **Comment** and **Block** rule modes in the [Policies page](https://semgrep.dev/orgs/-/policies) create PR comments.
206207
:::
207208
209+
## Customize PR comments
210+
211+
<CustomComments comment_type="PR" link_type="Markdown and plaintext" />
212+
208213
## Next steps
209214
210215
<NextAfterComments />

docs/semgrep-appsec-platform/bitbucket-data-center-pr-comments.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ tags:
1111

1212
<!-- vale off -->
1313

14+
import CustomComments from "/src/components/procedure/_customize_pr_mr_comments.mdx"
1415
import Tabs from '@theme/Tabs';
1516
import TabItem from '@theme/TabItem';
1617
import TroubleshootingPrLinks from "/src/components/reference/_troubleshooting-pr-links.mdx"
@@ -73,6 +74,10 @@ Confirm that you have the correct connection and access:
7374

7475
<DisableComments />
7576

77+
## Customize PR comments
78+
79+
<CustomComments comment_type="PR" link_type="Markdown and plaintext" />
80+
7681
## Next steps
7782

7883
<NextAfterComments />

docs/semgrep-appsec-platform/github-pr-comments.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ tags:
1111

1212
<!-- vale off -->
1313

14+
import CustomComments from "/src/components/procedure/_customize_pr_mr_comments.mdx"
1415
import EnableAutofix from "/src/components/procedure/_enable-autofix.mdx"
1516
import DeploymentJourney from "/src/components/concept/_deployment-journey.mdx"
1617
import DisplayTaintedDataIntro from "/src/components/concept/_semgrep-code-display-tainted-data.mdx"
@@ -142,6 +143,10 @@ Both GitHub and GitLab provide features to prevent or block a PR or MR from merg
142143
</tr>
143144
</table>
144145

146+
### Customize PR comments
147+
148+
<CustomComments comment_type="PR" link_type="HTML, Markdown, and plaintext" />
149+
145150
## Next steps
146151

147152
<NextAfterComments />

docs/semgrep-appsec-platform/gitlab-mr-comments.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tags:
1212

1313
<!-- vale off -->
1414

15+
import CustomComments from "/src/components/procedure/_customize_pr_mr_comments.mdx"
1516
import EnableAutofix from "/src/components/procedure/_enable-autofix.mdx"
1617
import DisplayTaintedDataIntro from "/src/components/concept/_semgrep-code-display-tainted-data.mdx"
1718
import CommentTriggers from "/src/components/reference/_comment-triggers.mdx"
@@ -114,6 +115,10 @@ To enable dataflow traces in your CI pipeline, fulfill the following prerequisit
114115
- Not all Semgrep rules or rulesets make use of taint tracking. Ensure that you have a ruleset, such as the **default ruleset** added in your **[Policies](https://semgrep.dev/orgs/-/policies)**. If this ruleset is not added, go to [https://semgrep.dev/p/default](https://semgrep.dev/p/default), and then click **Add to Policy**. You can add rules that use taint tracking from [Semgrep Registry](https://semgrep.dev/explore).
115116
:::
116117

118+
### Customize MR comments
119+
120+
<CustomComments comment_type="MR" link_type="HTML, Markdown, and plaintext" />
121+
117122
## Next steps
118123

119124
<NextAfterComments />
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
You can customize the comments Semgrep leaves on your {props.comment_type}. Custom comments allow you to direct your teams to the resources they need to handle the vulnerabilities Semgrep identifies in their code.
2+
3+
![A custom comment with instructions on how to obtain more information about a finding.](/img/custom-comment-example.png#md-width)
4+
_**Figure**. A custom comment with instructions on how to obtain more information about a finding._
5+
6+
To provide custom {props.comment_type} comments:
7+
8+
1. Sign in to [<i class="fas fa-external-link fa-xs"></i> Semgrep AppSec Platform](https://semgrep.dev/login?).
9+
1. Navigate to **Settings > General > Global**.
10+
1. Go to the **Custom PR/MR comments footers** section.
11+
![Custom comment configuration in Semgrep AppSec Platform](/img/custom-comments-configuration.png#md-width)
12+
_**Figure**. Custom comment configuration in Semgrep AppSec Platform._
13+
1. Provide a custom comment for each Semgrep product whose findings you want to generate a PR comment. Semgrep supports {props.link_type} links in your message.
14+
1. Click **Save changes**.
61.9 KB
Loading
99.9 KB
Loading

0 commit comments

Comments
 (0)