@@ -9,19 +9,15 @@ const (
99 ReportTypeSecurity ReportType = "SECURITY"
1010 ReportTypeCoverage ReportType = "COVERAGE"
1111 ReportTypeTest ReportType = "TEST"
12- ReportTypeBug ReportType = "BUG"
1312)
1413
15- // ReportResult represents the pass/fail status of the report.
1614type ReportResult string
1715
1816const (
19- ReportResultPassed ReportResult = "PASSED"
20- ReportResultFailed ReportResult = "FAILED"
21- ReportResultPending ReportResult = "PENDING"
17+ ReportResultPassed ReportResult = "PASSED"
18+ ReportResultFailed ReportResult = "FAILED"
2219)
2320
24- // DataType represents the type of value in the report data fields.
2521type DataType string
2622
2723const (
@@ -31,19 +27,17 @@ const (
3127 DataTypeLink DataType = "LINK"
3228 DataTypeNumber DataType = "NUMBER"
3329 DataTypePercentage DataType = "PERCENTAGE"
30+ DataTypeString DataType = "STRING"
3431 DataTypeText DataType = "TEXT"
3532)
3633
37- // AnnotationType represents the category of the annotation.
3834type AnnotationType string
3935
4036const (
4137 AnnotationTypeVulnerability AnnotationType = "VULNERABILITY"
4238 AnnotationTypeCodeSmell AnnotationType = "CODE_SMELL"
43- AnnotationTypeBug AnnotationType = "BUG"
4439)
4540
46- // AnnotationSeverity represents the severity level of the annotation.
4741type AnnotationSeverity string
4842
4943const (
@@ -60,7 +54,7 @@ type CodeInsightsReport struct {
6054 Reporter string `json:"reporter,omitempty"`
6155 Link string `json:"link,omitempty"`
6256 Result ReportResult `json:"result,omitempty"`
63- Data []* CodeInsightsData `json:"data,omitempty"`
57+ Data []* CodeInsightsData `json:"data,omitempty"` // Max 10 elements
6458}
6559
6660type CodeInsightsData struct {
@@ -70,12 +64,12 @@ type CodeInsightsData struct {
7064}
7165
7266type CodeInsightsAnnotation struct {
73- Title string `json:"title"`
67+ ExternalID string `json:"external_id,omitempty"` // Unique ID from your system
68+ Title string `json:"title,omitempty"`
7469 AnnotationType AnnotationType `json:"annotation_type"`
7570 Summary string `json:"summary"`
76- Severity AnnotationSeverity `json:"severity"`
71+ Severity AnnotationSeverity `json:"severity,omitempty "`
7772 FilePath string `json:"path,omitempty"`
78- LineNumber uint32 `json:"line,omitempty"`
73+ LineNumber int `json:"line,omitempty"`
7974 Link string `json:"link,omitempty"`
80- ExternalID string `json:"external_id,omitempty"`
8175}
0 commit comments