sandboxes: cannot restore sync on a sandbox
Nobody has claimed this yet.
- Dominant language
- Elixir
- Stars
- 296
- Forks
- 86
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 50
Description
This is slightly complex to explain: consider this scenario:
- User creates a sandbox and sets up github sync against a branch
- They make changes, merge into main, and delete the sandbox
- The branch on github still exists with a state file and sync configuration files
- The user creates another sandbox with the same name (like
dev) and creates a new GH sync - If the user wanted to import from github in that sync, the UUIDs of the imported statefile would be wrong., and the import would fail. Like there's no link between the new sandbox and the old project file
This hurt services because they deleted a sandbox in error, and could not restore a sandbox in the app from a state file on github (although they should have been able to resolve this with the sync v2 CLI commands)
When deleting a sandbox with github sync, we should probably go into github and remove all the sync stuff. This would actually have hurt services in a recent use-case because we'd have removed the statefile from GH. But if they were using v2 sync, we could remove the state file (project.yaml v2) without affecting the workflows directory, so it wouldn't be so bad.
It might also be useful for us to auto-create GH sync on sandbox fork: see https://github.com/OpenFn/lightning/issues/4653
I think if the following things are true, this issue doesn't matter:
- Sync is tidied when deleting a sandbox
- Sandboxes are soft-deleted on merge
- Sync uses v2 by default
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the sync v2 CLI commands and trace how the project.yaml v2 state file, sync configuration files, and workflows directory are handled when a sandbox is deleted and recreated. Define and verify a consistent restore path for a new sandbox using an existing GitHub branch, while preserving workflows where appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir, github
- Domain
- backend, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100