Repository navigation
Conversation
Added a function to parse a list of dictionaries from a string or JSON input.
Added process_list_of_dicts_arg utility to handle entries.
Initialize options for entries using process_list_of_dicts_arg.
Added tests for handling entries as JSON strings and invalid JSON strings in AddPicklistEntries task.
|
Thanks for the contribution! Before we can merge this, we need @jeromeyyy to sign the Salesforce Inc. Contributor License Agreement. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3953.
When
entriesis passed through the CLI, e.g.the option arrives as a JSON string, while
AddPicklistEntriesexpects a list of dicts. ThefullNamecheck then iterates over the string's characters and always raisesThe 'fullName' key is required on all picklist values., exactly as reported in #3953. The sibling taskadd_standard_value_set_entries(AddValueSetEntries) has the same gap: it consumesentrieswithout any parsing, so a CLI-provided JSON string fails there too.Change
process_list_of_dicts_arghelper incumulusci/core/utils.py, next toprocess_list_arg/process_bool_arg: returns an existing list of dicts unchanged, parses a JSON string, and raisesTaskOptionsErrorfor invalid JSON or a value that is not a list of objects.AddPicklistEntries._init_optionsandAddValueSetEntries._init_optionsnormalizeentriesthrough it before the existing validation, so cumulusci.yml usage (already a list of dicts) is unchanged.Tests
New regression tests in
test_picklists.pyandtest_value_sets.pycover entries given as a JSON string (parsed and validated) and invalid JSON (raisesTaskOptionsError). The picklists test reproduces the exact error from #3953 against the original code; all four tests fail before the fix and pass after.Full suite: 3283 passed, 5 failed - all 5 failures verified to pre-exist on a clean tree (4 OAuth client tests and
test_bad_entry_point; they fail identically without this change and are unrelated to it).