Skip to content

Upstream 16289 - Do not add optional survey fields with empty strings#242

Merged
cigamit merged 2 commits intomainfrom
upstream16289
Feb 28, 2026
Merged

Upstream 16289 - Do not add optional survey fields with empty strings#242
cigamit merged 2 commits intomainfrom
upstream16289

Conversation

@cigamit
Copy link
Copy Markdown
Contributor

@cigamit cigamit commented Feb 28, 2026

When survey fields are optional and not filled out and not backed by a variable in extra_vars, do not inlcude them at all for the job launch.

@cigamit cigamit requested a review from TheWitness February 28, 2026 03:04
@cigamit cigamit self-assigned this Feb 28, 2026
Copilot AI review requested due to automatic review settings February 28, 2026 03:04
@cigamit cigamit added the bug Something isn't working label Feb 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates survey default handling so optional survey questions with an empty-string default don’t automatically inject that key into extra_vars during job launch unless the user explicitly supplies it at runtime.

Changes:

  • Skip adding optional, non-password survey defaults when the default is an empty string and the variable is not present in runtime extra_vars.
  • Update/extend unit tests to reflect the new behavior and add coverage for explicitly-provided runtime empty strings.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
awx/main/tests/unit/models/test_survey_models.py Updates expectations for optional defaults and adds a new test ensuring runtime-provided empty strings are retained.
awx/main/models/mixins.py Adjusts _update_unified_job_kwargs to omit empty-string defaults for optional survey fields unless explicitly provided at runtime.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread awx/main/tests/unit/models/test_survey_models.py Outdated
Comment thread awx/main/tests/unit/models/test_survey_models.py Outdated
Comment thread awx/main/models/mixins.py
Comment thread awx/main/models/mixins.py
@cigamit cigamit added the python Pull requests that update python code label Feb 28, 2026
@cigamit cigamit merged commit 7bc7f7f into main Feb 28, 2026
@cigamit cigamit deleted the upstream16289 branch February 28, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python Pull requests that update python code

Development

Successfully merging this pull request may close these issues.

3 participants