@@ -965,20 +965,18 @@ func newVersion(ctx context.Context, client *codersdk.Client, req newVersionRequ
965965return nil ,fmt .Errorf ("failed to upload directory: %s" ,err )
966966}
967967tflog .Trace (ctx ,"successfully uploaded directory" )
968- // TODO(ethanndickson): Uncomment when a released `codersdk` exports template variable parsing
969- // tflog.Trace(ctx,"discovering and parsing vars files")
970- // varFiles, err := codersdk.DiscoverVarsFiles(directory)
971- // if err != nil {
972- // return nil, fmt.Errorf("failed to discover vars files: %s", err)
973- // }
974- // vars, err := codersdk.ParseUserVariableValues(varFiles, "", []string{})
975- // if err != nil {
976- // return nil, fmt.Errorf("failed to parse user variable values: %s", err)
977- // }
978- // tflog.Trace(ctx,"discovered and parsed vars files", map[string]any{
979- // "vars": vars,
980- // })
981- vars := make ([]codersdk.VariableValue ,0 ,len (req .Version .TerraformVariables ))
968+ tflog .Trace (ctx ,"discovering and parsing vars files" )
969+ varFiles ,err := codersdk .DiscoverVarsFiles (directory )
970+ if err != nil {
971+ return nil ,fmt .Errorf ("failed to discover vars files: %s" ,err )
972+ }
973+ vars ,err := codersdk .ParseUserVariableValues (varFiles ,"" , []string {})
974+ if err != nil {
975+ return nil ,fmt .Errorf ("failed to parse user variable values: %s" ,err )
976+ }
977+ tflog .Trace (ctx ,"discovered and parsed vars files" ,map [string ]any {
978+ "vars" :vars ,
979+ })
982980for _ ,variable := range req .Version .TerraformVariables {
983981vars = append (vars , codersdk.VariableValue {
984982Name :variable .Name .ValueString (),