BPMN Git Sync
Nominated Owner: @geoff
Summary
BPMN Specifications are stored in the database and versioned which approximates the familiar Git workflow, but not as well. AppSmith has Git Sync functionality that stores the configuration of AppSmith pages in a Git repo which is a more familiar workflow for developers. Git branching would also make the deployment of changes across environments more streamlined allowing code review and approval.
Retrospective
This section is essential to allow us to learn from the things we are implementing
Retro completed?
Motivation
Why do this? What use-case does it support? What is the expected outcome?
- BPMN Specifications are essentially code that should be under version control
- Being stored as data makes them different to all the other code and creates an additional step when deploying code changes across environments
- Versioning in the database does provide the ability to approve and roll-back, but is more complex to deploy across environments
- Moving the source control function to Git means that customers can control their source code using git rules and branch protections like all their other code.
- Most projects are manually doing this now. Exporting their BPMN definitions and saving into a repo. This change would improve that experience by making it a native part of the platform.
Guide-level explanation
Following the AppSmith pattern for how this could work, In the Admin UI, an administrator would configure the connection to the git repo, setting up the url, and authentication details.
AppSmith also allows the administrator to configure the default branch, and branch protection. Changes to the app are prevented if the user has selected a protected branch.
When editing a BPMN, the user would be able to:
- Select or create a branch
- Pull from the git repo
- Push local changes to the git repo
- Merge requests would be done in the git repo directly.
Reference-level explanation
The integration with Github would be best done from the backend so as to keep the frontend simple, but also to allow other data objects to be stored in Git in the future.
The following Mutations are envisioned:
- SetupGitSync: A mutation that establishes the connection to the git repo
- SetupGitBranchProtection: A mutation that allows the user to store branches that should be protected from changes
- GitPull(branch): This will pull the files from the git repo. The mutation would hen synchronise them with the data stored in the database
- GitPush(branch): This will read the data from the database and push it to the repo. It’s effectively like a file export to git
Drawbacks
why we should NOT do this
We are currently working on data migration functionality that will allow users to migrate data from one environment to another, which will address much of the current need. Git Sync is a significant development. AppSmith took over 12 months to get their Git Sync functionality to the point where it is useable.
Extending this to other configuration data, like Equipment Versions, Rules etc is not straight forward as the definition of what is configuration data and what is run-time data can depend on what has been integrated with other systems and what has not. It becomes a user configuration to determine what should be under source control, and what is runtime data.
Rationale and alternatives
What alternatives have been considered, and what is the rationale for not choosing them?
Prior art
The current process in most projects for BPMN is to manually export the BPMN specification file and add it to a git repo. The files can then be loaded through the UI and saved into the database in a different environment.
For Master data, there are various prior arts. In one project we have spreadsheets of master data contained in the repo for the customer’s extension microservice. The build pipeline build a container that includes the spreadsheets, and there is a custom mutation which can be called to load the data from the spreadsheet into the database.
On other projects, GraphQL mutation input json files are stored in a git repo and are manually deployed to environments.
In other projects, master data is manually maintained through the admin UI in each environment.
Unresolved Questions
What parts of the design still need to be resolved before this can be started?
What related issues are out of scope of this design?
Future Possibilities
- Master Data Git Sync