8000 Parameter name conflicts with task name · Issue #119 · mumoshu/variant · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Parameter name conflicts with task name #119

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

Open
Nuru opened this issue Aug 23, 2019 · 1 comment
Open

Parameter name conflicts with task name #119

Nuru opened this issue Aug 23, 2019 · 1 comment
Labels

Comments

@Nuru
Copy link
Nuru commented Aug 23, 2019

In variant 0.33.0, having a parameter in one task and another task with the same name does not work right.

With file named x containing:

#!/usr/bin/variant
tasks:
  major:
    description: "Task with subtasks"
    tasks:
      subtask:
        description: "subtask"
        parameters:
        - name: namespace
          description: "Namespace to use"
          default: "global"
          type: string
          required: false
        script:
        - echo "subtask with namespace {{ get "namespace" }}"
  namespace:
    description: "Create/destroy namespace"
    tasks:
      create:
        description: "Create namespace"
        parameters:
          - name: namespace
            description: "Namespace to annotate"
            type: string
            required: true
        script:
        -  echo Created namespace "{{ get "namespace" }}"

Running this fails if you do not provide a namespace, even though a default namespace is specified for the major subtask

$ x major subtask foo
x ≫ starting task major.subtask
subtask with namespace foo
$ x namespace create foo
x ≫ starting task namespace.create
Created namespace foo
$ x major --namespace foo subtask
x ≫ starting task major.subtask
subtask with namespace foo
$ x major subtask
x.major.subtask ≫ one or more inputs are not valid in vars:
map[args:[] cmd:./x env:dev namespace:<nil>]:
x.major.subtask ≫ one or more inputs are not valid in varsDumo:
{
  "args": [],
  "cmd": "./x",
  "env": "dev",
  "namespace": null
}:
x.major.subtask ≫ one or more inputs are not valid in kv:
{
  "args": [],
  "cmd": "./x",
  "env": "dev",
  "namespace": null
}:
x.major.subtask ≫ - namespace: Invalid type. Expected: string, given: null
@mumoshu
Copy link
Owner
mumoshu commented Dec 14, 2019

@Nuru Hey! This seems like a regression. Ideally this shouldn't fail as you do provide the default namespace for the major task. I'll take a deeper look soon.

@mumoshu mumoshu added the bug label Dec 14, 2019
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
0