Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit634082b

Browse files
committed
make lint; make fmt
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
1 parentb0e9728 commit634082b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

‎coderd/notifications/events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var (
3939
TemplateTemplateDeprecated=uuid.MustParse("f40fae84-55a2-42cd-99fa-b41c1ca64894")
4040

4141
TemplateWorkspaceBuildsFailedReport=uuid.MustParse("34a20db2-e9cc-4a93-b0e4-8569699d7a00")
42-
TemplateWorkspaceResourceReplaced=uuid.MustParse("89d9745a-816e-4695-a17f-3d0a229e2b8d")
42+
TemplateWorkspaceResourceReplaced=uuid.MustParse("89d9745a-816e-4695-a17f-3d0a229e2b8d")
4343
)
4444

4545
// Notification-related events.

‎coderd/prebuilds/noop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type NoopReconciler struct{}
1313

1414
func (NoopReconciler)Run(context.Context) {}
1515
func (NoopReconciler)Stop(context.Context,error) {}
16-
func (NoopReconciler)TrackResourceReplacement(ctxcontext.Context,workspaceID,buildID,claimantIDuuid.UUID,replacements []*sdkproto.ResourceReplacement) {
16+
func (NoopReconciler)TrackResourceReplacement(context.Context,uuid.UUID, uuid.UUID,uuid.UUID, []*sdkproto.ResourceReplacement) {
1717
}
1818
func (NoopReconciler)ReconcileAll(context.Context)error {returnnil }
1919
func (NoopReconciler)SnapshotState(context.Context, database.Store) (*GlobalSnapshot,error) {

‎enterprise/coderd/prebuilds/reconcile.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ func (c *StoreReconciler) provision(
632632

633633
func (c*StoreReconciler)TrackResourceReplacement(ctx context.Context,workspaceID,buildID,claimantID uuid.UUID,replacements []*sdkproto.ResourceReplacement) {
634634
// Set authorization context since this may be called in the background (i.e. with a bare context).
635+
// nolint:gocritic // Necessary to query all the required data.
635636
ctx=dbauthz.AsSystemRestricted(ctx)
636637
// Since this may be called in a fire-and-forget fashion, we need to give up at some point.
637638
trackCtx,trackCancel:=context.WithTimeout(ctx,time.Minute)
@@ -642,6 +643,7 @@ func (c *StoreReconciler) TrackResourceReplacement(ctx context.Context, workspac
642643
}
643644
}
644645

646+
// nolint:revive // Shut up it's fine.
645647
func (c*StoreReconciler)trackResourceReplacement(ctx context.Context,workspaceID,buildID,claimantID uuid.UUID,replacements []*sdkproto.ResourceReplacement)error {
646648
iferr:=ctx.Err();err!=nil {
647649
returnerr
@@ -683,12 +685,12 @@ func (c *StoreReconciler) trackResourceReplacement(ctx context.Context, workspac
683685
// Use the claiming build here (not prebuild) because both should be equivalent, and we might as well spot inconsistencies now.
684686
templateVersion,err:=c.store.GetTemplateVersionByID(ctx,build.TemplateVersionID)
685687
iferr!=nil {
686-
returnxerrors.Errorf("fetch template version %q: %w",build.TemplateVersionID.String())
688+
returnxerrors.Errorf("fetch template version %q: %w",build.TemplateVersionID.String(),err)
687689
}
688690

689691
org,err:=c.store.GetOrganizationByID(ctx,workspace.OrganizationID)
690692
iferr!=nil {
691-
returnxerrors.Errorf("fetch org %q: %w",workspace.OrganizationID.String())
693+
returnxerrors.Errorf("fetch org %q: %w",workspace.OrganizationID.String(),err)
692694
}
693695

694696
// Track resource replacement in Prometheus metric.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp