@@ -630,6 +630,7 @@ func (p *Server) runTemplateImportParse(ctx context.Context, provisioner sdkprot
630630 Level : msgType .Log .Level ,
631631 CreatedAt : time .Now ().UTC ().UnixMilli (),
632632 Output : msgType .Log .Output ,
633+ Stage : "Parse parameters" ,
633634 }},
634635 })
635636 if err != nil {
@@ -651,6 +652,13 @@ func (p *Server) runTemplateImportParse(ctx context.Context, provisioner sdkprot
651652// This is used to detect resources that would be provisioned
652653// for a workspace in various states.
653654func (p * Server ) runTemplateImportProvision (ctx , shutdown context.Context , provisioner sdkproto.DRPCProvisionerClient , job * proto.AcquiredJob , values []* sdkproto.ParameterValue , metadata * sdkproto.Provision_Metadata ) ([]* sdkproto.Resource , error ) {
655+ var stage string
656+ switch metadata .WorkspaceTransition {
657+ case sdkproto .WorkspaceTransition_START :
658+ stage = "Detecting persistent resources"
659+ case sdkproto .WorkspaceTransition_STOP :
660+ stage = "Detecting ephemeral resources"
661+ }
654662 stream , err := provisioner .Provision (ctx )
655663 if err != nil {
656664 return nil , xerrors .Errorf ("provision: %w" , err )
@@ -704,6 +712,7 @@ func (p *Server) runTemplateImportProvision(ctx, shutdown context.Context, provi
704712 Level : msgType .Log .Level ,
705713 CreatedAt : time .Now ().UTC ().UnixMilli (),
706714 Output : msgType .Log .Output ,
715+ Stage : stage ,
707716 }},
708717 })
709718 if err != nil {
@@ -808,6 +817,7 @@ func (p *Server) runWorkspaceBuild(ctx, shutdown context.Context, provisioner sd
808817 Level : msgType .Log .Level ,
809818 CreatedAt : time .Now ().UTC ().UnixMilli (),
810819 Output : msgType .Log .Output ,
820+ Stage : stage ,
811821 }},
812822 })
813823 if err != nil {
0 commit comments