diff --git a/go.mod b/go.mod index 3022a33c..e83138b3 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/avast/retry-go v3.0.0+incompatible github.com/bmatcuk/doublestar v1.3.2 github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054 - github.com/cirruslabs/cirrus-ci-agent v1.21.0 + github.com/cirruslabs/cirrus-ci-agent v1.22.0 github.com/cirruslabs/echelon v1.4.0 github.com/cirruslabs/podmanapi v0.1.0 github.com/containerd/containerd v1.4.1 // indirect diff --git a/go.sum b/go.sum index 51b663e1..e4b2aa00 100644 --- a/go.sum +++ b/go.sum @@ -76,8 +76,8 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cirruslabs/cirrus-ci-agent v1.21.0 h1:cbNgskPq+frZFwEg5eD71txM/fYBJmQSaGXCGRJy8Ss= -github.com/cirruslabs/cirrus-ci-agent v1.21.0/go.mod h1:ga2zCGBfC+/+tnlHWa5cHwEuBPnhFuaf1PgTpWPGJWo= +github.com/cirruslabs/cirrus-ci-agent v1.22.0 h1:JT0C51Y3b9ZuXhELjiCDAKfjPV+Y6eVT3TtP+JoK1cE= +github.com/cirruslabs/cirrus-ci-agent v1.22.0/go.mod h1:ga2zCGBfC+/+tnlHWa5cHwEuBPnhFuaf1PgTpWPGJWo= github.com/cirruslabs/cirrus-ci-annotations v0.0.0-20200908203753-b813f63941d7/go.mod h1:98qD7HLlBx5aNqWiCH80OTTqTTsbXT69wxnlnrnoL0E= github.com/cirruslabs/echelon v1.4.0 h1:xubCf8BLFEBl1kamBZ1zjBrcw5p4z4anvJUBeR3E5YY= github.com/cirruslabs/echelon v1.4.0/go.mod h1:1jFBACMy3tzodXyTtNNLN9bw6UUU7Xpq9tYMRydehtY= diff --git a/internal/executor/executor_linux_test.go b/internal/executor/executor_linux_test.go new file mode 100644 index 00000000..9aef8d67 --- /dev/null +++ b/internal/executor/executor_linux_test.go @@ -0,0 +1,32 @@ +// +build linux + +package executor_test + +import ( + "bytes" + "github.com/cirruslabs/cirrus-cli/internal/executor" + "github.com/cirruslabs/cirrus-cli/internal/testutil" + "github.com/cirruslabs/echelon" + "github.com/cirruslabs/echelon/renderers" + "github.com/stretchr/testify/assert" + "io" + "os" + "testing" +) + +// TestDockerBuilderLinux ensures that Docker Builder instances using Linux platform are supported. +func TestDockerBuilderLinux(t *testing.T) { + // Create os.Stderr writer that duplicates it's output to buf + buf := bytes.NewBufferString("") + writer := io.MultiWriter(os.Stderr, buf) + + // Create a logger and attach it to writer + renderer := renderers.NewSimpleRenderer(writer, nil) + logger := echelon.NewLogger(echelon.TraceLevel, renderer) + + dir := testutil.TempDirPopulatedWith(t, "testdata/docker-builder") + err := testutil.ExecuteWithOptionsNew(t, dir, executor.WithLogger(logger)) + assert.NoError(t, err) + assert.Contains(t, buf.String(), "I am running inside Docker Builder!") + assert.Contains(t, buf.String(), "'linux' task succeeded") +} diff --git a/internal/executor/instance/instance.go b/internal/executor/instance/instance.go index fbf266c8..5fff1160 100644 --- a/internal/executor/instance/instance.go +++ b/internal/executor/instance/instance.go @@ -20,6 +20,7 @@ import ( ) var ( + ErrFailedToCreateInstance = errors.New("failed to create instance") ErrUnsupportedInstance = errors.New("unsupported instance type") ErrAdditionalContainerFailed = errors.New("additional container failed") ) @@ -73,6 +74,15 @@ func NewFromProto(anyInstance *any.Any, commands []*api.Command) (Instance, erro Arguments: instance.Arguments, }, nil case *api.PersistentWorkerInstance: + return NewPersistentWorkerInstance() + case *api.DockerBuilder: + // Ensure that we're not trying to run e.g. Windows-specific scripts on macOS + instanceOS := strings.ToLower(instance.Platform.String()) + if runtime.GOOS != instanceOS { + return nil, fmt.Errorf("%w: cannot run %s Docker Builder instance on this platform", + ErrFailedToCreateInstance, strings.Title(instanceOS)) + } + return NewPersistentWorkerInstance() default: return nil, fmt.Errorf("%w: %T", ErrUnsupportedInstance, instance) diff --git a/internal/executor/testdata/docker-builder/.cirrus.yml b/internal/executor/testdata/docker-builder/.cirrus.yml new file mode 100644 index 00000000..b5d6587b --- /dev/null +++ b/internal/executor/testdata/docker-builder/.cirrus.yml @@ -0,0 +1,4 @@ +linux_docker_builder: + platform: linux + script: + - echo "I am running inside Docker Builder!" diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index 930f69c5..9fdacb9c 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -76,8 +76,9 @@ func New(opts ...Option) *Parser { // Register parsers parser.parsers = map[nameable.Nameable]parseable.Parseable{ - nameable.NewRegexNameable("^(.*)task$"): task.NewTask(nil, nil, parser.additionalInstances), - nameable.NewRegexNameable("^(.*)pipe$"): task.NewDockerPipe(nil, nil), + nameable.NewRegexNameable("^(.*)task$"): task.NewTask(nil, nil, parser.additionalInstances), + nameable.NewRegexNameable("^(.*)pipe$"): task.NewDockerPipe(nil, nil), + nameable.NewRegexNameable("^(.*)docker_builder$"): task.NewDockerBuilder(nil, nil), } return parser @@ -94,6 +95,8 @@ func (p *Parser) parseTasks(tree *node.Node) ([]task.ParseableTaskLike, error) { taskLike = task.NewTask(environment.Copy(p.environment), p.boolevator, p.additionalInstances) case *task.DockerPipe: taskLike = task.NewDockerPipe(environment.Copy(p.environment), p.boolevator) + case *task.DockerBuilder: + taskLike = task.NewDockerBuilder(environment.Copy(p.environment), p.boolevator) default: panic("unknown task-like object") } @@ -382,12 +385,15 @@ func (p *Parser) createServiceTask( task.DefaultTaskProperties(), map[string]string{ "skip_notifications": "true", - "auto_cancellation": protoTask.Metadata.Properties["auto_cancellation"], }, ), }, } + if value, ok := protoTask.Metadata.Properties["auto_cancellation"]; ok { + serviceTask.Metadata.Properties["auto_cancellation"] = value + } + // Some metadata property fields duplicate other fields serviceTask.Metadata.Properties["indexWithinBuild"] = strconv.FormatInt(p.NextTaskLocalIndex(), 10) diff --git a/pkg/parser/parser_test.go b/pkg/parser/parser_test.go index fa447aab..8a4b8afa 100644 --- a/pkg/parser/parser_test.go +++ b/pkg/parser/parser_test.go @@ -166,7 +166,37 @@ func viaRPCRunSingle(t *testing.T, cloudDir string, yamlConfigName string) { t.Fatal(localResult.Errors) } - assert.JSONEq(t, string(fixtureBytes), string(testutil.TasksToJSON(t, localResult.Tasks))) + // Compare two schemas + var referenceArray []interface{} + if err := json.Unmarshal(fixtureBytes, &referenceArray); err != nil { + t.Fatal(err) + } + + var ourArray []interface{} + if err := json.Unmarshal(testutil.TasksToJSON(t, localResult.Tasks), &ourArray); err != nil { + t.Fatal(err) + } + + differ := gojsondiff.New() + d := differ.CompareArrays(referenceArray, ourArray) + + if d.Modified() { + var diffString string + + config := formatter.AsciiFormatterConfig{ + ShowArrayIndex: true, + Coloring: true, + } + + diffString, err = formatter.NewAsciiFormatter(referenceArray, config).Format(d) + if err != nil { + t.Fatal(err) + } + + fmt.Print(diffString) + + t.Fail() + } } func viaRPCCreateJSONFixture(t *testing.T, yamlBytes []byte, fixturePath string, envPath string, fcPath string) { @@ -262,7 +292,6 @@ func TestSchema(t *testing.T) { } // Remove cloud instances from the reference schema since they're not present in our schema - delete(referenceObject["patternProperties"].(map[string]interface{}), "^(.*)docker_builder$") delete(referenceObject["patternProperties"].(map[string]interface{}), "^(.*)gke_pipe$") ignoredInstances := []string{ diff --git a/pkg/parser/task/base.go b/pkg/parser/task/base.go new file mode 100644 index 00000000..fc5a4ea0 --- /dev/null +++ b/pkg/parser/task/base.go @@ -0,0 +1,242 @@ +package task + +import ( + "github.com/cirruslabs/cirrus-ci-agent/api" + "github.com/cirruslabs/cirrus-cli/internal/executor/environment" + "github.com/cirruslabs/cirrus-cli/pkg/parser/boolevator" + "github.com/cirruslabs/cirrus-cli/pkg/parser/nameable" + "github.com/cirruslabs/cirrus-cli/pkg/parser/node" + "github.com/cirruslabs/cirrus-cli/pkg/parser/parseable" + "github.com/cirruslabs/cirrus-cli/pkg/parser/schema" + "github.com/cirruslabs/cirrus-cli/pkg/parser/task/command" + "strconv" + "strings" +) + +// nolint:gocognit // it's a parser helper, there is a lot of boilerplate +func AttachBaseTaskFields( + parser *parseable.DefaultParser, + task *api.Task, + env map[string]string, + boolevator *boolevator.Boolevator, +) { + task.Metadata = &api.Task_Metadata{Properties: DefaultTaskProperties()} + + autoCancellation := env["CIRRUS_BRANCH"] != env["CIRRUS_DEFAULT_BRANCH"] + if autoCancellation { + task.Metadata.Properties["auto_cancellation"] = strconv.FormatBool(autoCancellation) + } + + parser.CollectibleField("environment", schema.Map(""), func(node *node.Node) error { + taskEnv, err := node.GetEnvironment() + if err != nil { + return err + } + task.Environment = environment.Merge(task.Environment, taskEnv) + return nil + }) + + parser.CollectibleField("env", schema.Map(""), func(node *node.Node) error { + taskEnv, err := node.GetEnvironment() + if err != nil { + return err + } + task.Environment = environment.Merge(task.Environment, taskEnv) + return nil + }) + + parser.OptionalField(nameable.NewSimpleNameable("name"), schema.String(""), func(node *node.Node) error { + name, err := node.GetExpandedStringValue(environment.Merge(task.Environment, env)) + if err != nil { + return err + } + task.Name = name + return nil + }) + + bgNameable := nameable.NewRegexNameable("^(.*)background_script$") + parser.OptionalField(bgNameable, schema.Script(""), func(node *node.Node) error { + command, err := handleBackgroundScript(node, bgNameable) + if err != nil { + return err + } + + task.Commands = append(task.Commands, command) + + return nil + }) + + scriptNameable := nameable.NewRegexNameable("^(.*)script$") + parser.OptionalField(scriptNameable, schema.Script(""), func(node *node.Node) error { + command, err := handleScript(node, scriptNameable) + if err != nil { + return err + } + + task.Commands = append(task.Commands, command) + + return nil + }) + + cacheNameable := nameable.NewRegexNameable("^(.*)cache$") + cacheSchema := command.NewCacheCommand(nil, nil).Schema() + parser.OptionalField(cacheNameable, cacheSchema, func(node *node.Node) error { + cache := command.NewCacheCommand(environment.Merge(task.Environment, env), boolevator) + if err := cache.Parse(node); err != nil { + return err + } + task.Commands = append(task.Commands, cache.Proto()) + return nil + }) + + artifactsNameable := nameable.NewRegexNameable("^(.*)artifacts$") + artifactsSchema := command.NewArtifactsCommand(nil).Schema() + parser.OptionalField(artifactsNameable, artifactsSchema, func(node *node.Node) error { + artifacts := command.NewArtifactsCommand(environment.Merge(task.Environment, env)) + if err := artifacts.Parse(node); err != nil { + return err + } + task.Commands = append(task.Commands, artifacts.Proto()) + return nil + }) + + fileNameable := nameable.NewRegexNameable("^(.*)file$") + fileSchema := command.NewFileCommand(nil).Schema() + parser.OptionalField(fileNameable, fileSchema, func(node *node.Node) error { + file := command.NewFileCommand(environment.Merge(task.Environment, env)) + if err := file.Parse(node); err != nil { + return err + } + task.Commands = append(task.Commands, file.Proto()) + return nil + }) + + for id, name := range api.Command_CommandExecutionBehavior_name { + idCopy := id + + behaviorSchema := NewBehavior(nil, nil).Schema() + behaviorSchema.Description = name + " commands." + parser.OptionalField(nameable.NewSimpleNameable(strings.ToLower(name)), behaviorSchema, func(node *node.Node) error { + behavior := NewBehavior(environment.Merge(task.Environment, env), boolevator) + if err := behavior.Parse(node); err != nil { + return err + } + + commands := behavior.Proto() + + for _, command := range commands { + command.ExecutionBehaviour = api.Command_CommandExecutionBehavior(idCopy) + task.Commands = append(task.Commands, command) + } + + return nil + }) + } + + parser.CollectibleField("skip", schema.Condition(""), func(node *node.Node) error { + skipped, err := node.GetBoolValue(environment.Merge(task.Environment, env), boolevator) + if err != nil { + return err + } + if skipped { + task.Status = api.Task_SKIPPED + } + return nil + }) + + parser.CollectibleField("allow_failures", schema.Condition(""), func(node *node.Node) error { + evaluation, err := node.GetBoolValue(environment.Merge(task.Environment, env), boolevator) + if err != nil { + return err + } + task.Metadata.Properties["allow_failures"] = strconv.FormatBool(evaluation) + return nil + }) + + // for cloud only + parser.CollectibleField("skip_notifications", schema.Condition(""), func(node *node.Node) error { + evaluation, err := node.GetBoolValue(environment.Merge(task.Environment, env), boolevator) + if err != nil { + return err + } + task.Metadata.Properties["skip_notifications"] = strconv.FormatBool(evaluation) + return nil + }) + + // for cloud only + parser.CollectibleField("auto_cancellation", schema.Condition(""), func(node *node.Node) error { + evaluation, err := node.GetBoolValue(environment.Merge(task.Environment, env), boolevator) + if err != nil { + return err + } + task.Metadata.Properties["auto_cancellation"] = strconv.FormatBool(evaluation) + return nil + }) + + // for cloud only + parser.CollectibleField("use_compute_credits", schema.Condition(""), func(node *node.Node) error { + evaluation, err := node.GetBoolValue(environment.Merge(task.Environment, env), boolevator) + if err != nil { + return err + } + task.Metadata.Properties["use_compute_credits"] = strconv.FormatBool(evaluation) + return nil + }) + + // for cloud only + parser.CollectibleField("stateful", schema.Condition(""), func(node *node.Node) error { + evaluation, err := node.GetBoolValue(environment.Merge(task.Environment, env), boolevator) + if err != nil { + return err + } + task.Metadata.Properties["stateful"] = strconv.FormatBool(evaluation) + return nil + }) + + // no-op + labelsSchema := schema.StringOrListOfStrings("List of required labels on a PR.") + parser.OptionalField(nameable.NewSimpleNameable("required_pr_labels"), labelsSchema, func(node *node.Node) error { + return nil + }) + + parser.CollectibleField("experimental", schema.Condition(""), func(node *node.Node) error { + evaluation, err := node.GetBoolValue(environment.Merge(task.Environment, env), boolevator) + if err != nil { + return err + } + task.Metadata.Properties["experimental"] = strconv.FormatBool(evaluation) + return nil + }) + + parser.CollectibleField("timeout_in", schema.Number("Task timeout in minutes"), func(node *node.Node) error { + timeout, err := handleTimeoutIn(node, environment.Merge(task.Environment, env)) + if err != nil { + return err + } + + task.Metadata.Properties["timeout_in"] = timeout + + return nil + }) + + parser.CollectibleField("trigger_type", schema.TriggerType(), func(node *node.Node) error { + triggerType, err := node.GetExpandedStringValue(environment.Merge(task.Environment, env)) + if err != nil { + return err + } + task.Metadata.Properties["trigger_type"] = strings.ToUpper(triggerType) + return nil + }) + + lockSchema := schema.String("Lock name for triggering and execution") + parser.OptionalField(nameable.NewSimpleNameable("execution_lock"), lockSchema, func(node *node.Node) error { + lockName, err := node.GetExpandedStringValue(environment.Merge(task.Environment, env)) + if err != nil { + return err + } + + task.Metadata.Properties["execution_lock"] = lockName + + return nil + }) +} diff --git a/pkg/parser/task/default.go b/pkg/parser/task/default.go index da1a4e84..22c7f450 100644 --- a/pkg/parser/task/default.go +++ b/pkg/parser/task/default.go @@ -2,10 +2,9 @@ package task func DefaultTaskProperties() map[string]string { return map[string]string{ - "allow_failures": "false", - "experimental": "false", - "skip_notifications": "false", - "timeout_in": "3600", - "trigger_type": "AUTOMATIC", + "allow_failures": "false", + "experimental": "false", + "timeout_in": "3600", + "trigger_type": "AUTOMATIC", } } diff --git a/pkg/parser/task/dockerbuilder.go b/pkg/parser/task/dockerbuilder.go new file mode 100644 index 00000000..90172ee3 --- /dev/null +++ b/pkg/parser/task/dockerbuilder.go @@ -0,0 +1,178 @@ +package task + +import ( + "fmt" + "github.com/cirruslabs/cirrus-ci-agent/api" + "github.com/cirruslabs/cirrus-cli/internal/executor/environment" + "github.com/cirruslabs/cirrus-cli/pkg/parser/boolevator" + "github.com/cirruslabs/cirrus-cli/pkg/parser/nameable" + "github.com/cirruslabs/cirrus-cli/pkg/parser/node" + "github.com/cirruslabs/cirrus-cli/pkg/parser/parseable" + "github.com/cirruslabs/cirrus-cli/pkg/parser/parsererror" + "github.com/cirruslabs/cirrus-cli/pkg/parser/schema" + "github.com/golang/protobuf/ptypes" + jsschema "github.com/lestrrat-go/jsschema" + "strconv" + "strings" +) + +type DockerBuilder struct { + proto api.Task + + platform api.Platform + osVersion string + + alias string + dependsOn []string + + onlyIfExpression string + + parseable.DefaultParser +} + +func NewDockerBuilder(env map[string]string, boolevator *boolevator.Boolevator) *DockerBuilder { + dbuilder := &DockerBuilder{} + + AttachBaseTaskFields(&dbuilder.DefaultParser, &dbuilder.proto, env, boolevator) + + dbuilder.proto.Environment = map[string]string{"CIRRUS_OS": "linux"} + + dbuilder.OptionalField(nameable.NewSimpleNameable("alias"), schema.String(""), func(node *node.Node) error { + name, err := node.GetExpandedStringValue(environment.Merge(dbuilder.proto.Environment, env)) + if err != nil { + return err + } + dbuilder.alias = name + return nil + }) + + dependsOnSchema := schema.StringOrListOfStrings("List of task names this task depends on.") + dbuilder.OptionalField(nameable.NewSimpleNameable("depends_on"), dependsOnSchema, func(node *node.Node) error { + dependsOn, err := node.GetSliceOfNonEmptyStrings() + if err != nil { + return err + } + dbuilder.dependsOn = dependsOn + return nil + }) + + dbuilder.CollectibleField("only_if", schema.Condition(""), func(node *node.Node) error { + onlyIfExpression, err := node.GetStringValue() + if err != nil { + return err + } + dbuilder.onlyIfExpression = onlyIfExpression + return nil + }) + + // no-op + sipSchema := schema.Condition("") + dbuilder.OptionalField(nameable.NewSimpleNameable("use_static_ip"), sipSchema, func(node *node.Node) error { + return nil + }) + + platformSchema := schema.Enum([]interface{}{"linux", "windows"}, "Container Platform.") + dbuilder.OptionalField(nameable.NewSimpleNameable("platform"), platformSchema, func(node *node.Node) error { + platformName, err := node.GetExpandedStringValue(environment.Merge(dbuilder.proto.Environment, env)) + if err != nil { + return err + } + + platformValue, ok := api.Platform_value[strings.ToUpper(platformName)] + if !ok { + return fmt.Errorf("%w: unknown platform name %q", parsererror.ErrParsing, platformName) + } + + dbuilder.platform = api.Platform(platformValue) + dbuilder.proto.Environment["CIRRUS_OS"] = platformName + + return nil + }) + + osVersionSchema := schema.Enum([]interface{}{"2019", "1709", "1803"}, "Windows version of container.") + dbuilder.OptionalField(nameable.NewSimpleNameable("os_version"), osVersionSchema, func(node *node.Node) error { + osVersion, err := node.GetExpandedStringValue(environment.Merge(dbuilder.proto.Environment, env)) + if err != nil { + return err + } + + dbuilder.osVersion = osVersion + + return nil + }) + + return dbuilder +} + +func (dbuilder *DockerBuilder) Parse(node *node.Node) error { + if err := dbuilder.DefaultParser.Parse(node); err != nil { + return err + } + + instance := &api.DockerBuilder{ + Platform: dbuilder.platform, + OsVersion: dbuilder.osVersion, + } + + anyInstance, err := ptypes.MarshalAny(instance) + if err != nil { + return err + } + + dbuilder.proto.Instance = anyInstance + + return nil +} + +func (dbuilder *DockerBuilder) Name() string { + if dbuilder.alias != "" { + return dbuilder.alias + } + + return dbuilder.proto.Name +} + +func (dbuilder *DockerBuilder) SetName(name string) { + dbuilder.proto.Name = name +} + +func (dbuilder *DockerBuilder) DependsOnNames() []string { + return dbuilder.dependsOn +} + +func (dbuilder *DockerBuilder) ID() int64 { return dbuilder.proto.LocalGroupId } +func (dbuilder *DockerBuilder) SetID(id int64) { + dbuilder.proto.LocalGroupId = id +} + +func (dbuilder *DockerBuilder) SetIndexWithinBuild(id int64) { + dbuilder.proto.Metadata.Properties["indexWithinBuild"] = strconv.FormatInt(id, 10) +} + +func (dbuilder *DockerBuilder) Proto() interface{} { + return &dbuilder.proto +} + +func (dbuilder *DockerBuilder) DependsOnIDs() []int64 { return dbuilder.proto.RequiredGroups } +func (dbuilder *DockerBuilder) SetDependsOnIDs(ids []int64) { dbuilder.proto.RequiredGroups = ids } + +func (dbuilder *DockerBuilder) Enabled(env map[string]string, boolevator *boolevator.Boolevator) (bool, error) { + if dbuilder.onlyIfExpression == "" { + return true, nil + } + + evaluation, err := boolevator.Eval(dbuilder.onlyIfExpression, environment.Merge(dbuilder.proto.Environment, env)) + if err != nil { + return false, err + } + + return evaluation, nil +} + +func (dbuilder *DockerBuilder) Schema() *jsschema.Schema { + modifiedSchema := dbuilder.DefaultParser.Schema() + + modifiedSchema.Type = jsschema.PrimitiveTypes{jsschema.ObjectType} + + return modifiedSchema +} diff --git a/pkg/parser/task/pipe.go b/pkg/parser/task/pipe.go index 1b512a2d..a31a349a 100644 --- a/pkg/parser/task/pipe.go +++ b/pkg/parser/task/pipe.go @@ -43,8 +43,10 @@ func NewDockerPipe(env map[string]string, boolevator *boolevator.Boolevator) *Do // Don't force required fields in schema pipe.SetCollectible(true) - pipe.proto.Metadata.Properties["auto_cancellation"] = - strconv.FormatBool(env["CIRRUS_BRANCH"] != env["CIRRUS_DEFAULT_BRANCH"]) + autoCancellation := env["CIRRUS_BRANCH"] != env["CIRRUS_DEFAULT_BRANCH"] + if autoCancellation { + pipe.proto.Metadata.Properties["auto_cancellation"] = strconv.FormatBool(autoCancellation) + } pipe.CollectibleField("environment", schema.Map(""), func(node *node.Node) error { pipeEnv, err := node.GetEnvironment() diff --git a/pkg/parser/task/task.go b/pkg/parser/task/task.go index 43647225..f76b0ea4 100644 --- a/pkg/parser/task/task.go +++ b/pkg/parser/task/task.go @@ -11,7 +11,6 @@ import ( "github.com/cirruslabs/cirrus-cli/pkg/parser/parseable" "github.com/cirruslabs/cirrus-cli/pkg/parser/parsererror" "github.com/cirruslabs/cirrus-cli/pkg/parser/schema" - "github.com/cirruslabs/cirrus-cli/pkg/parser/task/command" "github.com/golang/protobuf/ptypes" jsschema "github.com/lestrrat-go/jsschema" "google.golang.org/protobuf/reflect/protoreflect" @@ -31,38 +30,17 @@ type Task struct { parseable.DefaultParser } -// nolint:gocognit,gocyclo // it's a parser, there is a lot of boilerplate func NewTask( env map[string]string, boolevator *boolevator.Boolevator, additionalInstances map[string]protoreflect.MessageDescriptor, ) *Task { task := &Task{} - task.proto.Metadata = &api.Task_Metadata{Properties: DefaultTaskProperties()} // Don't force required fields in schema task.SetCollectible(true) - task.proto.Metadata.Properties["auto_cancellation"] = - strconv.FormatBool(env["CIRRUS_BRANCH"] != env["CIRRUS_DEFAULT_BRANCH"]) - - task.CollectibleField("environment", schema.Map(""), func(node *node.Node) error { - taskEnv, err := node.GetEnvironment() - if err != nil { - return err - } - task.proto.Environment = environment.Merge(task.proto.Environment, taskEnv) - return nil - }) - - task.CollectibleField("env", schema.Map(""), func(node *node.Node) error { - taskEnv, err := node.GetEnvironment() - if err != nil { - return err - } - task.proto.Environment = environment.Merge(task.proto.Environment, taskEnv) - return nil - }) + AttachBaseTaskFields(&task.DefaultParser, &task.proto, env, boolevator) if _, ok := additionalInstances["container"]; !ok { task.CollectibleField("container", @@ -135,15 +113,6 @@ func NewTask( }) } - task.OptionalField(nameable.NewSimpleNameable("name"), schema.String(""), func(node *node.Node) error { - name, err := node.GetExpandedStringValue(environment.Merge(task.proto.Environment, env)) - if err != nil { - return err - } - task.proto.Name = name - return nil - }) - task.OptionalField(nameable.NewSimpleNameable("alias"), schema.String(""), func(node *node.Node) error { name, err := node.GetExpandedStringValue(environment.Merge(task.proto.Environment, env)) if err != nil { @@ -153,65 +122,6 @@ func NewTask( return nil }) - bgNameable := nameable.NewRegexNameable("^(.*)background_script$") - task.OptionalField(bgNameable, schema.Script(""), func(node *node.Node) error { - command, err := handleBackgroundScript(node, bgNameable) - if err != nil { - return err - } - - task.proto.Commands = append(task.proto.Commands, command) - - return nil - }) - - scriptNameable := nameable.NewRegexNameable("^(.*)script$") - task.OptionalField(scriptNameable, schema.Script(""), func(node *node.Node) error { - command, err := handleScript(node, scriptNameable) - if err != nil { - return err - } - - task.proto.Commands = append(task.proto.Commands, command) - - return nil - }) - - cacheNameable := nameable.NewRegexNameable("^(.*)cache$") - cacheSchema := command.NewCacheCommand(nil, nil).Schema() - task.OptionalField(cacheNameable, cacheSchema, func(node *node.Node) error { - cache := command.NewCacheCommand(environment.Merge(task.proto.Environment, env), boolevator) - if err := cache.Parse(node); err != nil { - return err - } - task.proto.Commands = append(task.proto.Commands, cache.Proto()) - return nil - }) - - artifactsNameable := nameable.NewRegexNameable("^(.*)artifacts$") - artifactsSchema := command.NewArtifactsCommand(nil).Schema() - task.OptionalField(artifactsNameable, artifactsSchema, func(node *node.Node) error { - artifacts := command.NewArtifactsCommand(environment.Merge(task.proto.Environment, env)) - if err := artifacts.Parse(node); err != nil { - return err - } - task.proto.Commands = append(task.proto.Commands, artifacts.Proto()) - return nil - }) - - fileNameable := nameable.NewRegexNameable("^(.*)file$") - fileSchema := command.NewFileCommand(nil).Schema() - task.OptionalField(fileNameable, fileSchema, func(node *node.Node) error { - file := command.NewFileCommand(environment.Merge(task.proto.Environment, env)) - if err := file.Parse(node); err != nil { - return err - } - task.proto.Commands = append(task.proto.Commands, file.Proto()) - return nil - }) - - task.registerExecutionBehaviorFields(env, boolevator) - dependsOnSchema := schema.StringOrListOfStrings("List of task names this task depends on.") task.OptionalField(nameable.NewSimpleNameable("depends_on"), dependsOnSchema, func(node *node.Node) error { dependsOn, err := node.GetSliceOfNonEmptyStrings() @@ -231,113 +141,6 @@ func NewTask( return nil }) - task.CollectibleField("skip", schema.Condition(""), func(node *node.Node) error { - skipped, err := node.GetBoolValue(environment.Merge(task.proto.Environment, env), boolevator) - if err != nil { - return err - } - if skipped { - task.proto.Status = api.Task_SKIPPED - } - return nil - }) - - task.CollectibleField("allow_failures", schema.Condition(""), func(node *node.Node) error { - evaluation, err := node.GetBoolValue(environment.Merge(task.proto.Environment, env), boolevator) - if err != nil { - return err - } - task.proto.Metadata.Properties["allow_failures"] = strconv.FormatBool(evaluation) - return nil - }) - - // for cloud only - task.CollectibleField("skip_notifications", schema.Condition(""), func(node *node.Node) error { - evaluation, err := node.GetBoolValue(environment.Merge(task.proto.Environment, env), boolevator) - if err != nil { - return err - } - task.proto.Metadata.Properties["skip_notifications"] = strconv.FormatBool(evaluation) - return nil - }) - - // for cloud only - task.CollectibleField("auto_cancellation", schema.Condition(""), func(node *node.Node) error { - evaluation, err := node.GetBoolValue(environment.Merge(task.proto.Environment, env), boolevator) - if err != nil { - return err - } - task.proto.Metadata.Properties["auto_cancellation"] = strconv.FormatBool(evaluation) - return nil - }) - - // for cloud only - task.CollectibleField("use_compute_credits", schema.Condition(""), func(node *node.Node) error { - evaluation, err := node.GetBoolValue(environment.Merge(task.proto.Environment, env), boolevator) - if err != nil { - return err - } - task.proto.Metadata.Properties["use_compute_credits"] = strconv.FormatBool(evaluation) - return nil - }) - - // for cloud only - task.CollectibleField("stateful", schema.Condition(""), func(node *node.Node) error { - evaluation, err := node.GetBoolValue(environment.Merge(task.proto.Environment, env), boolevator) - if err != nil { - return err - } - task.proto.Metadata.Properties["stateful"] = strconv.FormatBool(evaluation) - return nil - }) - - // no-op - labelsSchema := schema.StringOrListOfStrings("List of required labels on a PR.") - task.OptionalField(nameable.NewSimpleNameable("required_pr_labels"), labelsSchema, func(node *node.Node) error { - return nil - }) - - task.CollectibleField("experimental", schema.Condition(""), func(node *node.Node) error { - evaluation, err := node.GetBoolValue(environment.Merge(task.proto.Environment, env), boolevator) - if err != nil { - return err - } - task.proto.Metadata.Properties["experimental"] = strconv.FormatBool(evaluation) - return nil - }) - - task.CollectibleField("timeout_in", schema.Number("Task timeout in minutes"), func(node *node.Node) error { - timeout, err := handleTimeoutIn(node, environment.Merge(task.proto.Environment, env)) - if err != nil { - return err - } - - task.proto.Metadata.Properties["timeout_in"] = timeout - - return nil - }) - - task.CollectibleField("trigger_type", schema.TriggerType(), func(node *node.Node) error { - triggerType, err := node.GetExpandedStringValue(environment.Merge(task.proto.Environment, env)) - if err != nil { - return err - } - task.proto.Metadata.Properties["trigger_type"] = strings.ToUpper(triggerType) - return nil - }) - - lockSchema := schema.String("Lock name for triggering and execution") - task.OptionalField(nameable.NewSimpleNameable("execution_lock"), lockSchema, func(node *node.Node) error { - lockName, err := node.GetExpandedStringValue(environment.Merge(task.proto.Environment, env)) - if err != nil { - return err - } - - task.proto.Metadata.Properties["execution_lock"] = lockName - - return nil - }) - return task } @@ -418,30 +221,6 @@ func (task *Task) Enabled(env map[string]string, boolevator *boolevator.Boolevat return evaluation, nil } -func (task *Task) registerExecutionBehaviorFields(env map[string]string, boolevator *boolevator.Boolevator) { - for id, name := range api.Command_CommandExecutionBehavior_name { - idCopy := id - - behaviorSchema := NewBehavior(nil, nil).Schema() - behaviorSchema.Description = name + " commands." - task.OptionalField(nameable.NewSimpleNameable(strings.ToLower(name)), behaviorSchema, func(node *node.Node) error { - behavior := NewBehavior(environment.Merge(task.proto.Environment, env), boolevator) - if err := behavior.Parse(node); err != nil { - return err - } - - commands := behavior.Proto() - - for _, command := range commands { - command.ExecutionBehaviour = api.Command_CommandExecutionBehavior(idCopy) - task.proto.Commands = append(task.proto.Commands, command) - } - - return nil - }) - } -} - func (task *Task) Schema() *jsschema.Schema { modifiedSchema := task.DefaultParser.Schema() diff --git a/pkg/parser/testdata/cirrus.json b/pkg/parser/testdata/cirrus.json index ec11b05c..fb8bada7 100644 --- a/pkg/parser/testdata/cirrus.json +++ b/pkg/parser/testdata/cirrus.json @@ -670,7 +670,8 @@ "type": "string" }, "use_static_ip": { - "type": "boolean" + "description": "Boolean expression that can use environment variables.", + "type": "string" } }, "type": "object" @@ -2774,7 +2775,8 @@ "type": "string" }, "use_static_ip": { - "type": "boolean" + "description": "Boolean expression that can use environment variables.", + "type": "string" } }, "type": "object" @@ -4072,7 +4074,8 @@ "type": "string" }, "use_static_ip": { - "type": "boolean" + "description": "Boolean expression that can use environment variables.", + "type": "string" } }, "type": "object" diff --git a/pkg/parser/testdata/example-android.json b/pkg/parser/testdata/example-android.json index 08430a3b..6676500a 100644 --- a/pkg/parser/testdata/example-android.json +++ b/pkg/parser/testdata/example-android.json @@ -51,10 +51,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/example-flutter-web.json b/pkg/parser/testdata/example-flutter-web.json index a4f7226e..29de42b4 100644 --- a/pkg/parser/testdata/example-flutter-web.json +++ b/pkg/parser/testdata/example-flutter-web.json @@ -26,10 +26,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/example-mysql.json b/pkg/parser/testdata/example-mysql.json index ac6f6dd7..f19ec552 100644 --- a/pkg/parser/testdata/example-mysql.json +++ b/pkg/parser/testdata/example-mysql.json @@ -38,10 +38,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/example-rust.json b/pkg/parser/testdata/example-rust.json index ff91c7f0..39dd9d0f 100644 --- a/pkg/parser/testdata/example-rust.json +++ b/pkg/parser/testdata/example-rust.json @@ -57,10 +57,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -129,10 +127,8 @@ "metadata": { "properties": { "allow_failures": "true", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, diff --git a/pkg/parser/testdata/instance-persistent_worker.json b/pkg/parser/testdata/instance-persistent_worker.json index 84bd3f55..4d13a589 100644 --- a/pkg/parser/testdata/instance-persistent_worker.json +++ b/pkg/parser/testdata/instance-persistent_worker.json @@ -29,10 +29,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/proto-instance.json b/pkg/parser/testdata/proto-instance.json index 9fd0cd0c..9b47d4ef 100644 --- a/pkg/parser/testdata/proto-instance.json +++ b/pkg/parser/testdata/proto-instance.json @@ -29,10 +29,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -70,10 +68,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/aliases-many.json b/pkg/parser/testdata/via-rpc/aliases-many.json index 5b43e099..060004b0 100644 --- a/pkg/parser/testdata/via-rpc/aliases-many.json +++ b/pkg/parser/testdata/via-rpc/aliases-many.json @@ -66,10 +66,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "1800", "trigger_type": "AUTOMATIC" } @@ -97,10 +95,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "1800", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/artifacts-simple.json b/pkg/parser/testdata/via-rpc/artifacts-simple.json index 21098e20..c5f93edf 100644 --- a/pkg/parser/testdata/via-rpc/artifacts-simple.json +++ b/pkg/parser/testdata/via-rpc/artifacts-simple.json @@ -36,10 +36,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/cache-reupload.json b/pkg/parser/testdata/via-rpc/cache-reupload.json index f6797fc3..5488fb24 100644 --- a/pkg/parser/testdata/via-rpc/cache-reupload.json +++ b/pkg/parser/testdata/via-rpc/cache-reupload.json @@ -43,10 +43,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/cache-simpleGradle.json b/pkg/parser/testdata/via-rpc/cache-simpleGradle.json index 3aacf65c..be403cb3 100644 --- a/pkg/parser/testdata/via-rpc/cache-simpleGradle.json +++ b/pkg/parser/testdata/via-rpc/cache-simpleGradle.json @@ -52,10 +52,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/cache-simpleYarn.json b/pkg/parser/testdata/via-rpc/cache-simpleYarn.json index 9a70b373..c20cee51 100644 --- a/pkg/parser/testdata/via-rpc/cache-simpleYarn.json +++ b/pkg/parser/testdata/via-rpc/cache-simpleYarn.json @@ -44,10 +44,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/condition-branch.json b/pkg/parser/testdata/via-rpc/condition-branch.json index ba09fa2c..fcc7ee28 100644 --- a/pkg/parser/testdata/via-rpc/condition-branch.json +++ b/pkg/parser/testdata/via-rpc/condition-branch.json @@ -30,7 +30,6 @@ "auto_cancellation": "true", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/condition-cancelation.json b/pkg/parser/testdata/via-rpc/condition-cancelation.json index 6fee68fb..966c9a67 100644 --- a/pkg/parser/testdata/via-rpc/condition-cancelation.json +++ b/pkg/parser/testdata/via-rpc/condition-cancelation.json @@ -21,7 +21,6 @@ "auto_cancellation": "true", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/condition-global.json b/pkg/parser/testdata/via-rpc/condition-global.json index 9a98f029..61ecc810 100644 --- a/pkg/parser/testdata/via-rpc/condition-global.json +++ b/pkg/parser/testdata/via-rpc/condition-global.json @@ -29,7 +29,6 @@ "auto_cancellation": "true", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/condition-masterBranch.json b/pkg/parser/testdata/via-rpc/condition-masterBranch.json index 8bd4220a..b5bfbd8e 100644 --- a/pkg/parser/testdata/via-rpc/condition-masterBranch.json +++ b/pkg/parser/testdata/via-rpc/condition-masterBranch.json @@ -27,10 +27,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -66,10 +64,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/container_build-arguments.json b/pkg/parser/testdata/via-rpc/container_build-arguments.json index aa134cc3..95a4c834 100644 --- a/pkg/parser/testdata/via-rpc/container_build-arguments.json +++ b/pkg/parser/testdata/via-rpc/container_build-arguments.json @@ -32,10 +32,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -85,7 +83,6 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", "skip_notifications": "true", diff --git a/pkg/parser/testdata/via-rpc/container_build-complexArguments.json b/pkg/parser/testdata/via-rpc/container_build-complexArguments.json index 8fc45bea..17ac84b7 100644 --- a/pkg/parser/testdata/via-rpc/container_build-complexArguments.json +++ b/pkg/parser/testdata/via-rpc/container_build-complexArguments.json @@ -30,10 +30,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -78,10 +76,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -133,7 +129,6 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "2", "skip_notifications": "true", @@ -182,7 +177,6 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "3", "skip_notifications": "true", diff --git a/pkg/parser/testdata/via-rpc/container_build-context.json b/pkg/parser/testdata/via-rpc/container_build-context.json index ebe9e0d1..a23da14a 100644 --- a/pkg/parser/testdata/via-rpc/container_build-context.json +++ b/pkg/parser/testdata/via-rpc/container_build-context.json @@ -29,10 +29,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "7200", "trigger_type": "AUTOMATIC" } @@ -79,7 +77,6 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", "skip_notifications": "true", diff --git a/pkg/parser/testdata/via-rpc/container_build-simple.json b/pkg/parser/testdata/via-rpc/container_build-simple.json index eebc9a10..1a8b30d7 100644 --- a/pkg/parser/testdata/via-rpc/container_build-simple.json +++ b/pkg/parser/testdata/via-rpc/container_build-simple.json @@ -28,10 +28,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -77,7 +75,6 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", "skip_notifications": "true", diff --git a/pkg/parser/testdata/via-rpc/container_build-twoTasksSameContainer.json b/pkg/parser/testdata/via-rpc/container_build-twoTasksSameContainer.json index 4011db1f..f93a9d2e 100644 --- a/pkg/parser/testdata/via-rpc/container_build-twoTasksSameContainer.json +++ b/pkg/parser/testdata/via-rpc/container_build-twoTasksSameContainer.json @@ -27,10 +27,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -69,10 +67,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -118,7 +114,6 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "2", "skip_notifications": "true", diff --git a/pkg/parser/testdata/via-rpc/docker_build-basic.json b/pkg/parser/testdata/via-rpc/docker_build-basic.json new file mode 100644 index 00000000..4570997a --- /dev/null +++ b/pkg/parser/testdata/via-rpc/docker_build-basic.json @@ -0,0 +1,118 @@ +[ + { + "commands": [ + { + "cloneInstruction": {}, + "name": "clone" + }, + { + "name": "main", + "scriptInstruction": { + "scripts": [ + "./test.sh" + ] + } + } + ], + "environment": { + "CIRRUS_OS": "linux" + }, + "instance": { + "@type": "type.googleapis.com/org.cirruslabs.ci.services.cirruscigrpc.ContainerInstance", + "cpu": 2, + "image": "memcached:1.5.0-alpine", + "memory": 4096 + }, + "metadata": { + "properties": { + "allow_failures": "false", + "experimental": "false", + "indexWithinBuild": "0", + "timeout_in": "3600", + "trigger_type": "AUTOMATIC" + } + }, + "name": "test" + }, + { + "commands": [ + { + "cloneInstruction": {}, + "name": "clone" + }, + { + "name": "main", + "scriptInstruction": { + "scripts": [ + "./lint.sh" + ] + } + } + ], + "environment": { + "CIRRUS_OS": "linux" + }, + "instance": { + "@type": "type.googleapis.com/org.cirruslabs.ci.services.cirruscigrpc.ContainerInstance", + "cpu": 2, + "image": "memcached:1.5.0-alpine", + "memory": 4096 + }, + "localGroupId": "1", + "metadata": { + "properties": { + "allow_failures": "false", + "experimental": "false", + "indexWithinBuild": "1", + "timeout_in": "3600", + "trigger_type": "AUTOMATIC" + } + }, + "name": "lint" + }, + { + "commands": [ + { + "cloneInstruction": {}, + "name": "clone" + }, + { + "name": "build", + "scriptInstruction": { + "scripts": [ + "docker build --tag cirrusci/test:latest ." + ] + } + }, + { + "name": "push", + "scriptInstruction": { + "scripts": [ + "docker push cirrusci/test:latest" + ] + } + } + ], + "environment": { + "CIRRUS_OS": "linux" + }, + "instance": { + "@type": "type.googleapis.com/org.cirruslabs.ci.services.cirruscigrpc.DockerBuilder" + }, + "localGroupId": "2", + "metadata": { + "properties": { + "allow_failures": "false", + "experimental": "false", + "indexWithinBuild": "2", + "timeout_in": "3600", + "trigger_type": "AUTOMATIC" + } + }, + "name": "deploy", + "requiredGroups": [ + "0", + "1" + ] + } +] diff --git a/pkg/parser/testdata/via-rpc/docker_build-basic.yml b/pkg/parser/testdata/via-rpc/docker_build-basic.yml new file mode 100644 index 00000000..eab8e70b --- /dev/null +++ b/pkg/parser/testdata/via-rpc/docker_build-basic.yml @@ -0,0 +1,15 @@ +container: + image: memcached:1.5.0-alpine + +test_task: + script: ./test.sh + +lint_task: + script: ./lint.sh + +deploy_docker_builder: + depends_on: + - test + - lint + build_script: docker build --tag cirrusci/test:latest . + push_script: docker push cirrusci/test:latest diff --git a/pkg/parser/testdata/via-rpc/docker_build-matrix.json b/pkg/parser/testdata/via-rpc/docker_build-matrix.json new file mode 100644 index 00000000..01a631f6 --- /dev/null +++ b/pkg/parser/testdata/via-rpc/docker_build-matrix.json @@ -0,0 +1,173 @@ +[ + { + "commands": [ + { + "cloneInstruction": {}, + "name": "clone" + }, + { + "name": "build", + "scriptInstruction": { + "scripts": [ + "./$TARGET/build_docker.sh" + ] + } + }, + { + "name": "push", + "scriptInstruction": { + "scripts": [ + "./$TARGET/push_docker.sh" + ] + } + } + ], + "environment": { + "CIRRUS_OS": "linux", + "TARGET": "android" + }, + "instance": { + "@type": "type.googleapis.com/org.cirruslabs.ci.services.cirruscigrpc.DockerBuilder" + }, + "metadata": { + "properties": { + "allow_failures": "false", + "experimental": "false", + "indexWithinBuild": "0", + "timeout_in": "3600", + "trigger_type": "AUTOMATIC" + } + }, + "name": "android" + }, + { + "commands": [ + { + "cloneInstruction": {}, + "name": "clone" + }, + { + "name": "build", + "scriptInstruction": { + "scripts": [ + "./$TARGET/build_docker.sh" + ] + } + }, + { + "name": "push", + "scriptInstruction": { + "scripts": [ + "./$TARGET/push_docker.sh" + ] + } + } + ], + "environment": { + "CIRRUS_OS": "linux", + "TARGET": "bazel" + }, + "instance": { + "@type": "type.googleapis.com/org.cirruslabs.ci.services.cirruscigrpc.DockerBuilder" + }, + "localGroupId": "1", + "metadata": { + "properties": { + "allow_failures": "false", + "experimental": "false", + "indexWithinBuild": "1", + "timeout_in": "3600", + "trigger_type": "AUTOMATIC" + } + }, + "name": "bazel" + }, + { + "commands": [ + { + "cloneInstruction": {}, + "name": "clone" + }, + { + "name": "build", + "scriptInstruction": { + "scripts": [ + "./$TARGET/build_docker.sh" + ] + } + }, + { + "name": "push", + "scriptInstruction": { + "scripts": [ + "./$TARGET/push_docker.sh" + ] + } + } + ], + "environment": { + "CIRRUS_OS": "linux", + "TARGET": "flutter" + }, + "instance": { + "@type": "type.googleapis.com/org.cirruslabs.ci.services.cirruscigrpc.DockerBuilder" + }, + "localGroupId": "2", + "metadata": { + "properties": { + "allow_failures": "false", + "experimental": "false", + "indexWithinBuild": "2", + "timeout_in": "3600", + "trigger_type": "AUTOMATIC" + } + }, + "name": "flutter", + "requiredGroups": [ + "0" + ] + }, + { + "commands": [ + { + "cloneInstruction": {}, + "name": "clone" + }, + { + "name": "build", + "scriptInstruction": { + "scripts": [ + "./$TARGET/build_docker.sh" + ] + } + }, + { + "name": "push", + "scriptInstruction": { + "scripts": [ + "./$TARGET/push_docker.sh" + ] + } + } + ], + "environment": { + "CIRRUS_OS": "windows" + }, + "instance": { + "@type": "type.googleapis.com/org.cirruslabs.ci.services.cirruscigrpc.DockerBuilder", + "osVersion": "1803", + "platform": "WINDOWS" + }, + "localGroupId": "3", + "metadata": { + "properties": { + "allow_failures": "false", + "experimental": "false", + "indexWithinBuild": "3", + "timeout_in": "3600", + "trigger_type": "AUTOMATIC" + } + }, + "name": "windows" + } +] diff --git a/pkg/parser/testdata/via-rpc/docker_build-matrix.yml b/pkg/parser/testdata/via-rpc/docker_build-matrix.yml new file mode 100644 index 00000000..1bdf40c5 --- /dev/null +++ b/pkg/parser/testdata/via-rpc/docker_build-matrix.yml @@ -0,0 +1,17 @@ +docker_builder: + matrix: + - name: android + environment: + TARGET: android + - name: bazel + environment: + TARGET: bazel + - name: flutter + depends_on: android + environment: + TARGET: flutter + - name: windows + platform: windows + os_version: 1803 + build_script: ./$TARGET/build_docker.sh + push_script: ./$TARGET/push_docker.sh diff --git a/pkg/parser/testdata/via-rpc/environment-complex.json b/pkg/parser/testdata/via-rpc/environment-complex.json index 8ccf65da..209b596d 100644 --- a/pkg/parser/testdata/via-rpc/environment-complex.json +++ b/pkg/parser/testdata/via-rpc/environment-complex.json @@ -35,10 +35,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -77,10 +75,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -119,10 +115,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "2", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/environment-complex2.json b/pkg/parser/testdata/via-rpc/environment-complex2.json index 0ecf2731..8cb7ad87 100644 --- a/pkg/parser/testdata/via-rpc/environment-complex2.json +++ b/pkg/parser/testdata/via-rpc/environment-complex2.json @@ -35,10 +35,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -90,10 +88,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -151,10 +147,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "2", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -212,10 +206,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "3", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, diff --git a/pkg/parser/testdata/via-rpc/environment-complex3.json b/pkg/parser/testdata/via-rpc/environment-complex3.json index e0d3c1ab..0113848c 100644 --- a/pkg/parser/testdata/via-rpc/environment-complex3.json +++ b/pkg/parser/testdata/via-rpc/environment-complex3.json @@ -28,10 +28,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/environment-complex4.json b/pkg/parser/testdata/via-rpc/environment-complex4.json index bd2fcf10..1ac6ef91 100644 --- a/pkg/parser/testdata/via-rpc/environment-complex4.json +++ b/pkg/parser/testdata/via-rpc/environment-complex4.json @@ -102,10 +102,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -155,7 +153,6 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", "skip_notifications": "true", diff --git a/pkg/parser/testdata/via-rpc/environment-complex5.json b/pkg/parser/testdata/via-rpc/environment-complex5.json index a40160bd..9d8d8f21 100644 --- a/pkg/parser/testdata/via-rpc/environment-complex5.json +++ b/pkg/parser/testdata/via-rpc/environment-complex5.json @@ -47,10 +47,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/environment-simple.json b/pkg/parser/testdata/via-rpc/environment-simple.json index 3cc72551..8e7520bf 100644 --- a/pkg/parser/testdata/via-rpc/environment-simple.json +++ b/pkg/parser/testdata/via-rpc/environment-simple.json @@ -28,10 +28,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/environment-simpleOverride.json b/pkg/parser/testdata/via-rpc/environment-simpleOverride.json index 836a41df..2531be4a 100644 --- a/pkg/parser/testdata/via-rpc/environment-simpleOverride.json +++ b/pkg/parser/testdata/via-rpc/environment-simpleOverride.json @@ -28,10 +28,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/execution-behavior.json b/pkg/parser/testdata/via-rpc/execution-behavior.json index 1134ff04..e502709d 100644 --- a/pkg/parser/testdata/via-rpc/execution-behavior.json +++ b/pkg/parser/testdata/via-rpc/execution-behavior.json @@ -77,11 +77,9 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "execution_lock": "master", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/file-kaniko.json b/pkg/parser/testdata/via-rpc/file-kaniko.json index beec1d9d..e5f72ed4 100644 --- a/pkg/parser/testdata/via-rpc/file-kaniko.json +++ b/pkg/parser/testdata/via-rpc/file-kaniko.json @@ -36,10 +36,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/matrix-complex.json b/pkg/parser/testdata/via-rpc/matrix-complex.json index e30feb97..f3c427dd 100644 --- a/pkg/parser/testdata/via-rpc/matrix-complex.json +++ b/pkg/parser/testdata/via-rpc/matrix-complex.json @@ -56,10 +56,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -129,10 +127,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -203,10 +199,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "2", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -277,10 +271,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "3", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, diff --git a/pkg/parser/testdata/via-rpc/matrix-env.json b/pkg/parser/testdata/via-rpc/matrix-env.json index cf768bba..a8e018a7 100644 --- a/pkg/parser/testdata/via-rpc/matrix-env.json +++ b/pkg/parser/testdata/via-rpc/matrix-env.json @@ -28,10 +28,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -72,10 +70,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -116,10 +112,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "2", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -160,10 +154,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "3", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, diff --git a/pkg/parser/testdata/via-rpc/matrix-nested.json b/pkg/parser/testdata/via-rpc/matrix-nested.json index 00ffa740..d4925d42 100644 --- a/pkg/parser/testdata/via-rpc/matrix-nested.json +++ b/pkg/parser/testdata/via-rpc/matrix-nested.json @@ -44,10 +44,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -100,10 +98,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -156,10 +152,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "2", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -212,10 +206,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "3", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -268,10 +260,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "4", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -327,10 +317,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "5", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, @@ -386,10 +374,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "6", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }, diff --git a/pkg/parser/testdata/via-rpc/matrix-puppeteer.json b/pkg/parser/testdata/via-rpc/matrix-puppeteer.json index 19fb14ce..ecce7105 100644 --- a/pkg/parser/testdata/via-rpc/matrix-puppeteer.json +++ b/pkg/parser/testdata/via-rpc/matrix-puppeteer.json @@ -44,10 +44,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -119,10 +117,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -169,7 +165,6 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "2", "skip_notifications": "true", @@ -216,7 +211,6 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "3", "skip_notifications": "true", diff --git a/pkg/parser/testdata/via-rpc/matrix-script.json b/pkg/parser/testdata/via-rpc/matrix-script.json index 4cfd65f6..c64c88fa 100644 --- a/pkg/parser/testdata/via-rpc/matrix-script.json +++ b/pkg/parser/testdata/via-rpc/matrix-script.json @@ -26,10 +26,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -64,10 +62,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/pipe-simple.json b/pkg/parser/testdata/via-rpc/pipe-simple.json index 93b16fa6..e81e9d2e 100644 --- a/pkg/parser/testdata/via-rpc/pipe-simple.json +++ b/pkg/parser/testdata/via-rpc/pipe-simple.json @@ -47,10 +47,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/simple-additionalContainers.json b/pkg/parser/testdata/via-rpc/simple-additionalContainers.json index 4b5a2029..f064f1dc 100644 --- a/pkg/parser/testdata/via-rpc/simple-additionalContainers.json +++ b/pkg/parser/testdata/via-rpc/simple-additionalContainers.json @@ -60,10 +60,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/simple-aliases.json b/pkg/parser/testdata/via-rpc/simple-aliases.json index 0bb08922..fb2fbb3b 100644 --- a/pkg/parser/testdata/via-rpc/simple-aliases.json +++ b/pkg/parser/testdata/via-rpc/simple-aliases.json @@ -44,10 +44,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -101,10 +99,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/simple-makisu.json b/pkg/parser/testdata/via-rpc/simple-makisu.json index 6a57a62c..cb34751d 100644 --- a/pkg/parser/testdata/via-rpc/simple-makisu.json +++ b/pkg/parser/testdata/via-rpc/simple-makisu.json @@ -28,10 +28,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/simple-multiline.json b/pkg/parser/testdata/via-rpc/simple-multiline.json index e8063a87..5771c6bf 100644 --- a/pkg/parser/testdata/via-rpc/simple-multiline.json +++ b/pkg/parser/testdata/via-rpc/simple-multiline.json @@ -28,10 +28,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/simple-registryConfigs.json b/pkg/parser/testdata/via-rpc/simple-registryConfigs.json index 0c9f4635..843a734d 100644 --- a/pkg/parser/testdata/via-rpc/simple-registryConfigs.json +++ b/pkg/parser/testdata/via-rpc/simple-registryConfigs.json @@ -18,10 +18,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/simple-simpleBackground.json b/pkg/parser/testdata/via-rpc/simple-simpleBackground.json index c496e554..9a72ec63 100644 --- a/pkg/parser/testdata/via-rpc/simple-simpleBackground.json +++ b/pkg/parser/testdata/via-rpc/simple-simpleBackground.json @@ -26,10 +26,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/simple-simplePants.json b/pkg/parser/testdata/via-rpc/simple-simplePants.json index 5168862d..be9c0501 100644 --- a/pkg/parser/testdata/via-rpc/simple-simplePants.json +++ b/pkg/parser/testdata/via-rpc/simple-simplePants.json @@ -26,10 +26,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/simple-singleContainer.json b/pkg/parser/testdata/via-rpc/simple-singleContainer.json index 309a480e..bc71c74e 100644 --- a/pkg/parser/testdata/via-rpc/simple-singleContainer.json +++ b/pkg/parser/testdata/via-rpc/simple-singleContainer.json @@ -27,10 +27,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/simple-taskAliasDependencies.json b/pkg/parser/testdata/via-rpc/simple-taskAliasDependencies.json index 86167419..eb2b15b7 100644 --- a/pkg/parser/testdata/via-rpc/simple-taskAliasDependencies.json +++ b/pkg/parser/testdata/via-rpc/simple-taskAliasDependencies.json @@ -27,10 +27,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -66,10 +64,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -105,10 +101,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "2", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } diff --git a/pkg/parser/testdata/via-rpc/simple-taskDependencies.json b/pkg/parser/testdata/via-rpc/simple-taskDependencies.json index b37035f6..d8e52a92 100644 --- a/pkg/parser/testdata/via-rpc/simple-taskDependencies.json +++ b/pkg/parser/testdata/via-rpc/simple-taskDependencies.json @@ -26,10 +26,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -64,10 +62,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" } @@ -105,10 +101,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "2", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "MANUAL" } diff --git a/pkg/parser/testdata/via-rpc/simple-topLevelDefinitions.json b/pkg/parser/testdata/via-rpc/simple-topLevelDefinitions.json index b7a1c5ce..35a0bb39 100644 --- a/pkg/parser/testdata/via-rpc/simple-topLevelDefinitions.json +++ b/pkg/parser/testdata/via-rpc/simple-topLevelDefinitions.json @@ -26,7 +26,6 @@ "metadata": { "properties": { "allow_failures": "true", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", "skip_notifications": "true", diff --git a/pkg/parser/testdata/via-rpc/simple-twoTasks.json b/pkg/parser/testdata/via-rpc/simple-twoTasks.json index f29be19c..604a66e5 100644 --- a/pkg/parser/testdata/via-rpc/simple-twoTasks.json +++ b/pkg/parser/testdata/via-rpc/simple-twoTasks.json @@ -26,10 +26,8 @@ "metadata": { "properties": { "allow_failures": "false", - "auto_cancellation": "false", "experimental": "false", "indexWithinBuild": "0", - "skip_notifications": "false", "timeout_in": "600", "trigger_type": "AUTOMATIC" } @@ -64,10 +62,8 @@ "metadata": { "properties": { "allow_failures": "true", - "auto_cancellation": "false", "experimental": "true", "indexWithinBuild": "1", - "skip_notifications": "false", "timeout_in": "3600", "trigger_type": "AUTOMATIC" }