Skip to content

Commit 3d211d0

Browse files
author
Paul Prescod
authored
Merge branch 'main' into feature/salesforce-features
2 parents 4bde252 + d6a582d commit 3d211d0

38 files changed

Lines changed: 1965 additions & 310 deletions

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,25 @@ jobs:
5656
- name: Run Tests
5757
run: python -m pytest
5858

59+
faker_docs:
60+
name: Faker Docs
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: "actions/checkout@v2"
64+
- uses: "actions/setup-python@v1"
65+
with:
66+
python-version: "3.9"
67+
68+
- name: Install dependencies
69+
run: |
70+
python -VV
71+
python -m pip install --upgrade pip pip-tools
72+
make dev-install
73+
python setup.py install
74+
75+
- name: Make Docs
76+
run: make docs
77+
5978
windows:
6079
name: Windows ${{ matrix.python-version }}
6180
runs-on: windows-latest

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ build/
1313
dist/
1414
docs/api/
1515
docs/_build/
16+
docs/fakedata
17+
docs/fakedata.md
18+
docs/locales.md
1619
.eggs/
1720
.idea/
1821
.tox/

CONTRIBUTING.rst

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ Or you could make it outside of the project repo.
7171

7272
$ pytest
7373

74-
7. Your new code should also have meaningful tests. One way to double check that
74+
7. Build the docs like this:
75+
$ make docs
76+
$ open build/html/index.html
77+
78+
Set SF_MKDOCS_BUILD_LOCALES=False to skip building all locales
79+
80+
8. Your new code should also have meaningful tests. One way to double check that
7581
your tests cover everything is to ensure that your new code has test code coverage:
7682

7783
$ pytest --cov
@@ -123,3 +129,27 @@ You can finish up the process by updating the release object that was auto-creat
123129
Just paste in the changelog notes and hit publish.
124130

125131
Tada! You've published a new version of Snowfakery.
132+
133+
Internal Software Architecture
134+
------------------------------
135+
136+
=================================== ================================
137+
Filename Purpose
138+
----------------------------------- --------------------------------
139+
140+
cli.py Click-based Command Line. Uses the Click library to supply a CLI.
141+
data_generator.py The API entry point the CLI and CCI use. <p>This may be the best place to start reading. It abstracts away all of the complexity and outlines the core flow.
142+
parse_recipe_yaml.py Phase 1: parse YAML into a Runtime DOM<p>Includes some hacks to the YAML parser for handling line numbers.
143+
data_generator_runtime.py Phase 2: Runtime.<p>Actually generate the data by walking the template list top-to-bottom, generating rows as appopriate.
144+
data_generator_runtime_dom.py An object model used in Phase 2. Roughly similar to the shape of the YAML file.
145+
output_streams.py Where the data goes in the output. Used during Phase 2.
146+
data_gen_exceptions.py Exceptions that can be thrown
147+
generate_mapping_from_recipe.py In the CCI context, this utility package allows the generation of mapping.yml files.
148+
template_funcs.py Functions that can be invoked using either block syntax or in Jinja templates
149+
plugins.py Infrastructure for plugins
150+
standard_plugins/ Plugins that ship with Snowfakery
151+
tests/ Unit tests
152+
=================================== ================================
153+
154+
155+
<img src='docs/images/img6.png' id='PJUACA3lKvf' alt='Architecture Diagram'>

HISTORY.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,29 @@ In the beginning, programmers created the databases. Now the databases were form
44

55
And so [Salesforce.org](http://salesforce.org/) said “Let there be data,” and there was Snowfakery. And it was good.
66

7+
## Snowfakery 2.0
8+
9+
Recipes can now merge in data from Salesforce orgs as
10+
records, IDs or datasets. (#395 and #401)
11+
12+
Output streams can now be specified as 3rd party libraries. Any Python class name
13+
can be passed to --output-format as long as it adheres to the OutputStream
14+
protocol as shown in examples/YamlOutputStream.py (#351)
15+
16+
Snowfakery is thread-safe/multi-processor-ready and available for parallel usage
17+
in CumulusCI. (CumulusCI Repo)
18+
19+
Snowfakery now supports a --reps option as an easier way to repeat a recipe (#416)
20+
21+
Snowfakery now accepts LeadingCaps syntax for all fakers, as well as
22+
underscore_separated and everythinglowercase. (#403)
23+
24+
Salesforce.ContentVersion and Salesforce.ProfileId convenience functions were added
25+
(#421)
26+
27+
Snowfakery now has voluminous documentation about Fakes in many languages and
28+
locales (#409)
29+
730
## Snowfakery 1.12
831

932
Fix a regression: In some contexts it was impossible to call Faker with either

LICENSE

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1-
Copyright (c) 2020, Salesforce.org
2-
All rights reserved.
3-
4-
Redistribution and use in source and binary forms, with or without
5-
modification, are permitted provided that the following conditions are met:
6-
7-
* Redistributions of source code must retain the above copyright
8-
notice, this list of conditions and the following disclaimer.
9-
* Redistributions in binary form must reproduce the above copyright
10-
notice, this list of conditions and the following disclaimer in the
11-
documentation and/or other materials provided with the distribution.
12-
* Neither the name of Salesforce.org nor the names of
13-
its contributors may be used to endorse or promote products derived
14-
from this software without specific prior written permission.
1+
Copyright (c) 2021, Salesforce.com, Inc.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
* Redistributions of source code must retain the
7+
above copyright notice, this list of conditions
8+
and the following disclaimer.
9+
10+
* Redistributions in binary form must reproduce
11+
the above copyright notice, this list of conditions
12+
and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
* Neither the name of Salesforce.com nor the names
16+
of its contributors may be used to endorse or promote
17+
products derived from this software without specific
18+
prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
24+
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
25+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26+
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
29+
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1530

16-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
19-
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
20-
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21-
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22-
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25-
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26-
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27-
POSSIBILITY OF SUCH DAMAGE.

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,10 @@ update-deps:
55
dev-install:
66
pip install --upgrade pip-tools
77
pip-sync requirements/*.txt
8+
pip install -e .
9+
10+
# set SF_MKDOCS_BUILD_LOCALES=False to skip building all locales
11+
docs: .FORCE
12+
python -m mkdocs build --clean --site-dir build/html --config-file mkdocs.yml
13+
14+
.FORCE:

custom_theme/img/favicon.ico

15 KB
Binary file not shown.

docs/Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
# Add any Sphinx extension module names here, as strings. They can be
2828
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2929
# ones.
30-
extensions = ["myst_parser"]
31-
myst_config = {}
30+
extensions = []
3231

3332
# Add any paths that contain templates here, relative to this directory.
3433
templates_path = ["_templates"]

0 commit comments

Comments
 (0)