-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: Support resolution_comment to update alert API #3357
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
Conversation
3eab4a9
to
a7ba2e5
Compare
github/secret_scanning.go
Outdated
|
||
// An optional comment when closing an alert. | ||
// Cannot be updated or deleted. | ||
// Must be null when changing state to open. |
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 copied the comment from the documentation.
https://docs.github.com/en/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#update-a-secret-scanning-alert
However, I have now confirmed that comments can be added when changing to Open,
so this comment may not be necessary.
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.
From reading the documentation, I'm a bit concerned about both the Resolution
and now ResolutionComment
fields because it says the fields are required in certain circumstances, and must be null
in some specific cases. However, as written (with the omitempty
), this repo will currently be unable to send null
for either one of these fields, as the field will simply be omitted.
From your testing, @na-ga, is this a concern of yours?
Or do you wish to proceed as-is?
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.
For me, it is better to be able to specify comments when changing to close state or open state.
When changing to open state, I think the comment should also be modified to match the actual behavior that can be specified as optional.
Therefore, how about removing the comment Cannot be updated or deleted. Must be null when changing state to open.
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.
Sounds good to me.
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.
Thank you, @na-ga and @Alexizx00789999 .
LGTM.
Merging.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3357 +/- ##
==========================================
- Coverage 97.72% 92.30% -5.42%
==========================================
Files 153 176 +23
Lines 13390 15031 +1641
==========================================
+ Hits 13085 13874 +789
- Misses 215 1064 +849
- Partials 90 93 +3 ☔ View full report in Codecov by Sentry. |
Support to an optional comment when closing an alert
Per the documentation available here:
https://docs.github.com/en/rest/secret-scanning/secret-scanning?apiVersion=2022-11-28#update-a-secret-scanning-alert