Skip to content

Commit 4871482

Browse files
wendrulhcourdent
andauthored
Git sync docs rework (#1193)
* Workspace forks (merge ui + cahngelog) * Update git sync docs Less emphasis on promotion, add the setup (including CI/CD) as part of this page * Remove promotion details from git sync docs * Centralize promotion workflow instructions, recommend workspace forks * Update local development * Add tags to changelog * Rename to Git promotion * New infographic for forks * fixes * fixes --------- Co-authored-by: Henri Courdent <122811744+hcourdent@users.noreply.github.com>
1 parent 933b42e commit 4871482

File tree

16 files changed

+369
-381
lines changed

16 files changed

+369
-381
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
slug: workspace-forks
3+
version: v1.593.0
4+
title: Workspace forks
5+
tags: ['Workspaces', 'Git sync', 'Collaboration']
6+
description: Create independent copies of workspaces for parallel development workflows, similar to git branches. Merge changes back to parent workspaces directly from the UI or through git sync.
7+
features:
8+
[
9+
'Fork workspaces to create independent development environments',
10+
'Automatically create git branches when used with git sync',
11+
'Merge forked workspaces back to parent workspaces from the UI',
12+
'Multiple developers can work on separate forks simultaneously',
13+
'Deploy individual items to parent workspace using deployment UI'
14+
]
15+
docs: /docs/advanced/workspace_forks
16+
video: /videos/merge-ui-demo.mp4
17+
---

docs/advanced/11_git_sync/index.mdx

Lines changed: 196 additions & 84 deletions
Large diffs are not rendered by default.

docs/advanced/12_deploy_to_prod/index.mdx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,34 @@ import DocCard from '@site/src/components/DocCard';
22

33
# Deploy to prod
44

5-
To deploy to prod, 3 options are possible.
6-
7-
[Draft and deploy](#option-1-draft-and-deploy---single-workspace) is the simplest method. It is meant to be used in a single workspace.
8-
9-
[Git integration](#option-2-deploy-to-prod-using-a-git-workflow---multi-workspace-recommended) is clearly the superior, most powerful method but it is more complex. Usually, to deploy to prod you would want absolutely to have the normal CI flow that goes through one review which is something that is built-in with GitHub/GitLab. Also you may want to put some CI checks there.
10-
11-
However, in a setting where you have dev/staging/prod, you could use the [UI to deploy to staging from dev](#option-3-deploy-to-prod-using-the-ui-only---multi-workspace), and then use git between staging and prod to tighten down prod.
5+
When working on Windmill, you will quickly be looking for ways to iterate on and test your scripts, flows, and apps all the while having a working version running. The following section explains the different methods available in Windmill to have a production environement and deploy to it.
126

137
## Option 1. Draft and deploy - Single workspace
148

159
A simple setup in which deploying to prod means deploying items that have been iterated on in the UI as Drafts.
1610
Deployments in Windmill are commonly done from the same workspace using the [Draft and deploy](../../core_concepts/0_draft_and_deploy/index.mdx) buttons.
1711

18-
## Option 2. Deploy to prod using a git workflow - Multi workspace (recommended)
12+
## Option 2. Workspace forks - Multi workspace (recommended)
13+
14+
[Windmill workspaces](../20_workspace_forks/index.mdx) can be forked, creating a new copy of the workspace at that point in time. The forked workspace can be iterated on, tested, and once changes are ready, merged back to the original workspace, thus deploying the new versions of the scripts, flows, or apps. The workflow will be familiar to anyone who has used branches in version control tools such as git. The analogy can be further reinforced if [Git Sync](../11_git_sync/index.mdx) is setup: Windmill will autmatically create branches for each of the forks, and merging can be controlled direclty through git.
15+
16+
## Option 3. Git Promotion workflow: deploying through git - Multi workspace (possible cross-instance)
1917

20-
The integration can be used to push from git, and receive changes done from the UI in a bi-directional way.
21-
You can also use a separate dev and staging branch and repo and have Windmill create automatically branches and Pull Request upon any changes deployed to staging/dev.
18+
This is a more complex but very reliable setup that leverages [Git Sync](../11_git_sync/index.mdx) to deploy from one workspace to another through git. When changes are done to the Staging workspace, they are pushed to a branch in the Prod repo. Once merge to the main branch of the Prod repo, the Prod workspace is updated with the changes.
2219

23-
This process can be used in particular for [local development](../4_local_development/index.mdx) with a solid setup:
20+
This workflow lets you review all the changes on a PR before merging and deploying. It also has the advantage, unlike the other options here, to work across separate windmill instances.
2421

25-
![Local development Setup](../4_local_development/local_development.png 'Local development Setup')
22+
![Git Promotion](/images/git_promotion.png 'Git Promotion')
2623

2724
<div className="grid grid-cols-2 gap-6 mb-4">
2825
<DocCard
29-
title="Deploy to prod using a git workflow"
26+
title="Deploy to prod using the Git Promotion workflow"
3027
description="Windmill integration with Git repositories makes it possible to adopt a robust development process for your Windmill scripts, flows and apps."
3128
href="/docs/advanced/deploy_gh_gl"
3229
/>
3330
</div>
3431

35-
## Option 3. Deploy to prod using the UI only - Multi workspace
32+
## Option 4. Deploy to prod using the UI only - Multi workspace
3633

3734
From a workspace in Windmill, you can deploy a script/flow/resource/variable and all its dependencies to another workspace.
3835

docs/advanced/13_version_control/index.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Manage changes to scripts workflows, apps and resources using commits & push on
88

99
From the workspace settings, you can set a [git_repository](../../integrations/git_repository.mdx) resource on which the workspace will automatically commit and push scripts, flows and apps to the repository on each [deploy](../../core_concepts/0_draft_and_deploy/index.mdx).
1010

11-
This video shows how to set up a Git repository for a workspace (Git sync - sync mode).
11+
This video shows how to set up a Git repository for a workspace (Git Sync).
1212

1313
<iframe
1414
style={{ aspectRatio: '16/9' }}
@@ -19,7 +19,6 @@ This video shows how to set up a Git repository for a workspace (Git sync - sync
1919
allowFullScreen
2020
className="border-2 rounded-lg object-cover w-full dark:border-gray-800"
2121
></iframe>
22-
2322
<br />
2423

2524
Git sync is [Cloud plans and Self-Hosted Enterprise Edition](/pricing) only.

docs/advanced/20_workspace_forks/index.mdx

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Key features:
2020
- **Git integration**: Automatically creates corresponding git branches using the git sync workflow
2121
- **Team collaboration**: Multiple developers can work on separate forks simultaneously
2222

23-
<!-- TODO: Add diagram showing fork relationship and git branch mapping -->
23+
![Workspace Forks and Git Sync](/images/workspace_forks.png)
2424

2525
## Example feature development workflow
2626

@@ -35,8 +35,8 @@ Key features:
3535
### Prerequisites
3636

3737
- Being on a self-hosted EE instance
38-
- [Git sync](../11_git_sync/index.mdx) configured (recommended for full functionality)
39-
- [CI/CD actions ](../9_deploy_gh_gl/index.mdx#github-actions-setup) to merge back from the git remote to Windmill
38+
- [Git sync](../11_git_sync/index.mdx) configured (optional, required only for git-based workflows)
39+
- [CI/CD actions ](../9_deploy_gh_gl/index.mdx#github-actions-setup) to merge back from the git remote to Windmill (only required for git sync workflows)
4040

4141
### Fork creation
4242

@@ -80,7 +80,7 @@ When workspace forks are used with [git sync](../11_git_sync/index.mdx), Windmil
8080
the parent workspace, and keep track of changes there. External changes to the branch are then synced back to the forked workspace if the appropriate
8181
CI/CD actions are setup. Once the changes are ready, a PR can be opened to sync back changes to the original workspace.
8282

83-
Workspace forks are designed to be used with git sync, so make sure to have it properly setup and in particular the [CI/CD actions](../9_deploy_gh_gl/index.mdx#github-actions-setup) specific to forks should be set. Make sure to not forget the `push-on-merge-to-forks.yaml` action.
83+
Workspace forks can be used with git sync for full version control integration. If using git sync, make sure to have it properly setup and in particular the [CI/CD actions](../9_deploy_gh_gl/index.mdx#github-actions-setup) specific to forks should be set. Make sure to not forget the `push-on-merge-to-forks.yaml` action.
8484

8585
### Fork and branch naming
8686

@@ -101,7 +101,28 @@ This naming convention is what enables Windmill to match branches to workspaces
101101

102102
Once a fork is created, it is automatically setup to deploy to its parent branch. You can deploy any item to the parent branch directly from the UI by clicking it and selecting `Deploy to staging/prod`. Learn more about the [Deployment UI](../../core_concepts/12_staging_prod/index.md).
103103

104-
There is currently no way to update the parent workspace changes back to the fork through the UI, but some features are planned to remediate to this.
104+
### Merge workspaces from the UI
105+
106+
You can merge changes from a forked workspace back to its parent workspace directly from the UI without requiring git sync. This provides a simpler workflow for teams that don't need full git integration.
107+
108+
To merge a fork:
109+
110+
1. Navigate to the forked workspace
111+
2. On the home page, a banner will show you the diff with its parent workspace. Click `Review & Deploy Changes`
112+
3. Review the changes and confirm the merge
113+
114+
<video
115+
className="border-2 rounded-lg object-cover w-full h-full dark:border-gray-800"
116+
autoPlay
117+
loop
118+
src="/videos/merge-ui-demo.mp4"
119+
/>
120+
121+
#### Items behind and conflicts
122+
123+
If it is detected that some of the differences come in fact from the original workspace, these changes will be shown as 'behind'. Before deploying, all behind changes must be updated into the fork and properly tested. When an items has changes that are both ahead and behind, it will be marked as a conflict and will be warned to the user. The user must then review the diff and decide how to edit the item to resolve the conflicting changes. Until deployed or updated however, the item will still be marked as a conflict. For more granular conflict detection and better tracked resolution, you can choose to merge the workspaces through a git workflow instead.
124+
125+
The merge will transfer all selected scripts, flows, apps, resources, and variables from the fork to the parent workspace.
105126

106127
### Git sync based merging
107128

@@ -134,7 +155,3 @@ When git sync is properly setup, the workspace is synchronized with one of the b
134155
href="/docs/core_concepts/collaboration"
135156
/>
136157
</div>
137-
138-
<!-- TODO: Add troubleshooting section -->
139-
<!-- TODO: Add FAQ section -->
140-
<!-- TODO: Add API reference for programmatic fork management -->

docs/advanced/3_cli/gitsync-settings.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ wmill gitsync-settings pull --promotion main
140140
wmill gitsync-settings push --promotion production
141141
```
142142

143-
When using the `--promotion` flag, the command will use `promotionOverrides` instead of regular `overrides` from the specified branch in your `wmill.yaml`. This should be used when your git sync connection is configured in [promotion mode](../11_git_sync/index.mdx#promotion-mode).
143+
When using the `--promotion` flag, the command will use `promotionOverrides` instead of regular `overrides` from the specified branch in your `wmill.yaml`. This should be used for [Git Promotion](../9_deploy_gh_gl/index.mdx) connections.
144144

145145
## Differences from sync command
146146

@@ -154,4 +154,4 @@ The `gitsync-settings` command is specifically for managing configuration, not w
154154
| **File Operations** | Modifies `wmill.yaml` structure | Creates/updates resource files in sync directory |
155155
| **Safety** | Configuration changes only | Can create/delete workspace resources |
156156

157-
For more details on the `wmill.yaml` configuration structure, see [wmill.yaml](./sync.mdx#wmillyaml).
157+
For more details on the `wmill.yaml` configuration structure, see [wmill.yaml](./sync.mdx#wmillyaml).

docs/advanced/4_local_development/index.mdx

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,48 +10,25 @@ Windmill has [its own integrated development environment](../../code_editor/inde
1010

1111
To simply create and edit scripts and flows locally, you can directly go to the [Develop Locally](#develop-locally) section.
1212

13-
For a more complex setup involving Git, you can go to the [Local development Recommended Setup](#local-development-recommended-setup).
14-
15-
<iframe
16-
style={{ aspectRatio: '16/9' }}
17-
src="https://www.youtube.com/embed/sxNW_6J4RG8"
18-
title="Local development quickstart"
19-
frameBorder="0"
20-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
21-
allowFullScreen
22-
className="border-2 rounded-lg object-cover w-full dark:border-gray-800"
23-
></iframe>
24-
25-
## Local development recommended setup
26-
27-
Local development involves two components:
28-
29-
1. Being able to create and edit Windmill scripts and flow from your favorite IDE.
30-
2. Deploy them to Windmill and at the same time [version](../13_version_control/index.mdx) them in a Git repository.
31-
32-
In addition to the core functionalities just mentioned, some might want to add the concept of [deployment](../12_deploy_to_prod/index.mdx). This encompasses having a staging and production Windmill environment, and being able to deploy from Staging to Production.
33-
34-
The diagram below illustrates the full process. We're going to explain it quickly, and in the following sections we will decompose it.
35-
36-
![Local development](./local_development.png)
37-
38-
It works as follows:
39-
40-
- 2 different workspaces exist in Windmill: one for Staging and one for Prod, and a Git repository that has been set to sync the Windmill Staging workspace.
41-
- Some developers work from their favorite IDE. They can create new Windmill scripts and flows, edit existing ones, and push them to the Staging repository. Some developers can work directly in Windmill's web IDE. All of this happens in the Staging workspace.
42-
- Every time a script or a flow is deployed in the Staging workspace, Windmill will automatically commit the change to the Git repository using [Git sync](../11_git_sync/index.mdx). It can either commit directly to a specific (i.e. `staging`) branch, or open PRs to this branch (one PR per script/flow).
43-
- Within the Git repository, every time the `staging` branch is merged into the production branch (i.e. `main`), all the changes are pushed at once the Windmill Production workspace.
44-
45-
To summarize, developers operate only in Windmill Staging workspace. Windmill Production workspace is updated only by the CI when the Git staging branch is merged into the production branch.
46-
47-
Now let's deep dive into the first part. We will first explain how developers can set up their local environment to be able to create and edit Windmill script from their IDE, then we will see how to sync Windmill workspaces to a Git repository.
48-
49-
The second part is well covered in:
13+
Usually however, you will need for a robust setup to enable collaboration and compatibility with version control tools like git. The recommended approach for this is to use [Workspace Forks](../20_workspace_forks/index.mdx) and [Git Sync](../11_git_sync/index.mdx).
14+
<div className="grid grid-cols-2 gap-6 mb-4">
15+
<DocCard
16+
title="Workspace forks"
17+
description="Create workspace forks for parallel development workflows"
18+
href="/docs/advanced/workspace_forks"
19+
/>
20+
<DocCard
21+
title="Git sync"
22+
description="Automatically commit and push workspace changes to your Git repository."
23+
href="/docs/advanced/git_sync"
24+
/>
25+
</div>
5026

27+
Another advanced workflow that doesn't use workspace forks is explained here:
5128
<div className="grid grid-cols-2 gap-6 mb-4">
5229
<DocCard
53-
title="Deploy to prod using a git workflow"
54-
description="Windmill integration with Git repositories makes it possible to adopt a robust development process for your Windmill scripts, flows and apps."
30+
title="Git Promotion workflow"
31+
description="Windmill integration with Git makes it possible to have a robust git-based deployment workflow"
5532
href="/docs/advanced/deploy_gh_gl"
5633
/>
5734
</div>
-239 KB
Binary file not shown.

0 commit comments

Comments
 (0)