Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ linters:
- github.com/go-git/go-git/v6/storage.Storer
- github.com/go-git/go-git/v6/plumbing/storer.EncodedObjectIter
- github.com/go-git/go-billy/v6.Filesystem
- entire.io/entire/git-sync/internal/auth.Method
- entire.io/entire/gitsync/internal/auth.Method
nolintlint:
require-explanation: true
require-specific: true
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ The command surface is:

`git-sync` now has a two-tier Go API:

- `pkg/gitsync`
- `gitsync`
- stable embedding surface for queue workers and other external callers
- typed `Probe`, `Plan`, `Sync`, and `Replicate` requests/results
- injected auth and HTTP client support
- `pkg/gitsync/unstable`
- `unstable`
- explicitly non-stable surface for first-party tooling and advanced controls
- includes `Bootstrap`, `Fetch`, batching and measurement knobs, and CLI-oriented execution options

If you are embedding `git-sync` outside this repo, prefer `pkg/gitsync`. The CLI and benchmark command use `pkg/gitsync/unstable` because they still need direct access to advanced engine controls that are intentionally not part of the stable API.
If you are embedding `git-sync` outside this repo, prefer `gitsync`. The CLI and benchmark command use `unstable` because they still need direct access to advanced engine controls that are intentionally not part of the stable API.

The stable `pkg/gitsync` results are shaped for workers:
The stable `gitsync` results are shaped for workers:

- `Refs`
- per-ref outcomes
Expand Down
4 changes: 2 additions & 2 deletions pkg/gitsync/client.go → client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"net/http"

"entire.io/entire/git-sync/internal/validation"
"entire.io/entire/git-sync/pkg/gitsync/internalbridge"
"entire.io/entire/gitsync/internal/validation"
"entire.io/entire/gitsync/internalbridge"
)

// Options configures a Client. It is intentionally small in the first public cut.
Expand Down
2 changes: 1 addition & 1 deletion pkg/gitsync/client_test.go → client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/go-git/go-git/v6/plumbing/protocol/packp"
"github.com/go-git/go-git/v6/plumbing/transport"

"entire.io/entire/git-sync/internal/syncertest"
"entire.io/entire/gitsync/internal/syncertest"
)

type errAuthProvider struct{}
Expand Down
6 changes: 3 additions & 3 deletions cmd/git-sync-bench/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (

git "github.com/go-git/go-git/v6"

"entire.io/entire/git-sync/internal/validation"
"entire.io/entire/git-sync/pkg/gitsync"
"entire.io/entire/git-sync/pkg/gitsync/unstable"
"entire.io/entire/gitsync"
"entire.io/entire/gitsync/internal/validation"
"entire.io/entire/gitsync/unstable"
)

type scenario string
Expand Down
2 changes: 1 addition & 1 deletion cmd/git-sync-bench/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"testing"

"entire.io/entire/git-sync/pkg/gitsync/unstable"
"entire.io/entire/gitsync/unstable"
)

func TestSummarizeRuns(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions cmd/git-sync/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"os"
"strings"

"entire.io/entire/git-sync/internal/validation"
"entire.io/entire/git-sync/pkg/gitsync"
"entire.io/entire/git-sync/pkg/gitsync/unstable"
"entire.io/entire/gitsync"
"entire.io/entire/gitsync/internal/validation"
"entire.io/entire/gitsync/unstable"
"github.com/go-git/go-git/v6/plumbing"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/git-sync/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"testing"
"time"

"entire.io/entire/git-sync/pkg/gitsync/unstable"
"entire.io/entire/gitsync/unstable"
billy "github.com/go-git/go-billy/v6"
"github.com/go-git/go-billy/v6/memfs"
git "github.com/go-git/go-git/v6"
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ The current transfer modes are:

## Package Model

- `pkg/gitsync`
- `gitsync`
- stable public embedding API
- typed `Probe`, `Plan`, `Sync`, and `Replicate` requests/results
- auth and HTTP client injection for worker-style callers
- `pkg/gitsync/unstable`
- `unstable`
- explicitly non-stable first-party tooling surface
- advanced controls, `Bootstrap`, `Fetch`, and CLI-oriented knobs
- `internal/gitproto`
Expand All @@ -120,9 +120,9 @@ The current transfer modes are:

The project now separates embedding concerns from first-party tooling concerns:

- `pkg/gitsync` is the stable library boundary.
- `gitsync` is the stable library boundary.
Callers express orchestration intent through typed probe, plan, sync, and replicate requests. Auth and transport are injected. Execution strategy remains internal.
- `pkg/gitsync/unstable` is the escape hatch for advanced controls.
- `unstable` is the escape hatch for advanced controls.
It exists so the CLI and benchmark tool can use batching limits, memory measurement, verbose progress, bootstrap, and fetch without widening the stable API prematurely.

The stable result contract is also intentionally worker-oriented:
Expand All @@ -136,8 +136,8 @@ The stable result contract is also intentionally worker-oriented:

That split is intentional:

- external embedders should depend on `pkg/gitsync`
- first-party tools inside this repo may use `pkg/gitsync/unstable`
- external embedders should depend on `gitsync`
- first-party tools inside this repo may use `unstable`
- strategy selection, batching heuristics, and materialized fallback controls are not yet treated as stable product contracts

## Protocol Boundaries
Expand Down
16 changes: 8 additions & 8 deletions docs/embedding.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

For most embedders, there are two important rules:

- use `pkg/gitsync`
- avoid depending on `pkg/gitsync/unstable` unless you are acting like first-party tooling
- use `gitsync`
- avoid depending on `unstable` unless you are acting like first-party tooling

## Stable vs Unstable

Use `pkg/gitsync` when you want a durable worker-facing API:
Use `gitsync` when you want a durable worker-facing API:

- `Probe`
- `Plan`
Expand All @@ -18,7 +18,7 @@ Use `pkg/gitsync` when you want a durable worker-facing API:
- typed requests and results
- injected auth and HTTP client support

Use `pkg/gitsync/unstable` only when you need controls that are intentionally not yet stable:
Use `unstable` only when you need controls that are intentionally not yet stable:

- `Bootstrap`
- `Fetch`
Expand All @@ -27,7 +27,7 @@ Use `pkg/gitsync/unstable` only when you need controls that are intentionally no
- verbose execution controls
- other engine-adjacent tuning

The CLI and benchmark command use `pkg/gitsync/unstable` because they still need those controls. External workers should generally not.
The CLI and benchmark command use `unstable` because they still need those controls. External workers should generally not.

## Worker Shape

Expand All @@ -49,7 +49,7 @@ import (
"context"
"net/http"

"entire.io/entire/git-sync/pkg/gitsync"
"entire.io/entire/gitsync"
)

func runSync(ctx context.Context) error {
Expand Down Expand Up @@ -83,7 +83,7 @@ func runSync(ctx context.Context) error {

## Auth Injection

`pkg/gitsync` uses one auth ownership model:
`gitsync` uses one auth ownership model:

- requests carry endpoint identity
- `AuthProvider` resolves source and target auth
Expand Down Expand Up @@ -161,4 +161,4 @@ If you want stability, do not build external worker logic around:
- temp refs
- exact relay strategy names beyond coarse execution summary

Those are implementation details or advanced controls that currently belong in `pkg/gitsync/unstable`, not the stable embedding contract.
Those are implementation details or advanced controls that currently belong in `unstable`, not the stable embedding contract.
2 changes: 1 addition & 1 deletion pkg/gitsync/example_test.go → example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"net/http"

"entire.io/entire/git-sync/pkg/gitsync"
"entire.io/entire/gitsync"
)

func ExampleClient_Sync() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module entire.io/entire/git-sync
module entire.io/entire/gitsync

go 1.26.2

Expand Down
4 changes: 2 additions & 2 deletions internal/convert/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ package convert
import (
"github.com/go-git/go-git/v6/plumbing"

"entire.io/entire/git-sync/internal/gitproto"
"entire.io/entire/git-sync/internal/planner"
"entire.io/entire/gitsync/internal/gitproto"
"entire.io/entire/gitsync/internal/planner"
)

// DesiredRefs converts planner desired refs to gitproto desired refs.
Expand Down
4 changes: 2 additions & 2 deletions internal/convert/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"github.com/go-git/go-git/v6/plumbing"

"entire.io/entire/git-sync/internal/gitproto"
"entire.io/entire/git-sync/internal/planner"
"entire.io/entire/gitsync/internal/gitproto"
"entire.io/entire/gitsync/internal/planner"
)

func TestDesiredRefsForPlans(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/planner/planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"sort"

"entire.io/entire/git-sync/internal/validation"
"entire.io/entire/gitsync/internal/validation"
"github.com/go-git/go-git/v6/plumbing"
"github.com/go-git/go-git/v6/plumbing/object"
"github.com/go-git/go-git/v6/plumbing/storer"
Expand Down
2 changes: 1 addition & 1 deletion internal/planner/planner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"entire.io/entire/git-sync/internal/validation"
"entire.io/entire/gitsync/internal/validation"
git "github.com/go-git/go-git/v6"
"github.com/go-git/go-git/v6/plumbing"
"github.com/go-git/go-git/v6/plumbing/object"
Expand Down
2 changes: 1 addition & 1 deletion internal/planner/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sort"
"strings"

"entire.io/entire/git-sync/internal/validation"
"entire.io/entire/gitsync/internal/validation"
"github.com/go-git/go-git/v6/plumbing"
)

Expand Down
6 changes: 3 additions & 3 deletions internal/strategy/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"github.com/go-git/go-git/v6/plumbing/storer"
"github.com/go-git/go-git/v6/storage/memory"

"entire.io/entire/git-sync/internal/convert"
"entire.io/entire/git-sync/internal/gitproto"
"entire.io/entire/git-sync/internal/planner"
"entire.io/entire/gitsync/internal/convert"
"entire.io/entire/gitsync/internal/gitproto"
"entire.io/entire/gitsync/internal/planner"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/strategy/bootstrap/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"github.com/go-git/go-git/v6/plumbing/transport"
"github.com/go-git/go-git/v6/storage/memory"

"entire.io/entire/git-sync/internal/gitproto"
"entire.io/entire/git-sync/internal/planner"
"entire.io/entire/gitsync/internal/gitproto"
"entire.io/entire/gitsync/internal/planner"
)

func TestIsTargetBodyLimitError(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/strategy/incremental/incremental.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

"github.com/go-git/go-git/v6/plumbing"

"entire.io/entire/git-sync/internal/convert"
"entire.io/entire/git-sync/internal/gitproto"
"entire.io/entire/git-sync/internal/planner"
"entire.io/entire/gitsync/internal/convert"
"entire.io/entire/gitsync/internal/gitproto"
"entire.io/entire/gitsync/internal/planner"
)

// Params holds the inputs for an incremental relay execution.
Expand Down
6 changes: 3 additions & 3 deletions internal/strategy/incremental/incremental_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (

"github.com/go-git/go-git/v6/plumbing"

"entire.io/entire/git-sync/internal/convert"
"entire.io/entire/git-sync/internal/gitproto"
"entire.io/entire/git-sync/internal/planner"
"entire.io/entire/gitsync/internal/convert"
"entire.io/entire/gitsync/internal/gitproto"
"entire.io/entire/gitsync/internal/planner"
)

func TestPlansToPushPlans(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/strategy/materialized/materialized.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/go-git/go-git/v6/plumbing"
"github.com/go-git/go-git/v6/plumbing/storer"

"entire.io/entire/git-sync/internal/convert"
"entire.io/entire/git-sync/internal/gitproto"
"entire.io/entire/git-sync/internal/planner"
"entire.io/entire/gitsync/internal/convert"
"entire.io/entire/gitsync/internal/gitproto"
"entire.io/entire/gitsync/internal/planner"
)

// Params holds the inputs for a materialized push.
Expand Down
8 changes: 4 additions & 4 deletions internal/strategy/materialized/materialized_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/go-git/go-git/v6/plumbing/object"
"github.com/go-git/go-git/v6/plumbing/storer"

"entire.io/entire/git-sync/internal/convert"
"entire.io/entire/git-sync/internal/gitproto"
"entire.io/entire/git-sync/internal/planner"
"entire.io/entire/git-sync/internal/syncertest"
"entire.io/entire/gitsync/internal/convert"
"entire.io/entire/gitsync/internal/gitproto"
"entire.io/entire/gitsync/internal/planner"
"entire.io/entire/gitsync/internal/syncertest"
)

func TestPlansToPushPlans(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/strategy/replicate/replicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (

"github.com/go-git/go-git/v6/plumbing"

"entire.io/entire/git-sync/internal/convert"
"entire.io/entire/git-sync/internal/gitproto"
"entire.io/entire/git-sync/internal/planner"
"entire.io/entire/gitsync/internal/convert"
"entire.io/entire/gitsync/internal/gitproto"
"entire.io/entire/gitsync/internal/planner"
)

// Params holds the inputs for a replication relay execution.
Expand Down
4 changes: 2 additions & 2 deletions internal/strategy/replicate/replicate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/go-git/go-git/v6/plumbing"

"entire.io/entire/git-sync/internal/gitproto"
"entire.io/entire/git-sync/internal/planner"
"entire.io/entire/gitsync/internal/gitproto"
"entire.io/entire/gitsync/internal/planner"
)

type fakeSourceService struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/syncer/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/go-git/go-git/v6/plumbing/transport"
transporthttp "github.com/go-git/go-git/v6/plumbing/transport/http"

"entire.io/entire/git-sync/internal/auth"
"entire.io/entire/gitsync/internal/auth"
)

func TestResolveAuthMethodPrefersExplicitToken(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/syncer/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package syncer

import (
"context"
"entire.io/entire/git-sync/internal/syncertest"
"entire.io/entire/gitsync/internal/syncertest"
git "github.com/go-git/go-git/v6"
"github.com/go-git/go-git/v6/plumbing"
"github.com/go-git/go-git/v6/plumbing/storer"
Expand Down
6 changes: 3 additions & 3 deletions internal/syncer/git_http_backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"sync"
"testing"

"entire.io/entire/git-sync/internal/gitproto"
"entire.io/entire/git-sync/internal/planner"
bstrap "entire.io/entire/git-sync/internal/strategy/bootstrap"
"entire.io/entire/gitsync/internal/gitproto"
"entire.io/entire/gitsync/internal/planner"
bstrap "entire.io/entire/gitsync/internal/strategy/bootstrap"
"github.com/go-git/go-git/v6/plumbing"
)

Expand Down
Loading
Loading