mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
feat!: drop support for legacy parameters (#7663)
This commit is contained in:
@ -439,46 +439,6 @@ func TemplateVersionVariable(t testing.TB, db database.Store, orig database.Temp
|
||||
return version
|
||||
}
|
||||
|
||||
func ParameterSchema(t testing.TB, db database.Store, seed database.ParameterSchema) database.ParameterSchema {
|
||||
scheme, err := db.InsertParameterSchema(context.Background(), database.InsertParameterSchemaParams{
|
||||
ID: takeFirst(seed.ID, uuid.New()),
|
||||
JobID: takeFirst(seed.JobID, uuid.New()),
|
||||
CreatedAt: takeFirst(seed.CreatedAt, database.Now()),
|
||||
Name: takeFirst(seed.Name, namesgenerator.GetRandomName(1)),
|
||||
Description: takeFirst(seed.Description, namesgenerator.GetRandomName(1)),
|
||||
DefaultSourceScheme: takeFirst(seed.DefaultSourceScheme, database.ParameterSourceSchemeNone),
|
||||
DefaultSourceValue: takeFirst(seed.DefaultSourceValue, ""),
|
||||
AllowOverrideSource: takeFirst(seed.AllowOverrideSource, false),
|
||||
DefaultDestinationScheme: takeFirst(seed.DefaultDestinationScheme, database.ParameterDestinationSchemeNone),
|
||||
AllowOverrideDestination: takeFirst(seed.AllowOverrideDestination, false),
|
||||
DefaultRefresh: takeFirst(seed.DefaultRefresh, ""),
|
||||
RedisplayValue: takeFirst(seed.RedisplayValue, false),
|
||||
ValidationError: takeFirst(seed.ValidationError, ""),
|
||||
ValidationCondition: takeFirst(seed.ValidationCondition, ""),
|
||||
ValidationTypeSystem: takeFirst(seed.ValidationTypeSystem, database.ParameterTypeSystemNone),
|
||||
ValidationValueType: takeFirst(seed.ValidationValueType, ""),
|
||||
Index: takeFirst(seed.Index, 1),
|
||||
})
|
||||
require.NoError(t, err, "insert parameter scheme")
|
||||
return scheme
|
||||
}
|
||||
|
||||
func ParameterValue(t testing.TB, db database.Store, seed database.ParameterValue) database.ParameterValue {
|
||||
scheme, err := db.InsertParameterValue(context.Background(), database.InsertParameterValueParams{
|
||||
ID: takeFirst(seed.ID, uuid.New()),
|
||||
Name: takeFirst(seed.Name, namesgenerator.GetRandomName(1)),
|
||||
CreatedAt: takeFirst(seed.CreatedAt, database.Now()),
|
||||
UpdatedAt: takeFirst(seed.UpdatedAt, database.Now()),
|
||||
Scope: takeFirst(seed.Scope, database.ParameterScopeWorkspace),
|
||||
ScopeID: takeFirst(seed.ScopeID, uuid.New()),
|
||||
SourceScheme: takeFirst(seed.SourceScheme, database.ParameterSourceSchemeNone),
|
||||
SourceValue: takeFirst(seed.SourceValue, ""),
|
||||
DestinationScheme: takeFirst(seed.DestinationScheme, database.ParameterDestinationSchemeNone),
|
||||
})
|
||||
require.NoError(t, err, "insert parameter value")
|
||||
return scheme
|
||||
}
|
||||
|
||||
func WorkspaceAgentStat(t testing.TB, db database.Store, orig database.WorkspaceAgentStat) database.WorkspaceAgentStat {
|
||||
if orig.ConnectionsByProto == nil {
|
||||
orig.ConnectionsByProto = json.RawMessage([]byte("{}"))
|
||||
|
Reference in New Issue
Block a user