Skip to content
Prev Previous commit
Merge remote-tracking branch 'origin/main' into stevenmasley/workspac…
…e_search_failed
  • Loading branch information
Emyrk committed Jun 5, 2023
commit 985e8214f6fca85c9259a9f173e53c778c613cbc
40 changes: 0 additions & 40 deletions coderd/database/dbgen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,46 +492,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(genCtx, 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(genCtx, 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("{}"))
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.