Compare commits

...

4 Commits

Author SHA1 Message Date
Ruben Fiszel
061c3a2414 update 2025-08-04 14:20:51 +00:00
Ruben Fiszel
4259f783fa update 2025-08-04 14:18:43 +00:00
Ruben Fiszel
09c2e14276 update 2025-08-04 14:18:15 +00:00
Ruben Fiszel
9284f7b966 cliV3 2025-07-31 12:22:04 +00:00

93
cli/GIT_MODE_RFC.md Normal file
View File

@@ -0,0 +1,93 @@
# Cli Git mode
As part of the local dev improvements, improving the CLI behavior in the most common setup (used with Git Sync is primordial). Here are a collection of the proposed changes.
The current wmill.yaml contains sync settings such as:
```yaml
includes:
- "**"
excludes:
- "**"
skipResources: true
overrides:
baseUrl:workspace_id:repo:
skipVariables: true
```
## Branch mapping
When in a git repo, a branches section is MANDATORY. The CLI check for .git in every parent folder if branches section is missing and error if missing. Also error if current branch is not in the branches config.
```yaml
git_branches:
branchName:
baseUrl: X
workspaceId: Y
```
We keep current saved user workspaces as "profiles" but their behavior changes and we refer to them as "user profile". They are stored in CONFIG_HOME/wmill
When a single user profile correspond to branch implied: baseUrl / workspaceId, it is chosen. When multiple, we store in the user config the last that was chosen for that compatible branch/baseUrl/workspaceId.
When no user profile is found for the given branch, we ask to create the profile.
## Workspace/Branch specific Overrides
```yaml
git_branches:
branchName:
...
overrides:
skipResources: false
...
```
## Git sync/Promotion overrides
Settings that only apply to promotion mode of git sync need to be set in a separate overrides called `promotionOverrides`. The effective settings for git sync promotion mode is common + promotionOverrides, the overrides block itself is ignored. This is used by git sync when pulling the settings from the wmill.yaml by picking the ones corresponding to the branch that correspond to the target promotion branch.
```yaml
git_branches:
branchName:
...
overrides:
skipResources: false
...
promotionOverrides:
skipResources: true
...
```
## Workspace/Branch specific items
```yaml
git_branches:
branchName:
...
specificItems:
variables:
- u/bar/foo
- f/foo/**
```
When doing a pull/push, for all the items listed, instead of using the item at expected path, we have the item at `<path>.branchName.<extension>`
## Ephemeral workspaces
Commands:
`wmill ephemeral create foo`
`wmill ephemeral delete foo`
Create a git branch, switch to it, create an ephemeral workspace with the current user as admin, and add the profile in the user config
Branch names: `wm_ephemeral/<origin-branch>/<ephemeral-workspace-name>` (`/` in `original-branch` are replaced with `//`
Workspace name: `ephemeral-<branch_name>-<ephermal-workspace-name>`
Assume settings + baseUrl from the `<origin-branch>`
- a github action checks when those ephemeral branches are deleted and it delete the ephemeral workspace on Windmill.
- Ephemeral workspaces can be created from UI as an additional option from "Fork" button, and from workspace settings). You select one of the git sync connection (in non promotion mode) branch as origin.
- Ephemeral workspaces have a specific drawer accessible from home page that allows them to merge in both direction from their origin workspace.
- Ephemeral workspaces have almost all their settings derived from original workspace, but git sync is setup in a specific way to point to the ephemeral branch