- Notifications
You must be signed in to change notification settings - Fork1k
feat: persist AI task state in template imports & workspace builds#18449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
9848749
to213ba4a
CompareSigned-off-by: Danny Kopping <dannykopping@gmail.com># Conflicts:#go.sum
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
…e changedSigned-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
…tions, add testSigned-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
…requiredSigned-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com># Conflicts:#go.sum
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
d240c0e
to0b2b732
Compare…is PRThis will be done in a separate PRSigned-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
@@ -584,8 +584,6 @@ func (r *Runner) runTemplateImport(ctx context.Context) (*proto.CompletedJob, *p | |||
externalAuthProviderNames = append(externalAuthProviderNames, it.Id) | |||
} | |||
// fmt.Println("completed job: template import: graph:", startProvision.Graph) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Drive-by.
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
-- if has_ai_task is true, ai_task_sidebar_app_id MUST be set | ||
-- ai_task_sidebar_app_id can ONLY be set if has_ai_task is true | ||
-- | ||
-- has_ai_task | ai_task_sidebar_app_id | Result | ||
-- ------------|------------------------|--------------- | ||
-- NULL | NULL | TRUE (passes) | ||
-- NULL | NOT NULL | FALSE (fails) | ||
-- FALSE | NULL | TRUE (passes) | ||
-- FALSE | NOT NULL | FALSE (fails) | ||
-- TRUE | NULL | FALSE (fails) | ||
-- TRUE | NOT NULL | TRUE (passes) | ||
ALTER TABLE workspace_builds | ||
ADD CONSTRAINT workspace_builds_ai_task_sidebar_app_id_required CHECK ( | ||
((has_ai_task IS NULL OR has_ai_task = false) AND ai_task_sidebar_app_id IS NULL) | ||
OR (has_ai_task = true AND ai_task_sidebar_app_id IS NOT NULL) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I originally wondered whyhas_ai_task
was nullable by default, but the provisionerdserver changes below explain why:
- New build: has_ai_task = null (unknown yet)
- After build completes: provisionerdserver sets has_ai_task to (true|false).
My next question would be: in which case do we need to know the difference betweenhas_ai_task = null
andhas_ai_task = false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
My next question would be: in which case do we need to know the difference between has_ai_task = null and has_ai_task = false?
Whilehas_ai_task
isnull
(AND a build's provisioner job is in progress) we use other data (build params + template versionhas_ai_task
) to determine if the build might be an AI task, but if it'sfalse
then we know for certain it is not. For builds at rest (i.e. no provisioner job in progress) they're functionally the same.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
0238f29
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Closes#18453