Skip to content

Commit a7e343a

Browse files
authored
Merge pull request #607 from intersystems/doc-baseline
Add documentation for baselining process
2 parents 9dee402 + f7a363b commit a7e343a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ This might look like:
8787
8888
![Example of mapping configuration](docs/images/settings.PNG "Example of mapping configuration")
8989
90+
### Baselining Source Code
91+
If enabling source control on an existing system, you will need to create a baseline by exporting all existing items to the Git repository. See [our documentation on baselining](/docs/baselining.md).
92+
9093
### Pull Event Handlers
9194
9295
The class `SourceControl.Git.PullEventHandler` is a base class that can be extended in order to develop functionality that should be run when the repository pulls from remote. The code placed inside the subclass' OnPull() method will be executed any time a pull occurs.

docs/baselining.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Baselining Source Code
2+
Baselining source code is the first step to enabling source control on an existing system. Baselining synchronizes the Git repository with a source of truth, usually the current state of the production environment. This establishes a clean starting point so that any future changes can be tracked.
3+
4+
Git-source-control includes an API method `BaselineExport` that may be run in an IRIS terminal to export items in a namespace to the configured Git repository.
5+
6+
A baselining workflow will commonly include these steps:
7+
- Create a new remote repository on your Git platform of choice.
8+
- Use `do ##class(SourceControl.Git.API).Configure()` to configure Git on the production environment (or a copy of the production environment). Clone the new remote repository.
9+
- Use the Settings page in the Source Control menu to customize the mapping configuration.
10+
- Use the Source Control menu to check out a new branch for the baseline export.
11+
- Use the `BaselineExport` method to export all items to the Git repository, commit, and push to the remote: `do ##class(SourceControl.Git.API).BaselineExport("initial baseline commit","origin")`
12+
- Create a merge or pull request on your remote Git platform from the baseline branch to the main branch. Review the code to ensure it includes all required items. If needed, modify the mapping configuration and redo the baseline export. When the baseline is satisfactory, merge it into the main branch.
13+
- Use the Source Control menu to switch back to the main branch on the production environment.
14+
- For each other environment, configure Git to clone that same remote repository. From the Source Control menu, run Import All (Force) to load all items from the baseline.

0 commit comments

Comments
 (0)