OpenFn / OpenFn/lightning

sandboxes: cannot restore sync on a sandbox

Open
#4,654 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

sandboxes and sync Sandboxes v2
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.