Salesforce-Data-TreecipeSalesforce-Data-Treecipe is a Visual Studio Code extension designed to streamline the process of generating production-like data during development in order to support building Quality in. This extension auto-generates a recipe yaml file based on the running, local project structure. Said differently, what is already in the "source" for the project. From the generated "Fake-Data Generating YAML Files", additional commands can be used following the recipe generation to build Collections API datasets that can be committed and reused as needed. Users have two choices of "Fake Data" implementations:
Table of Contents
Prerequisites for SnowfakeryIf using snowfakery as Faker service instead of faker-js."faker-js" can be natively installed with VS Code extensions and does not require machine setup steps. VS Code Extension Installation
"How To" YouTube Walkthroughs:Get started by walking through the below commandsNote: press
1. Salesforce Treecipe: Initiate Configuration FileThis command initiates the creation of a configuration file that is required before using other features of the extension. The command creates a root directory folder called "treecipe" and within it a configuration file called "treecipe.config.json". This file is auto generated based on the field configurations detailed selection made when prompted "Select objects directory". The end result treecipe.config.json file is expected to look like the below:
How It Works:
Once the configuration file is generated, you can begin using the Generate Treecipe command. Corresponding Video:2. Salesforce Treecipe: Generate TreecipeThis command generates a Treecipe, a structured representation of your Salesforce data, based on your treecipe configuration and the objects directory it is pointed to. It parses the "salesforceObjectsPath" directory path that was provided when running the "Initiate Configuration File" command above, and then generates a yaml file of objects and associated fields found in that directory. As part of this yaml file generation there are some items to be aware of:
NOTE: If this command is run before "Initiate Configuration File" is completed, a warning will appear in VS Code prompting to run it. Prerequisite:
Corresponding Video:3. Salesforce Treecipe: Run Faker by RecipeThis command prompts the user to select an existing recipe(Treecipe) file to generate fake data from. With the selection made, the snowfakery CLI will execute against the yaml file and produce json structured, production-like data which is then converted for usage with Salesforce Collection Api Corresponding Video:4. Salesforce Treecipe: Insert Data Set by DirectoryThis command prompts the user for the following items:
VIDEO WALKTHROUGHSInitiate Treecipe Configuration with expected Objects directoryhttps://github.com/user-attachments/assets/f8401f28-a04c-4abc-a56f-c860cce96dee Generate Treecipe based on treecipe.config.jcon (keep an eye out for OOTB fields and "REMOVE ME" lines)https://github.com/user-attachments/assets/fd127b55-d434-4a73-9d65-cf4172fbce6f Run Snowfakery by existing recipe yaml filehttps://github.com/user-attachments/assets/d7dfcf70-70f8-4ce3-b254-280e2bbb0b7d Insert Data Set by Directoryhttps://github.com/user-attachments/assets/a0491f86-9360-4450-afae-f71fe07dbc21 Troubleshooting, Exception Handling, and Reporting BugsSee below for troubleshooting when specific commands are not working:
NOTE: All commands are wrapped in try-catch and will prompt a "Report a Bug" dialog. This generates a GitHub Issue template with a stack trace. Video Walkthrough:https://github.com/user-attachments/assets/dff4a3cb-e244-4959-9dec-dcf094f713c2 ContributingThis project and codebase will be open-sourced shortly :) LicenseThis extension is licensed under the MIT License. Install Snowfakery CLISnowfakery CLI Installation and UsageOverviewSnowfakery is a tool for generating synthetic data. This document provides instructions for installing and using the Snowfakery CLI on any operating system. Prerequisites
Installation
Verify the Installation
Usage (Without Salesforce Data Treecipe Extension)
Official documentation: https://snowfakery.readthedocs.io/ Uninstalling Snowfakery
|