A tool that helps you to orchestrate Git repositories mainly for training purposes.
You can generate a repository by running the script without parameters:
./reporchestrator.py
The result will be placed to the "repository" directory.
The script expects one of three external configuration sources that are mixed in the following order (first overrides last):
- command line json string as argument
- command line json file name as argument
- default values in json file
reporchestrator.json
- default values in source code
The current default parameters in reporchestrator.json
are:
{
"random_seed": 22,
"repo_age_in_days": 10,
"team_size": 5,
"general_commit_words": ["Add", "an", "empty", "change"],
"merge_commit_words": ["Introduce", "the", "feature"],
"max_commits_per_branch": 10,
"repo_dir": "repository",
"datetime_format_template": "%Y-%m-%dT%H:%M:%S",
"ticket_id_template": "ACME-%d",
"message_template": "%s %s"
}
For detailed hierarchical configuration resolution see the source code for now.
When run, the tool writes a model.pickle file which can be viewed like so (example data from a random run):
python -m pickle model.pickle
{'datetime_format_template': '%Y-%m-%dT%H:%M:%S',
'developer_data': [('Brenda Johnson', '[email protected]'),
('Crystal Chung', '[email protected]'),
('Brian Schmidt', '[email protected]'),
('Cody Long', '[email protected]'),
('Michael Reynolds', '[email protected]')],
'developer_strategy': 'random-uniform',
'fake': 'Faker',
'general_commit_words': ['Add', 'an', 'empty', 'change'],
'max_commits_per_branch': 10,
'merge_commit_words': ['Introduce', 'the', 'feature'],
'message_template': '%s %s',
'model': "Model<developer=('Brenda Johnson', '[email protected]'), "
'ticket=ACME-3, commits=7, planned=8>',
'random_seed': 22,
'random_state': 3,
'repo_age_in_days': 10,
'repo_dir': 'repository',
'team_size': 5,
'ticket_id_template': 'ACME-%d'}
Note: Interesting changes may happen, when pointing the repo_dir
value to this repository folder, just sayin' you have been warned ...
This tool depends on the non-standard library python modules
gitpython
to interact with git repositories- and
faker
to easily create surrogate data like user names and email addresses
First of all:
Every contribution abiding by the license is highly appreciated!
Before starting developing:
- Please install the dev and test requirements before development.
- Please also check the existing issues and refer to an issue.
- If you want to provide an improvement or fix a bug not recorded as issue, consider submitting an issue.
Before submitting a pull please ensure the change set satisfies all of the following 4 criteria:
black reporchestrator.py
succeededpylint reporchestrator.py
ideally 10.0/10.0 scorepytest
has no failing testpytest --cov-report term --cov-branch --cov=reporchestrator tests/
should report 80% coverage or more (especially if new features were added)
Thank you.