This commit is contained in:
Ruben Fiszel
2025-07-31 12:22:04 +00:00
parent 4b9683f146
commit 9284f7b966
+90
View File
@@ -0,0 +1,90 @@
# 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
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 specific Overrides
```yaml
branches:
branchName:
...
overrides:
skipResources: false
...
```
## Git sync overrides
```yaml
branches:
branchName:
...
overrides:
skipResources: false
...
promotionOverrides:
skipResources: true
...
```
## Workspace specific items
```yaml
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>`
We had a github action that check when those branches are deleted and it delete the ephemeral workspace
TBD: can ephemeral workspaces be created from UI? Most likely yes, so git sync need may need to able to create branches directly