Skip to content

Conversation

@Emyrk
Copy link
Member

@Emyrk Emyrk commented Oct 29, 2025

Adds some extra meta data sent to provisioners. Also adds a field terraform_workspace_reuse to tell the provisioner whether or not to use the caching experiment.

For terraform directory reuse, the template-version-id and template-id is required.
These values are used to determine the terraform working directory, and also when to clean up "old" versions. The actual cache cleanup might be changed by GA. This is still an experiment.

@Emyrk Emyrk force-pushed the stevenmasley/provisioner_tmpl_ver_metadata branch from c3b32a2 to fa61201 Compare October 29, 2025 20:00
@Emyrk Emyrk changed the base branch from main to graphite-base/20558 October 30, 2025 14:59
@Emyrk Emyrk force-pushed the stevenmasley/provisioner_tmpl_ver_metadata branch from fa61201 to d36ffea Compare October 30, 2025 14:59
@Emyrk Emyrk changed the base branch from graphite-base/20558 to stevenmasley/tf_workingdirectory October 30, 2025 15:00
@Emyrk Emyrk force-pushed the stevenmasley/provisioner_tmpl_ver_metadata branch from 27dc8e3 to 1938cf1 Compare October 30, 2025 16:12
@Emyrk Emyrk force-pushed the stevenmasley/tf_workingdirectory branch from b7321d6 to 52064b7 Compare October 30, 2025 16:25
@Emyrk Emyrk force-pushed the stevenmasley/provisioner_tmpl_ver_metadata branch 3 times, most recently from f3493e0 to 60e940f Compare October 30, 2025 16:49
@github-actions github-actions bot added the stale This issue is like stale bread. label Nov 8, 2025
@Emyrk Emyrk marked this pull request as ready for review November 10, 2025 15:26
@Emyrk Emyrk force-pushed the stevenmasley/tf_workingdirectory branch from 52064b7 to bbf6058 Compare November 10, 2025 15:30
@Emyrk Emyrk force-pushed the stevenmasley/provisioner_tmpl_ver_metadata branch from f798c44 to 67115b1 Compare November 10, 2025 15:30
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protobuf fields LGTM 👍 Some other comments below but nothing blocking.

Comment on lines 60 to 67
//
// API v1.12:
// - Added new field `template_version_id` to `provisioner.Metadata`
// - Added new field `terraform_workspace_reuse` to `provisioner.Job.WorkspaceBuild`
// - Added fields `template_version_id`, `template_id`, and `terraform_workspace_reuse` to `provisioner.Config`
const (
CurrentMajor = 1
CurrentMinor = 11
CurrentMinor = 12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Emyrk Emyrk force-pushed the stevenmasley/provisioner_tmpl_ver_metadata branch 2 times, most recently from 08880d3 to b882573 Compare November 10, 2025 16:17
@Emyrk Emyrk force-pushed the stevenmasley/tf_workingdirectory branch from bbf6058 to fc6bb0a Compare November 10, 2025 17:15
@Emyrk Emyrk force-pushed the stevenmasley/provisioner_tmpl_ver_metadata branch from 195f4e0 to 88a203b Compare November 10, 2025 17:15
}

type TemplateVersionImportJob struct {
// TemplateID is not guaranteed to be set. Template versions can be created
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template versions can be created without being associated with a template.

Can you elaborate on that?
Do we create an initial template version first then associate it with a template?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we create an initial template version first then associate it with a template?

Correct, see cli/templatepush.go for illustration.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, it's been a thorn in my side for a long time that the first template push is an orphaned version 😢

@github-actions github-actions bot removed the stale This issue is like stale bread. label Nov 12, 2025
@Emyrk
Copy link
Member Author

Emyrk commented Nov 12, 2025

TODO: Mark these fields as optional and prefix by exp_

@Emyrk Emyrk force-pushed the stevenmasley/tf_workingdirectory branch from fc6bb0a to b88ee78 Compare November 12, 2025 14:52
@Emyrk Emyrk force-pushed the stevenmasley/provisioner_tmpl_ver_metadata branch 2 times, most recently from 6e163e9 to 876150c Compare November 12, 2025 15:01
@Emyrk Emyrk force-pushed the stevenmasley/tf_workingdirectory branch from b88ee78 to e8bf6de Compare November 12, 2025 15:01
@Emyrk Emyrk changed the base branch from stevenmasley/tf_workingdirectory to graphite-base/20558 November 12, 2025 15:24
@Emyrk Emyrk force-pushed the graphite-base/20558 branch from e8bf6de to 7c8deaf Compare November 12, 2025 15:24
@Emyrk Emyrk force-pushed the stevenmasley/provisioner_tmpl_ver_metadata branch from 876150c to 8ef24ef Compare November 12, 2025 15:24
@graphite-app graphite-app bot changed the base branch from graphite-base/20558 to main November 12, 2025 15:25
@Emyrk Emyrk force-pushed the stevenmasley/provisioner_tmpl_ver_metadata branch 3 times, most recently from f0bf9eb to 41faf32 Compare November 12, 2025 16:53
@Emyrk Emyrk force-pushed the stevenmasley/provisioner_tmpl_ver_metadata branch from 41faf32 to a5bf278 Compare November 12, 2025 17:54
@Emyrk Emyrk force-pushed the stevenmasley/provisioner_tmpl_ver_metadata branch from a5bf278 to b074539 Compare November 12, 2025 18:17
@Emyrk Emyrk merged commit 9149c1e into main Nov 12, 2025
29 checks passed
@Emyrk Emyrk deleted the stevenmasley/provisioner_tmpl_ver_metadata branch November 12, 2025 18:46
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants