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

Cannot Launch Workflows if POL enabled but left empty #8420

Open
unlikelyzero opened this issue Oct 20, 2020 · 4 comments
Open

Cannot Launch Workflows if POL enabled but left empty #8420

unlikelyzero opened this issue Oct 20, 2020 · 4 comments
Labels

Comments

@unlikelyzero
Copy link

ISSUE TYPE
  • Bug Report
SUMMARY

Cannot Launch Workflows if POL enabled but left empty

ENVIRONMENT
  • AWX version: devel@10/15
STEPS TO REPRODUCE
  1. Create a Workflow and enable Prompt on Launch for Limit and SCM Branch
  2. Launch Workflow but do not fill in Limit and/or SCM Branch
    Note: Error
EXPECTED RESULTS

If Prompt on Launch enabled, it should not be required

ACTUAL RESULTS

Error thrown

ADDITIONAL INFORMATION

Screen Shot 2020-10-20 at 2 05 33 PM

@ryanpetrello
Copy link
Contributor

ryanpetrello commented Oct 20, 2020

Do we know if this is a regression? If not, it probably doesn't belong in this milestone.

@mabashian
Copy link
Member

I tried this same thing out with a job template and didn't get an error on launch so that got me looking at what might be different between the two scenarios.

For job templates, here's what the OPTIONS response for each of those fields looks like:

            "limit": {
                "type": "string",
                "required": false,
                "label": "Limit",
                "filterable": true,
                "default": ""
            },
            "scm_branch": {
                "type": "string",
                "required": false,
                "label": "Scm branch",
                "help_text": "Branch to use in job run. Project default used if blank. Only allowed if project allow_override field is set to true.",
                "max_length": 1024,
                "filterable": true,
                "default": ""
            },

And for workflow job templates:

            "limit": {
                "type": "string",
                "required": false,
                "label": "Limit",
                "filterable": false,
                "default": null
            },
            "scm_branch": {
                "type": "string",
                "required": false,
                "label": "Scm branch",
                "filterable": false,
                "default": null
            },

Note that the default value for these fields on a job template is an empty string but on a workflow job template it's null. So when we save a workflow job template without a default limit/scm_branch those values are set to null. When the user goes to launch the workflow, if they don't interact with those fields then we pass the default (null) through to the POST params and we hit:

Screen Shot 2020-10-20 at 4 05 15 PM

@ryanpetrello
Copy link
Contributor

ryanpetrello commented Oct 20, 2020

Talked to @mabashian about this - if there's a simple way to work around it in the UI (i.e., send an empty string, instead of null), that's fine, but if not, I'd say 👎 for now.

Also, @wenottingham @jneedle feel free to convince me I'm wrong, but this doesn't belong in this milestone.

@ansible ansible deleted a comment from mabashian Oct 20, 2020
@ansible ansible deleted a comment from jneedle Oct 20, 2020
@mabashian mabashian removed their assignment Nov 16, 2020
@wenottingham
Copy link
Contributor

See also: #8561

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

7 participants