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

Sanitize newlines out of survey option inputs #4868

Merged
merged 1 commit into from
Oct 10, 2019

Conversation

rebeccahhh
Copy link
Member

@rebeccahhh rebeccahhh commented Oct 1, 2019

SUMMARY

pertains to #4452
The main issue here was the playbook itself, which was fixed, however it did expose the ability for a blank newline to be added to a survey, which will break it.
My changes have added in multiple choice options parsing, which takes the string, splits it up, and then eliminates any extra newlines (which had lead to the blank lines mentioned above).
Additionally wrote a small validation to prevent the API pushing a default value for a survey that is not in the list of available options.
Additionally edited mixins.py to cover the same scenario in the UI not just the API, however the issue #4866 persists.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • API
AWX VERSION
awx: 7.0.0

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@rebeccahhh rebeccahhh force-pushed the survey-spec-default branch from 075b707 to 911e049 Compare October 1, 2019 20:52
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@rebeccahhh rebeccahhh force-pushed the survey-spec-default branch from 02d6ce2 to 1dbe977 Compare October 3, 2019 19:27
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@rebeccahhh rebeccahhh force-pushed the survey-spec-default branch from c46ff57 to b602d46 Compare October 4, 2019 15:03
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@rebeccahhh rebeccahhh force-pushed the survey-spec-default branch from b602d46 to 18f38bb Compare October 7, 2019 15:21
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@rebeccahhh rebeccahhh force-pushed the survey-spec-default branch from 2633d15 to 54a15dd Compare October 7, 2019 21:20
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

…kes a string, splits it up, and then eliminates any extra newlines, or just accepts alist. Extra newlines are sanitized out.

Signed-off-by: Rebeccah <rhunter@redhat.com>
)))
# if it's a multiselect or multiple choice, it must have coices listed
# choices and defualts must come in as strings seperated by /n characters.
if qtype == 'multiselect' or qtype == 'multiplechoice':
Copy link
Contributor

@ryanpetrello ryanpetrello Oct 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick, but meh, po-tay-to po-tah-to

if qtype in ['multiplechoice', 'multiselect']:

@softwarefactory-project-zuul
Copy link
Contributor

Build failed (gate pipeline). For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

@AlanCoding
Copy link
Member

have you rebased recently? anyone know what's up with

make: *** No rule to make target `ui-zuul-lint-and-test'.  Stop.
command terminated with exit code 2

in the UI target?

@AlanCoding
Copy link
Member

Yeah #4932 merged 4 hours ago and introduced the target

easiest solution should be to rebase against the devel branch.

@rebeccahhh rebeccahhh force-pushed the survey-spec-default branch from cc7c9eb to 7efacb6 Compare October 9, 2019 19:51
@rebeccahhh
Copy link
Member Author

rebeccahhh commented Oct 9, 2019

@AlanCoding Darn, thought I had gotten those in before, rebased.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@ryanpetrello ryanpetrello reopened this Oct 9, 2019
@ryanpetrello
Copy link
Contributor

regate

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@ryanpetrello ryanpetrello merged commit 7fe32ab into ansible:devel Oct 10, 2019
@rebeccahhh rebeccahhh deleted the survey-spec-default branch January 14, 2020 19:35
AlanCoding pushed a commit to AlanCoding/awx that referenced this pull request May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants