Skip to content

Commit b8dc5d1

Browse files
author
Trey Ivy
committed
comment hell
1 parent 12cc309 commit b8dc5d1

9 files changed

+26
-21
lines changed

ent/schema/actiondata.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ func (ActionData) Fields() []ent.Field {
3535
// Accumulated CPU time of all spawned actions of this type.
3636
// This is only set if all the actions reported a time
3737
field.Int64("system_time").
38-
//GoType(time.Duration(0)).
3938
Optional(),
39+
40+
// User time spent in millisconds
4041
field.Int64("user_time").
41-
//GoType(time.Duration(0)).
4242
Optional(),
4343
}
4444
}

ent/schema/bazelinvocation.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ func (BazelInvocation) Edges() []ent.Edge {
9292
edge.To("problems", BazelInvocationProblem.Type).
9393
Annotations(entgql.Skip(entgql.SkipType)),
9494

95-
//Build Metrics for the Completed Invocation
95+
// Build Metrics for the Completed Invocation
9696
edge.To("metrics", Metrics.Type).
9797
Unique(),
9898

99-
//Test Data for the completed Invocation
99+
// Test Data for the completed Invocation
100100
edge.To("test_collection", TestCollection.Type),
101101

102-
//Target Data for the completed Invocation
102+
// Target Data for the completed Invocation
103103
edge.To("targets", TargetPair.Type),
104104
}
105105
}

ent/schema/buildgraphmetrics.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ func (BuildGraphMetrics) Edges() []ent.Edge {
7676
return []ent.Edge{
7777
edge.From("metrics", Metrics.Type).
7878
Ref("build_graph_metrics"),
79-
80-
//NOTE: these are all missing from the proto, but i'm including them here for now for completeness
79+
// NOTE: these are all missing from the proto, but i'm including them here for now for completeness
8180

8281
// Dirtied Values.
8382
// Number of SkyValues that were dirtied during the build. Dirtied nodes are

ent/schema/resourceusage.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type ResourceUsage struct {
1414
// Fields of the ResourceUsage.
1515
func (ResourceUsage) Fields() []ent.Field {
1616
return []ent.Field{
17-
//NOTE: not currently implemented on the proto but included here for completeness
17+
// NOTE: not currently implemented on the proto but included here for completeness
1818
// The name.
1919
field.String("name").Optional(),
2020

ent/schema/targetcomplete.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (TargetComplete) Fields() []ent.Field {
4646
"ENORMOUS").
4747
Optional(),
4848

49-
//TODO: implement failure detail.
49+
// TODO: implement failure detail.
5050
}
5151
}
5252

ent/schema/timingbreakdown.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (TimingBreakdown) Fields() []ent.Field {
1818
field.String("name").Optional(),
1919

2020
// Time spent ding the activity (duration).
21-
//NOTE: proto has this as an int, but implemented as a string
21+
// NOTE: proto has this as an int, but implemented as a string
2222
field.String("time").Optional(),
2323
}
2424
}

internal/graphql/custom.resolvers.go

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/processing/save.go

+11-9
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ func (act SaveActor) saveBazelInvocation(
119119
buildRecord *ent.Build,
120120
metrics *ent.Metrics,
121121
tests []*ent.TestCollection,
122-
targets []*ent.TargetPair) (*ent.BazelInvocation, error) {
122+
targets []*ent.TargetPair,
123+
) (*ent.BazelInvocation, error) {
123124
create := act.db.BazelInvocation.Create().
124125
SetInvocationID(uuid.MustParse(summary.InvocationID)).
125126
SetStartedAt(summary.StartedAt).
@@ -192,7 +193,7 @@ func (act SaveActor) saveOutputGroup(ctx context.Context, ouputGroup summary.Out
192193
SetName(ouputGroup.Name).
193194
SetIncomplete(ouputGroup.Incomplete).
194195
AddInlineFiles(inlineFiles...).
195-
//TODO: implement named set of files logic to recursively add files to this collection
196+
// TODO: implement named set of files logic to recursively add files to this collection
196197
Save(ctx)
197198
}
198199

@@ -225,8 +226,8 @@ func (act SaveActor) saveTargetCompletion(ctx context.Context, targetCompletion
225226
}
226227

227228
func (act SaveActor) saveTargetPair(ctx context.Context, targetPair summary.TargetPair, label string) (*ent.TargetPair, error) {
228-
var configuration = targetPair.Configuration
229-
var completion = targetPair.Completion
229+
configuration := targetPair.Configuration
230+
completion := targetPair.Completion
230231

231232
targetConfiguration, err := act.saveTargetConfiguration(ctx, configuration)
232233
if err != nil {
@@ -259,7 +260,7 @@ func (act SaveActor) saveTargetPair(ctx context.Context, targetPair summary.Targ
259260
// ironically, MapBulkCreate doesn't work for the map(string)TargetPair. Its expecting an int index, not a label.
260261
func (act SaveActor) saveTargets(ctx context.Context, summary *summary.Summary) ([]*ent.TargetPair, error) {
261262
var result []*ent.TargetPair = make([]*ent.TargetPair, len(summary.Targets))
262-
var i = 0
263+
i := 0
263264
for label, pair := range summary.Targets {
264265
targetPair, err := act.saveTargetPair(ctx, pair, label)
265266
if err != nil {
@@ -354,7 +355,7 @@ func (act SaveActor) saveTestResults(ctx context.Context, testResults []summary.
354355
SetTestAttemptDuration(testResult.TestAttemptDuration).
355356
SetTestAttemptStart(testResult.TestAttemptStart).
356357
SetExecutionInfo(executionInfo)
357-
//TODO: implement test action output AddTestActionOutput()
358+
// TODO: implement test action output AddTestActionOutput()
358359
}).Save(ctx)
359360
}
360361

@@ -381,7 +382,7 @@ func (act SaveActor) saveTestCollection(ctx context.Context, testCollection summ
381382

382383
func (act SaveActor) saveTests(ctx context.Context, summary *summary.Summary) ([]*ent.TestCollection, error) {
383384
var result []*ent.TestCollection = make([]*ent.TestCollection, len(summary.Tests))
384-
var i = 0
385+
i := 0
385386
for label, collection := range summary.Tests {
386387
testCollection, err := act.saveTestCollection(ctx, collection, label)
387388
if err != nil {
@@ -420,7 +421,7 @@ func (act SaveActor) saveRunnerCounts(ctx context.Context, runnerCounts []summar
420421
return act.db.RunnerCount.MapCreateBulk(runnerCounts, func(create *ent.RunnerCountCreate, i int) {
421422
runnerCount := runnerCounts[i]
422423
create.
423-
//TODO is there a better type for unsigned int?
424+
// TODO is there a better type for unsigned int?
424425
SetActionsExecuted(int64(runnerCount.Count)).
425426
SetName(runnerCount.Name).
426427
SetExecKind(runnerCount.ExecKind)
@@ -464,7 +465,7 @@ func (act SaveActor) saveActionSummary(ctx context.Context, actionSummary summar
464465
Save(ctx)
465466
}
466467
func (act SaveActor) saveBuildGraphMetrics(ctx context.Context, buildGraphMetrics summary.BuildGraphMetrics) (*ent.BuildGraphMetrics, error) {
467-
//TODO:implement EvalutionStats once they exist on the proto
468+
// TODO:implement EvalutionStats once they exist on the proto
468469
return act.db.BuildGraphMetrics.Create().
469470
SetActionLookupValueCount(buildGraphMetrics.ActionLookupValueCount).
470471
SetActionLookupValueCountNotIncludingAspects(buildGraphMetrics.ActionLookupValueCountNotIncludingAspects).
@@ -529,6 +530,7 @@ func (act SaveActor) savePackageMetrics(ctx context.Context, packageMetrics summ
529530
AddPackageLoadMetrics(packageLoadMetrics...).
530531
Save(ctx)
531532
}
533+
532534
func (act SaveActor) saveCumulativeMetrics(ctx context.Context, cumulativeMetrics summary.CumulativeMetrics) (*ent.CumulativeMetrics, error) {
533535
return act.db.CumulativeMetrics.Create().
534536
SetNumAnalyses(cumulativeMetrics.NumAnalyses).

pkg/summary/summarizer.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ func (s Summarizer) ProcessEvent(buildEvent *events.BuildEvent) error {
118118
s.handleTargetConfigured(buildEvent.GetConfigured(), buildEvent.GetTargetConfiguredLabel(), time.Now())
119119

120120
case *bes.BuildEventId_TargetCompleted:
121-
//is ths an aborted event?
122121
s.handleTargetCompleted(buildEvent.GetCompleted(), buildEvent.GetTargetCompletedLabel(), buildEvent.GetAborted(), time.Now())
123122

124123
case *bes.BuildEventId_Fetch:
@@ -193,7 +192,7 @@ func (s Summarizer) handleTargetConfigured(target *bes.TargetConfigured, label s
193192
TestSize: TestSize(target.TestSize),
194193
Tag: target.Tag,
195194
},
196-
Success: false, //set it to false, change it when we get a complete
195+
Success: false, // set it to false, change it when we get a complete
197196
TargetKind: target.TargetKind,
198197
TestSize: TestSize(target.TestSize),
199198
}

0 commit comments

Comments
 (0)