OpenFn / OpenFn/kit

Sync: allow fast-forward on checkout

Open
#1,449 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
21
Forks
23
Avg merge
1d 22h
Merged PRs (30d)
17

Description

We get an invalid divergence warning right now when trying to fast-forward the local workflow to reflect the app. Here's the deal:

  • I pull the project so it's checked out locally
  • I change something remotely
  • I pull again
  • divergence warning! Because the CLI compares the incoming workflow to the thing expanded on disk, and they are not the same

The problem is that checkout doesn't really understand a fast-forward. It just sees there's a change. It should be quite happy to understand the the local version is just behind the remote one, and do it.

where this gets tricky is that when we fetch from the app, the version history may have been squashed. SO we get one new version from the app which isn't anywhere locally (and so we can't history compare it properly)

So it should be like:

  • When we fetch, we keep the version history and only add new states
  • When we checkout, if the head version of the active workflow is in the history of the incoming workflow, that's a fast forward and we checkout without warning
  • We can prune version histories by finding any local version that is not referenced elsewhere locally

The answer is think is that the local project must keep all local histories it needs, and add new histories from the app.

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 by tracing the CLI's fetch and checkout flows, especially how workflow version histories are represented and compared. Define how fetched histories are preserved, how a local head is recognized as an incoming fast-forward, and when unreferenced histories can be pruned. Done means a fast-forward checkout completes without a divergence warning while required local history remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.