Feature: Add validate_only option for Snowfakery & GenerateAndLoadData Task#3930
Merged
jkasturi-sf merged 2 commits intomainfrom Oct 17, 2025
Merged
Feature: Add validate_only option for Snowfakery & GenerateAndLoadData Task#3930jkasturi-sf merged 2 commits intomainfrom
jkasturi-sf merged 2 commits intomainfrom
Conversation
rupeshjSFDC
pushed a commit
to jorgesolebur/CumulusCI
that referenced
this pull request
Nov 16, 2025
…idate-only-snowfakery Feature: Add validate_only option for Snowfakery & GenerateAndLoadData Task
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.
Overview
This PR introduces two improvements to CumulusCI's data loading functionality:
validate_onlyoption to thesnowfakery taskto validate mapping files against org schemas without loading data1. Bug Fix: Required Field Validation
Problem
The required field validation in
mapping_parser.pywas not properly blocking validation when required fields were missing. The issue was in thevalidate_and_inject_namespace()method, which calledcheck_required()but ignored its return value, causing validation to silently pass even when required fields were absent.Previous Code (Buggy)
The
check_required()method would returnFalsewhen required fields were missing, but the calling code never checked this return value, so validation would proceed as if everything was fine.Fixed Code
Now the code:
check_required()validation_resultobject (when provided)Falseto block validation if required fields are missing (unlessdrop_missing=True)2. New Feature: validate_only Option
What It Does
The
validate_onlyoption allows users to validate their data generation recipes and mapping files against the target org's schema without actually loading any data. This is specifically done for the Snowfakery Task as a part of TD-0268770How It Works
When
validate_only=True:ValidationResultobject with detailed errors and warningsUpdated Tasks
Snowfakery Task (
snowfakery.py):validate_onlyoption to task options_run_validation()method that generates minimal data and validatesvalidate_only=Truein_run_task()GenerateAndLoadData Task (
generate_and_load_data.py):validate_onlyoption to task options_run_validation()method_validate_mapping()helper method with user-friendly loggingUsage Examples
Example 1: Snowfakery with Invalid Recipe (Missing Required Field)
Output:
Example 2: Snowfakery with Valid Recipe
Output:
Example 3: Normal Load (validate_only=False)
Output: