Skip to content

Commit 1398491

Browse files
committed
lint fixes
1 parent cd891db commit 1398491

File tree

7 files changed

+8
-4
lines changed

7 files changed

+8
-4
lines changed

coderd/database/dbfake/dbfake.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ func (b WorkspaceBuildBuilder) Do() WorkspaceResponse {
179179
Input: payload,
180180
Tags: map[string]string{},
181181
TraceMetadata: pqtype.NullRawMessage{},
182+
LogsOverflowed: false,
182183
})
183184
require.NoError(b.t, err, "insert job")
184185

coderd/database/dbgen/dbgen.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,7 @@ func ProvisionerJob(t testing.TB, db database.Store, ps pubsub.Pubsub, orig data
774774
Input: takeFirstSlice(orig.Input, []byte("{}")),
775775
Tags: tags,
776776
TraceMetadata: pqtype.NullRawMessage{},
777+
LogsOverflowed: false,
777778
})
778779
require.NoError(t, err, "insert job")
779780
if ps != nil {

coderd/provisionerdserver/provisionerdserver.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,6 @@ func (s *server) UpdateJob(ctx context.Context, request *proto.UpdateJobRequest)
903903
}
904904

905905
if len(request.Logs) > 0 && !job.LogsOverflowed {
906-
907906
//nolint:exhaustruct // We append to the additional fields below.
908907
insertParams := database.InsertProvisionerJobLogsParams{
909908
JobID: parsedID,
@@ -952,7 +951,6 @@ func (s *server) UpdateJob(ctx context.Context, request *proto.UpdateJobRequest)
952951
LogsLength: int32(newLogSize), // #nosec G115 - Log output length is limited to 1MB (2^20) which fits in an int32.
953952
})
954953
if err != nil {
955-
956954
// Even though we do the runtime check for the overflow, we still check for the database error
957955
// as well.
958956
if database.IsProvisionerJobLogsLimitError(err) {

coderd/provisionerdserver/provisionerdserver_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ func TestUpdateJob(t *testing.T) {
10001000
job := setupJob(t, db, pd.ID, pd.Tags)
10011001

10021002
logOutput := "test log message"
1003-
expectedSize := int32(len(logOutput))
1003+
expectedSize := int32(len(logOutput)) // #nosec G115 - Log length is 16.
10041004

10051005
_, err := srv.UpdateJob(ctx, &proto.UpdateJobRequest{
10061006
JobId: job.String(),

coderd/templateversions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ func (api *API) postTemplateVersionDryRun(rw http.ResponseWriter, r *http.Reques
551551
Valid: true,
552552
RawMessage: metadataRaw,
553553
},
554+
LogsOverflowed: false,
554555
})
555556
if err != nil {
556557
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
@@ -1645,6 +1646,7 @@ func (api *API) postTemplateVersionsByOrganization(rw http.ResponseWriter, r *ht
16451646
Valid: true,
16461647
RawMessage: traceMetadataRaw,
16471648
},
1649+
LogsOverflowed: false,
16481650
})
16491651
if err != nil {
16501652
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{

coderd/wsbuilder/wsbuilder.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ func (b *Builder) buildTx(authFunc func(action policy.Action, object rbac.Object
387387
Valid: true,
388388
RawMessage: traceMetadataRaw,
389389
},
390+
LogsOverflowed: false,
390391
})
391392
if err != nil {
392393
return nil, nil, nil, BuildError{http.StatusInternalServerError, "insert provisioner job", err}

site/src/modules/resources/AgentRow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ export const AgentRow: FC<AgentRowProps> = ({
8787
logs.push({
8888
id: -1,
8989
level: "error",
90-
output: "Startup logs exceeded the max size of 1MB, and will not continue to be written to the database! Logs will continue to be written to the /tmp/coder-startup-script.log file in the workspace.",
90+
output:
91+
"Startup logs exceeded the max size of 1MB, and will not continue to be written to the database! Logs will continue to be written to the /tmp/coder-startup-script.log file in the workspace.",
9192
created_at: new Date().toISOString(),
9293
source_id: "",
9394
});

0 commit comments

Comments
 (0)