Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group / Switch Statement Interactions #603

Open
rebeccaskinner opened this issue Feb 23, 2017 · 0 comments
Open

Group / Switch Statement Interactions #603

rebeccaskinner opened this issue Feb 23, 2017 · 0 comments
Labels
Milestone

Comments

@rebeccaskinner
Copy link
Contributor

There are some subtle bugs in the interaction between groups and switch statements. This can possibly be addressed more cleanly now that the switch code has been refactored to store conditional information in the node metadata, but it's going to require some deep dives to deal with the interactions.

Example broken case:

param "p" {
  default = "1"
}

task.query "grp-a-a" {
  query = "echo a"
  group = "grp-a"
}

task.query "grp-b" {
  query = "echo b"
  group = "grp-b"
}

switch "foo" {
  case "{{eq `0` (param `p`)}}" "case-0" {
    task.query "case-0" {
      query = "echo 'case 0'"
    }

    task.query "case-0-group-a" {
      query = "echo 'case-0-group-a'"
      group = "grp-a"
    }

    task.query "case-0-group-b" {
      query = "echo 'case-0-group-b'"
      group = "grp-b"
    }

    task.query "case-0-group-a-dep-b" {
      query   = "echo 'case-0-group-a-dep-b'"
      group   = "grp-a"
      depends = ["task.query.case-0-group-b"]
    }

    task.query "case-0-deps-ab" {
      query   = "echo 'case-0-deps-ab'"
      depends = ["task.query.case-0-group-a", "task.query.case-0-group-b"]
    }
  }

  default {
    task.query "default" {
      query = "echo default"
    }

    task.query "default-group-a" {
      query = "echo 'default-group-a'"
      group = "grp-a"
    }

    task.query "default-group-b" {
      query = "echo 'default-group-b'"
      group = "grp-b"
    }

    task.query "default-group-a-dep-b" {
      query   = "echo 'default-group-a-dep-b'"
      group   = "grp-a"
      depends = ["task.query.default-group-b"]
    }

    task.query "case-0-deps-ab" {
      query   = "echo 'default-deps-ab'"
      depends = ["task.query.default-group-a", "task.query.default-group-b"]
    }
  }
}
@arichardet arichardet added this to the 0.7.0 milestone Mar 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants