Skip to content

Expose Rollback Option in the Snowfakery Task#3958

Merged
aditya-balachander merged 1 commit intomainfrom
feature/snowfakery-enable-rollback
Apr 2, 2026
Merged

Expose Rollback Option in the Snowfakery Task#3958
aditya-balachander merged 1 commit intomainfrom
feature/snowfakery-enable-rollback

Conversation

@aditya-balachander
Copy link
Copy Markdown
Contributor

Background

The LoadData task already supports an enable_rollback option that, when set to True, performs a cleanup of all successfully-inserted records if a row-level error is encountered during a load. This is essential for keeping orgs in a consistent state when a data load partially fails.

The snowfakery task drives LoadData internally (via GenerateAndLoadDataFromYaml subtasks), but previously had no way to pass enable_rollback through to those subtasks — meaning users had no way to get rollback behaviour when using the Snowfakery task.

Changes

cumulusci/tasks/bulkdata/snowfakery.py

  • Added enable_rollback to task_options with documentation.
  • Parsed and stored the option in _validate_options.
  • Raises TaskOptionsError if enable_rollback=True is combined with any run_until_* option — those run across many independent batches, each of which commits separately, so only the failing batch would be rolled back, which would be confusing behaviour.
  • Threads the option through to all LoadData subtasks via both additional_load_options (for parallel batch loaders) and _run_generate_and_load_subtask (for the initial/validation batch).

cumulusci/tasks/bulkdata/load.py

  • Added a warning in _init_options when enable_rollback=True and ignore_row_errors=True are both set, since row errors are suppressed before the rollback trigger is reached in that combination.

@aditya-balachander aditya-balachander requested a review from a team as a code owner March 26, 2026 05:51
@aditya-balachander aditya-balachander merged commit 94b9678 into main Apr 2, 2026
22 of 26 checks passed
@aditya-balachander aditya-balachander deleted the feature/snowfakery-enable-rollback branch April 2, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants