feat: Expose managed variables via API (#6134)

* WIP

* hcl

* useManagedVariables

* fix

* Fix

* Fix

* fix

* go:build

* Fix

* fix: bool flag

* Insert template variables

* API

* fix

* Expose via API

* More wiring

* CLI for testing purposes

* WIP

* Delete FIXME

* planVars

* WIP

* WIP

* UserVariableValues

* no dry run

* Dry run

* Done FIXME

* Fix

* Fix: CLI

* Fix: migration

* API tests

* Test info

* Tests

* More tests

* fix: lint

* Fix: authz

* Address PR comments

* Fix

* fix

* fix
This commit is contained in:
Marcin Tojek
2023-02-15 18:24:15 +01:00
committed by GitHub
parent f0f39b4892
commit 3b7b96ac28
41 changed files with 2423 additions and 667 deletions

View File

@ -0,0 +1 @@
DROP TABLE template_version_variables;

View File

@ -0,0 +1,19 @@
CREATE TABLE IF NOT EXISTS template_version_variables (
template_version_id uuid not null references template_versions (id) on delete cascade,
name text not null,
description text not null,
type text not null,
value text not null,
default_value text not null,
required boolean not null,
sensitive boolean not null,
unique (template_version_id, name)
);
COMMENT ON COLUMN template_version_variables.name IS 'Variable name';
COMMENT ON COLUMN template_version_variables.description IS 'Variable description';
COMMENT ON COLUMN template_version_variables.type IS 'Variable type';
COMMENT ON COLUMN template_version_variables.value IS 'Variable value';
COMMENT ON COLUMN template_version_variables.default_value IS 'Variable default value';
COMMENT ON COLUMN template_version_variables.required IS 'Required variables needs a default value or a value provided by template admin';
COMMENT ON COLUMN template_version_variables.sensitive IS 'Sensitive variables have their values redacted in logs or site UI';

View File

@ -241,6 +241,7 @@ func TestMigrateUpWithFixtures(t *testing.T) {
"replicas",
"template_version_parameters",
"workspace_build_parameters",
"template_version_variables",
}
s := &tableStats{s: make(map[string]int)}