chore: compute job status as column (#10024)

* chore: provisioner job status as column
* use provisioner job status for workspace searching
This commit is contained in:
Steven Masley
2023-10-04 20:57:46 -05:00
committed by GitHub
parent d5040441aa
commit 5021e23105
24 changed files with 358 additions and 222 deletions

View File

@ -11,7 +11,6 @@ import (
"golang.org/x/xerrors"
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/db2sdk"
"github.com/coder/coder/v2/coderd/database/dbauthz"
"github.com/coder/coder/v2/coderd/database/dbtime"
agpl "github.com/coder/coder/v2/coderd/schedule"
@ -242,7 +241,7 @@ func (s *EnterpriseTemplateScheduleStore) updateWorkspaceBuild(ctx context.Conte
if err != nil {
return xerrors.Errorf("get provisioner job %q: %w", build.JobID, err)
}
if db2sdk.ProvisionerJobStatus(job) != codersdk.ProvisionerJobSucceeded {
if codersdk.ProvisionerJobStatus(job.JobStatus) != codersdk.ProvisionerJobSucceeded {
// Only touch builds that are completed.
return nil
}