Everything here is still in rough prototype state, but these were the main tools made for migrating all the Bonsai Foundation repos.
src/Prefectis a tool for enforcing a particular set of standards on a set of repos.referenceandreference-harpare the two reference trees for Bonsai and Harp respectively (not all rules are shown here tough, seeRuleset.cs)src/ForeachRepois a tool for running commands over a group of repos (with basic filtering and conditionals). EG: RunForeachRepo --exclude=machinelearning bonsai-rx git statusto print the status of every repo in thebonsai-rxfolder, except for the Bonsai.ML repo. Has some handy built-in commands too.
prefect <reference-template> [repo ...] [--skip repo] [--interactive] [--auto-fix] [--project-name name]
Required path to the reference template to use for validaiton (see detailed description below.)
The repository or set of repositories to validate. Multiple can be specified.
If the specified path is a Git repository, then that single repository will be added to the validation set. If the specified path is a non-Git directory, then each Git repository directly under it is added to the validation set. If no repositories are specified, the list of configured validation rules will be printed.
Indicates that the specified repository should be skipped, can be specified multiple times. repo can be either the name of the repository's folder, the path to a repository, or the repository's project name.
Enables interactive mode. In interactive mode Prefect will pause and wait for the user to correct issues whenever a repository fails validation, after which the repository will be checked again.
When enabled, Prefect will automatically fix certain rule violations. (Note that fixes may be destructive.)
Overrides the project name instead of using automatic detection, cannot be used with sets of multiple repositories. This flag is most useful when provisioning new repositories where the automatic name detection has nothing to work with.
Prefect performs validation against a directory tree used as the reference template.
For each file and directory in the tree, Prefect will validate the file exists in the target and, for files which have contents, Prefect will also validate that the contents match. Reference templates may also contain additional configuration files to control Prefect's behavior, as described in detail below.
Contains a well-known template kind used to add additional programmatic rules to the rule set.
An index of file paths which are permitted to diverge in the target repo. The contents of the file in the template will be used only if the file does not yet exist in the target.
An index of file paths in the template which will have their contents interpolated before validation.
An index of file paths which must not exist in the target, typically used for legacy files which are not longer desired.
File indices list one file path per line. Indentation and any trailing whitespace is automatically trimmed. Blank lines and lines beginning with # are ignored. Glob syntax is not supported.
The names of all files and the contents of files listed in .prefect-interpolated-files will be interpolated using the special $INTERPOLATION$ syntax.
The following interpolations are supported:
$PROJECT$- The human-friendly name of a project (typically the package name.)$REPO-SLUG$- The name of the repository, which is the name of the folder which contains it.
The project name corresponding to a repository is inferred unless specified using --project-name. By default, the name of a project will be the name of the shortest-named .sln file in the root of the repository. When using a Harp template, the Interface directory is used instead of the root.
Prefect is released as open source under the MIT license.