Skip to content

Commit a313ca1

Browse files
committed
clean redundant comments
1 parent 9d29c35 commit a313ca1

File tree

1 file changed

+4
-29
lines changed

1 file changed

+4
-29
lines changed

tools/sift.go

+4-29
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ type InvestigationRequest struct {
4444
// TODO: Add this when we have a new investigation source field InvestigationSourceTypeMCP.
4545
// InvestigationSource InvestigationSource `json:"investigationSource" gorm:"embedded;embeddedPrefix:investigation_source_"`
4646

47-
// This field holds metric query input for oncall integration investigations.
48-
// To be removed after migrating to a new more explicit field.
4947
QueryURL string `json:"queryUrl"`
5048

5149
Checks []string `json:"checks" gorm:"serializer:json"`
@@ -58,7 +56,7 @@ type AnalysisStep struct {
5856
State string `json:"state"`
5957
// The exit message of the step. Can be empty if the step was successful.
6058
ExitMessage string `json:"exitMessage"`
61-
// Runtime statistics for this step, stored as JSON in the database
59+
// Runtime statistics for this step
6260
Stats map[string]interface{} `json:"stats,omitempty"`
6361
}
6462

@@ -72,18 +70,16 @@ type AnalysisEvent struct {
7270

7371
// Interesting: The analysis complete with results that indicate a probable cause for failure.
7472
type AnalysisResult struct {
75-
Successful bool `json:"successful"`
76-
Interesting bool `json:"interesting"`
77-
Message string `json:"message"`
78-
// Do not put these into the database while we are testing it out. Just used for sending to OnCall.
73+
Successful bool `json:"successful"`
74+
Interesting bool `json:"interesting"`
75+
Message string `json:"message"`
7976
MarkdownSummary string `json:"-" gorm:"-"`
8077
Details map[string]interface{} `json:"details"`
8178
Events []AnalysisEvent `json:"events,omitempty" gorm:"serializer:json"`
8279
}
8380

8481
// An Analysis struct provides the status and results
8582
// of running a specific type of check.
86-
// The information is stored in the database.
8783
type Analysis struct {
8884
ID uuid.UUID `json:"id" gorm:"primarykey;type:char(36)" validate:"isdefault"`
8985
CreatedAt time.Time `json:"created" validate:"isdefault"`
@@ -100,11 +96,6 @@ type Analysis struct {
10096
Title string `json:"title"`
10197
Steps []AnalysisStep `json:"steps" gorm:"foreignKey:AnalysisID;constraint:OnDelete:CASCADE"`
10298
Result AnalysisResult `json:"result" gorm:"embedded;embeddedPrefix:result_"`
103-
104-
// CreateWithID is used to indicate that the analysis should be created with the
105-
// ID in the ID field, rather than generating a new one. This is used by the
106-
// copy command of the mlapi CLI.
107-
CreateWithID bool `json:"-" gorm:"-"`
10899
}
109100

110101
type DatasourceConfig struct {
@@ -141,17 +132,9 @@ type Investigation struct {
141132

142133
// GrafanaURL is the Grafana URL to be used for datasource queries
143134
// for this investigation.
144-
// If missing from a request then the `X-Grafana-URL` header is used.
145135
GrafanaURL string `json:"grafanaUrl"`
146136

147137
// Status describes the state of the investigation (pending, running, failed, or finished).
148-
// This is stored in the db along with the failure reason if the investigation failed.
149-
// It is computed in the AfterUpdate hook on Analyses.
150-
//
151-
// Note this is not tagged as validate:"isdefault" because we want users to be able
152-
// to take an existing investigation, update a field or two, and just POST it to
153-
// create a new investigation. If we included that tag we'd return a 400 here even
154-
// though we just ignore the field, which just adds a slightly annoying step for users.
155138
Status InvestigationStatus `json:"status"`
156139

157140
// FailureReason is a short human-friendly string that explains the reason that the
@@ -367,14 +350,6 @@ func runErrorPatternLogs(ctx context.Context, args RunErrorPatternLogsParams) (*
367350
return nil, fmt.Errorf("creating Sift client: %w", err)
368351
}
369352

370-
// // Set default time range to last 30 minutes if not provided
371-
// if args.Start.IsZero() {
372-
// args.Start = time.Now().Add(-30 * time.Minute)
373-
// }
374-
// if args.End.IsZero() {
375-
// args.End = time.Now()
376-
// }
377-
378353
// Create the investigation request with ErrorPatternLogs check
379354
requestData := InvestigationRequest{
380355
Labels: args.Labels,

0 commit comments

Comments
 (0)