Skip to content

Replace ProviderFactory and WorkspaceSession with IVersionControl, add History - #4

Merged
caroott merged 11 commits into
mainfrom
feature/git-history
Nov 27, 2026
Merged

caroott merged 11 commits into
mainfrom
feature/git-history

Conversation

@caroott

@caroott caroott commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

All providers implement now one interface: IVersionControl. It replaces ProviderFactory, WorkspaceSession and the optional services. This breaks every consumer of 0.5.0.

What changes for a consumer

  • GitProvider.create and LakeFsProvider.create take one options record and return the provider. The earlier creation functions are gone.
  • Open, Clone, Initialize and Bind return an opened Repository. Every other function takes it as its first argument, and Close releases it. A provider refuses a repository that another provider opened.
  • Open takes the folder and nothing else. The library stores no binding, and it no longer looks up which provider owns a folder. A host asks Probe of its providers.
  • Every call returns CallResult<'T>. It is Executed with the OperationResult, or NoOp with a reason when the provider does not have the function. The stand-in services and the code service_unavailable are gone.
  • A provider is a ProviderFunctions list in which each entry is Implemented or Missing, wrapped by ListedProvider. Subscribe.single and Subscribe.all give a consumer the functions with their own signatures.
  • The new group IHistory has ListRevisions (newest first, in pages) and GetRevisionChanges. Git implements both.
  • DiffComparison.Revision compares a file in a commit with its first parent.
  • The abstraction says "repository" where it said "workspace" (RepositoryDescriptor, RepositoryStatus, RepositoryRoot), and OperationEffect.NoOp is Unchanged.
  • Fixed: an update that has nothing to merge but downloads large files now reports Performed with the downloaded paths.

The library is built and tested with Fable 5.26.0. The README and the two guides (docs/consuming.md, docs/provider-authoring.md) describe the interface, and docs/workspace-bindings.md is removed with the bindings.

Two cases that are new:

  • A provider refuses a repository that another provider opened, checked against the real Git and lakeFS providers.
  • A malformed history cursor fails with invalid_cursor.

The F# samples of the guides were compiled against the library.

Known issues

  • The Git provider reports the root of an opened repository as Git spells it, with links resolved. A host that keeps a table of opened repositories has to key it by the folder it passed to Open. docs/consuming.md says so. Reporting the folder as given would be a second behavior change in Open, so it is not part of this PR.
  • The lakeFS provider finds the state of a folder by the folder and takes the newest entry. This is an interim solution.
  • Two opened repositories of the identical folder share their text diffs when one of them closes: the close ends the diffs of the other.
  • ProbeResult.Detected still carries a bindingHint that no provider fills. Removing it changes the result of Probe, which this PR leaves as it is.

@caroott
caroott merged commit f5b6faf into main Nov 27, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant