-
Notifications
You must be signed in to change notification settings - Fork 562
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
WIP: support single comment summary with orchestrator mode #1850
base: develop
Are you sure you want to change the base?
Changes from 1 commit
e340b53
151068c
60a7a13
ffa6e55
dfe91e9
5a33821
eac4651
6df110b
44c1aff
f552996
b4068cd
1a48f98
1d3bc41
4c9fb5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -28,7 +28,7 @@ func PostInitialSourceComments(ghService ci.PullRequestService, prNumber int, im | |||||||||||||
reporter := CiReporter{ | ||||||||||||||
PrNumber: prNumber, | ||||||||||||||
CiService: ghService, | ||||||||||||||
ReportStrategy: CommentPerRunStrategy{fmt.Sprintf("Report for location: %v", location), time.Now()}, | ||||||||||||||
ReportStrategy: SingleCommentStrategy{fmt.Sprintf("Report for location: %v", location), time.Now()}, | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider initializing the Formatters map in SingleCommentStrategy The SingleCommentStrategy struct requires a Formatters map, but it's not being initialized here. This could lead to a nil map panic when Report is called. - ReportStrategy: SingleCommentStrategy{fmt.Sprintf("Report for location: %v", location), time.Now()},
+ ReportStrategy: SingleCommentStrategy{
+ Title: fmt.Sprintf("Report for location: %v", location),
+ TimeOfRun: time.Now(),
+ Formatters: make(map[string]ReportFormat),
+ }, 📝 Committable suggestion
Suggested change
|
||||||||||||||
} | ||||||||||||||
err := reporter.Report("Comment Reporter", func(report string) string { return "" }) | ||||||||||||||
if err != nil { | ||||||||||||||
|
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.
Add thread safety to map access in SingleCommentStrategy
The Formatters map is accessed without synchronization, which could lead to race conditions in concurrent usage.