@ref0/git 0.20.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access/private-refs.mjs +1 -1
- package/dist/auth/access-jwt.mjs +3 -3
- package/dist/auth/auth-namespace.d.mts +3 -3
- package/dist/auth/auth-namespace.mjs +3 -2
- package/dist/auth/auth.d.mts +3 -3
- package/dist/auth/auth.mjs +9 -8
- package/dist/auth/authorize.mjs +1 -1
- package/dist/auth/fences.d.mts +1 -1
- package/dist/auth/host-function.mjs +1 -1
- package/dist/auth/host-services.mjs +4 -6
- package/dist/auth/identify.d.mts +1 -1
- package/dist/auth/identify.mjs +6 -0
- package/dist/auth/token-cleanup.mjs +2 -2
- package/dist/auth/token-rows.mjs +6 -1
- package/dist/auth/token-text.mjs +1 -1
- package/dist/auth/tokens-base.d.mts +1 -1
- package/dist/auth/tokens.d.mts +1 -1
- package/dist/auth/tokens.mjs +1 -1
- package/dist/client/client.d.mts +15 -7
- package/dist/client/client.mjs +21 -12
- package/dist/client/git-http.mjs +1 -1
- package/dist/client/local.mjs +60 -24
- package/dist/client/negotiate.mjs +3 -3
- package/dist/client/push-upload.mjs +26 -10
- package/dist/client/remote.mjs +4 -3
- package/dist/client/run-remote-helper.d.mts +2 -2
- package/dist/client/run-remote-helper.mjs +6 -6
- package/dist/client/slice-push.d.mts +1 -1
- package/dist/client/transport.mjs +3 -3
- package/dist/contracts/blobs.d.mts +3 -3
- package/dist/contracts/blobs.mjs +1 -1
- package/dist/contracts/calls-spent.mjs +5 -33
- package/dist/contracts/client.d.mts +15 -14
- package/dist/contracts/commits.d.mts +4 -4
- package/dist/contracts/commits.mjs +1 -1
- package/dist/contracts/engine.d.mts +2 -2
- package/dist/contracts/events.d.mts +1 -1
- package/dist/contracts/events.mjs +1 -1
- package/dist/contracts/files.d.mts +4 -4
- package/dist/contracts/files.mjs +1 -1
- package/dist/contracts/forks.d.mts +4 -4
- package/dist/contracts/forks.mjs +1 -1
- package/dist/contracts/git-hooks.d.mts +1 -1
- package/dist/contracts/git.d.mts +9 -5
- package/dist/contracts/grants.d.mts +1 -1
- package/dist/contracts/merges.d.mts +1 -1
- package/dist/contracts/object-values.d.mts +1 -0
- package/dist/contracts/object-values.mjs +16 -1
- package/dist/contracts/objects.d.mts +20 -17
- package/dist/contracts/opaque.mjs +1 -1
- package/dist/contracts/operations.mjs +1 -1
- package/dist/contracts/queue.d.mts +208 -44
- package/dist/contracts/queue.mjs +5 -5
- package/dist/contracts/refs.d.mts +5 -5
- package/dist/contracts/refs.mjs +1 -1
- package/dist/contracts/remote.d.mts +3 -6
- package/dist/contracts/repos.d.mts +3 -3
- package/dist/contracts/repos.mjs +1 -1
- package/dist/contracts/result.d.mts +10 -7
- package/dist/contracts/result.mjs +8 -3
- package/dist/contracts/rules.d.mts +2 -2
- package/dist/contracts/server.d.mts +8 -10
- package/dist/contracts/services.d.mts +6 -9
- package/dist/contracts/services.mjs +1 -2
- package/dist/contracts/signin.d.mts +1 -1
- package/dist/contracts/store.d.mts +2 -2
- package/dist/contracts/sync.d.mts +63 -6
- package/dist/contracts/sync.mjs +3 -2
- package/dist/contracts/tags.d.mts +3 -3
- package/dist/contracts/tags.mjs +1 -1
- package/dist/contracts/tokens.d.mts +2 -2
- package/dist/contracts/tokens.mjs +1 -1
- package/dist/contracts/topics.d.mts +9 -9
- package/dist/contracts/trees.d.mts +4 -4
- package/dist/contracts/trees.mjs +1 -1
- package/dist/contracts/work.d.mts +4 -4
- package/dist/contracts/work.mjs +2 -2
- package/dist/core/access.d.mts +1 -1
- package/dist/core/ancestry.mjs +30 -34
- package/dist/core/{promise.mjs → call-groups.mjs} +7 -30
- package/dist/core/call-services.mjs +1 -1
- package/dist/core/events/deliver.d.mts +2 -2
- package/dist/core/events/deliver.mjs +3 -3
- package/dist/core/events/retired.mjs +1 -1
- package/dist/core/forks.mjs +5 -5
- package/dist/core/hooks/groups.mjs +2 -2
- package/dist/core/imports.mjs +101 -21
- package/dist/core/index-job.mjs +14 -9
- package/dist/core/index-lost.d.mts +1 -1
- package/dist/core/loose-tally.mjs +38 -15
- package/dist/core/merge-parts.d.mts +17 -4
- package/dist/core/merge-parts.mjs +7 -2
- package/dist/core/mirror-rows.mjs +31 -1
- package/dist/core/objects/blobs.mjs +8 -10
- package/dist/core/objects/files.mjs +20 -17
- package/dist/core/objects/objects-layer.mjs +1 -1
- package/dist/core/objects/peel.mjs +1 -7
- package/dist/core/objects/reading.mjs +19 -18
- package/dist/core/objects/tree-edits.mjs +1 -1
- package/dist/core/objects/trees.mjs +257 -58
- package/dist/core/objects/writing.mjs +3 -9
- package/dist/core/own-writes.mjs +1 -1
- package/dist/core/parts.d.mts +8 -1
- package/dist/core/parts.mjs +8 -4
- package/dist/core/purge.mjs +31 -18
- package/dist/core/push.d.mts +2 -2
- package/dist/core/push.mjs +125 -94
- package/dist/core/receipts.d.mts +2 -2
- package/dist/core/receipts.mjs +9 -2
- package/dist/core/ref-index-job.mjs +4 -4
- package/dist/core/ref-view.mjs +74 -31
- package/dist/core/refs.mjs +3 -3
- package/dist/core/repack.mjs +25 -30
- package/dist/core/repo-info.mjs +1 -1
- package/dist/core/repos.mjs +1 -1
- package/dist/core/rules/changes.mjs +18 -40
- package/dist/core/rules/check.mjs +6 -5
- package/dist/core/rules/commit-changes.mjs +3 -15
- package/dist/core/rules/context.d.mts +3 -3
- package/dist/core/rules/context.mjs +18 -14
- package/dist/core/rules/fetch.mjs +1 -1
- package/dist/core/rules/protect.mjs +30 -17
- package/dist/core/saved-caller-views.d.mts +1 -1
- package/dist/core/saved-caller-views.mjs +3 -3
- package/dist/core/saved-callers.d.mts +1 -1
- package/dist/core/saved-callers.mjs +1 -1
- package/dist/core/seam.d.mts +1 -2
- package/dist/core/view.d.mts +6 -3
- package/dist/core/view.mjs +11 -10
- package/dist/core/work.mjs +2 -2
- package/dist/engine/allotted-xdiff.mjs +3 -16
- package/dist/engine/combined.d.mts +3 -0
- package/dist/engine/combined.mjs +200 -185
- package/dist/engine/content.d.mts +2 -2
- package/dist/engine/content.mjs +1 -1
- package/dist/engine/merge.mjs +7 -9
- package/dist/engine/reads.d.mts +2 -2
- package/dist/engine/reads.mjs +22 -14
- package/dist/engine/xdiff.d.mts +1 -1
- package/dist/engine/xdiff.mjs +1 -1
- package/dist/event-streams/event-streams.d.mts +1 -1
- package/dist/event-streams/event-streams.mjs +1 -1
- package/dist/event-streams/stream.d.mts +2 -2
- package/dist/event-streams/stream.mjs +3 -3
- package/dist/extend.d.mts +2 -6
- package/dist/extend.mjs +1 -5
- package/dist/http/core-parts.mjs +83 -26
- package/dist/http/handler.mjs +54 -9
- package/dist/http/parts.d.mts +1 -0
- package/dist/http/push-upload-job.mjs +138 -24
- package/dist/http/push-uploads.mjs +2 -2
- package/dist/http/receive-pack.mjs +14 -53
- package/dist/http/request-snapshot.mjs +258 -0
- package/dist/http/upload-pack.mjs +23 -18
- package/dist/index.d.mts +29 -21
- package/dist/index.mjs +11 -2
- package/dist/lfs/base.d.mts +1 -1
- package/dist/lfs/copy.d.mts +49 -1
- package/dist/lfs/copy.mjs +135 -22
- package/dist/lfs/layer.d.mts +4 -3
- package/dist/lfs/layer.mjs +4 -5
- package/dist/lfs/locks.mjs +2 -2
- package/dist/lfs/objects.d.mts +1 -1
- package/dist/lfs/objects.mjs +3 -3
- package/dist/lfs/pointers.mjs +1 -1
- package/dist/lfs/rows.d.mts +1 -1
- package/dist/lfs/rows.mjs +11 -4
- package/dist/lfs/upkeep.mjs +40 -9
- package/dist/lfs/uploaded.mjs +1 -1
- package/dist/lfs/wire.mjs +1 -1
- package/dist/merges/merges.mjs +17 -2
- package/dist/protocol/bytes/buffers.d.mts +1 -1
- package/dist/protocol/bytes/buffers.mjs +1 -1
- package/dist/protocol/bytes/deflate.d.mts +1 -1
- package/dist/protocol/bytes/deflate.mjs +1 -1
- package/dist/protocol/bytes/inflate.d.mts +1 -1
- package/dist/protocol/bytes/inflate.mjs +1 -1
- package/dist/protocol/bytes/sha1.d.mts +1 -1
- package/dist/protocol/bytes/sha1.mjs +1 -1
- package/dist/protocol/diff/read.d.mts +2 -1
- package/dist/protocol/diff/read.mjs +102 -8
- package/dist/protocol/packs/graph.mjs +1 -1
- package/dist/protocol/packs/idx.d.mts +1 -1
- package/dist/protocol/packs/idx.mjs +1 -1
- package/dist/protocol/packs/parts.mjs +1 -1
- package/dist/protocol/packs/reader.d.mts +1 -1
- package/dist/protocol/packs/reader.mjs +1 -1
- package/dist/protocol/packs/write-error.d.mts +1 -1
- package/dist/protocol/packs/write-error.mjs +1 -1
- package/dist/protocol/packs/writer.mjs +3 -3
- package/dist/protocol/wire/advertisement.d.mts +1 -1
- package/dist/protocol/wire/advertisement.mjs +3 -2
- package/dist/protocol/wire/fetch.d.mts +1 -1
- package/dist/protocol/wire/fetch.mjs +1 -1
- package/dist/protocol/wire/lines.d.mts +9 -1
- package/dist/protocol/wire/lines.mjs +28 -1
- package/dist/protocol/wire/push-uploads.mjs +10 -7
- package/dist/protocol/wire/receive-pack.d.mts +1 -1
- package/dist/protocol/wire/receive-pack.mjs +1 -1
- package/dist/protocol/wire/report-status.d.mts +1 -1
- package/dist/protocol/wire/report-status.mjs +1 -1
- package/dist/protocol/wire/v2.d.mts +1 -1
- package/dist/protocol/wire/v2.mjs +1 -1
- package/dist/queue/advance.mjs +31 -24
- package/dist/queue/base.d.mts +5 -3
- package/dist/queue/calls.mjs +5 -5
- package/dist/queue/commit.mjs +1 -1
- package/dist/queue/host.d.mts +1 -1
- package/dist/queue/layer.d.mts +0 -1
- package/dist/queue/layer.mjs +9 -5
- package/dist/queue/schedule.mjs +1 -1
- package/dist/queue/search.mjs +1 -1
- package/dist/queue/state.mjs +1 -1
- package/dist/queue/trim.mjs +2 -2
- package/dist/rest/client.d.mts +1 -1
- package/dist/rest/client.mjs +6 -6
- package/dist/rest/errors.mjs +1 -1
- package/dist/rest/handler.mjs +2 -2
- package/dist/rest/handlers.mjs +16 -6
- package/dist/rest/layer.mjs +1 -1
- package/dist/rest/listen.mjs +2 -2
- package/dist/rest/refs.mjs +1 -1
- package/dist/server/edge.mjs +27 -3
- package/dist/server/git-layer.d.mts +1 -2
- package/dist/server/git-layer.mjs +4 -5
- package/dist/server/lifecycle.mjs +1 -1
- package/dist/server/registry.mjs +2 -8
- package/dist/server/server.mjs +62 -43
- package/dist/signin/context.d.mts +1 -1
- package/dist/signin/context.mjs +1 -1
- package/dist/signin/forms.mjs +1 -1
- package/dist/signin/grants.d.mts +2 -2
- package/dist/signin/grants.mjs +1 -1
- package/dist/signin/wire.mjs +1 -1
- package/dist/storage/allotted.mjs +4 -9
- package/dist/storage/batch-upkeep.mjs +31 -12
- package/dist/storage/batches.d.mts +2 -3
- package/dist/storage/batches.mjs +52 -49
- package/dist/storage/budget.mjs +23 -1
- package/dist/storage/calls.d.mts +1 -1
- package/dist/storage/calls.mjs +41 -43
- package/dist/storage/charged-cache.mjs +180 -0
- package/dist/storage/chunks.d.mts +3 -3
- package/dist/storage/chunks.mjs +121 -8
- package/dist/storage/counted-bucket.mjs +32 -10
- package/dist/storage/fetch-row-cache.d.mts +6 -0
- package/dist/storage/fetch-row-cache.mjs +211 -0
- package/dist/storage/fetch.d.mts +1 -0
- package/dist/storage/fetch.mjs +54 -242
- package/dist/storage/held-types.d.mts +0 -1
- package/dist/storage/host-bucket.mjs +9 -4
- package/dist/storage/index-bitmaps.mjs +77 -49
- package/dist/storage/index-build.d.mts +2 -3
- package/dist/storage/index-build.mjs +248 -48
- package/dist/storage/index-fetch.d.mts +3 -1
- package/dist/storage/index-fetch.mjs +60 -21
- package/dist/storage/index-graph.mjs +1 -1
- package/dist/storage/index-layers.mjs +55 -25
- package/dist/storage/index-reach.mjs +15 -22
- package/dist/storage/index-whole.d.mts +7 -0
- package/dist/storage/index-whole.mjs +145 -37
- package/dist/storage/largest-files.mjs +1 -7
- package/dist/storage/layout.mjs +17 -1
- package/dist/storage/lfs-pointers.mjs +1 -6
- package/dist/storage/link-join.mjs +55 -16
- package/dist/storage/list-source.d.mts +7 -0
- package/dist/storage/list-source.mjs +288 -0
- package/dist/storage/loose.d.mts +8 -8
- package/dist/storage/loose.mjs +157 -91
- package/dist/storage/memory-budget.mjs +226 -22
- package/dist/storage/merge-cut.mjs +9 -6
- package/dist/storage/merge-fence.mjs +1 -1
- package/dist/storage/merge-row.mjs +1 -1
- package/dist/storage/merge.d.mts +2 -3
- package/dist/storage/merge.mjs +2 -2
- package/dist/storage/object-rows.d.mts +3 -3
- package/dist/storage/object-rows.mjs +179 -38
- package/dist/storage/pack-order.mjs +97 -44
- package/dist/storage/pack-ranges.mjs +44 -16
- package/dist/storage/pack-reads.d.mts +5 -3
- package/dist/storage/pack-reads.mjs +236 -72
- package/dist/storage/pack-receive.d.mts +1 -2
- package/dist/storage/pack-receive.mjs +21 -17
- package/dist/storage/packs.d.mts +1 -1
- package/dist/storage/packs.mjs +477 -116
- package/dist/storage/placed-reads.mjs +33 -16
- package/dist/storage/prune-seen.mjs +1 -1
- package/dist/storage/prune-walk.mjs +1 -1
- package/dist/storage/prune.mjs +4 -31
- package/dist/storage/push-allotment.mjs +26 -14
- package/dist/storage/push-uploads.mjs +195 -57
- package/dist/storage/pushed-commits.mjs +20 -1
- package/dist/storage/quarantine.d.mts +2 -3
- package/dist/storage/range-cache.mjs +175 -40
- package/dist/storage/raw-ids.mjs +39 -10
- package/dist/storage/ready.d.mts +2 -3
- package/dist/storage/ready.mjs +114 -38
- package/dist/storage/receive-bounds.mjs +31 -9
- package/dist/storage/receive-cache.d.mts +7 -0
- package/dist/storage/receive-cache.mjs +147 -0
- package/dist/storage/receive-files.mjs +1 -1
- package/dist/storage/receive-links.mjs +1 -1
- package/dist/storage/receive-state.d.mts +2 -2
- package/dist/storage/receive-state.mjs +6 -8
- package/dist/storage/receive-steps.d.mts +20 -0
- package/dist/storage/receive-steps.mjs +298 -13
- package/dist/storage/repack-backlog.mjs +1 -6
- package/dist/storage/repack-contained.mjs +2 -2
- package/dist/storage/repack-job.mjs +1 -1
- package/dist/storage/repack.d.mts +2 -3
- package/dist/storage/repack.mjs +54 -9
- package/dist/storage/request-cache.mjs +57 -0
- package/dist/storage/roots.mjs +1 -24
- package/dist/storage/rows.d.mts +2 -2
- package/dist/storage/rows.mjs +1 -1
- package/dist/storage/runs.d.mts +2 -2
- package/dist/storage/runs.mjs +1 -1
- package/dist/storage/send-list.mjs +62 -25
- package/dist/storage/stream-whole.mjs +84 -63
- package/dist/storage/swap-walk.mjs +1 -1
- package/dist/storage/unpack.mjs +878 -450
- package/dist/storage/visible.mjs +110 -32
- package/dist/storage/walk.mjs +1 -0
- package/dist/storage/wants.mjs +22 -58
- package/dist/store/call-count.d.mts +2 -2
- package/dist/store/call-count.mjs +24 -11
- package/dist/store/catalogue.d.mts +1 -1
- package/dist/store/catalogue.mjs +19 -7
- package/dist/store/crossing.mjs +1 -7
- package/dist/store/cursor-seal.d.mts +1 -1
- package/dist/store/cursor-seal.mjs +1 -1
- package/dist/store/door.mjs +9 -4
- package/dist/store/errors.d.mts +2 -2
- package/dist/store/errors.mjs +107 -19
- package/dist/store/git-store.mjs +7 -2
- package/dist/store/job-try.mjs +90 -9
- package/dist/store/list-job.mjs +10 -34
- package/dist/store/outbox.d.mts +2 -2
- package/dist/store/outbox.mjs +2 -2
- package/dist/store/queue-jobs.mjs +6 -12
- package/dist/store/records.d.mts +2 -2
- package/dist/store/records.mjs +2 -2
- package/dist/store/ref-rows.d.mts +2 -2
- package/dist/store/ref-rows.mjs +2 -2
- package/dist/store/repo-record.d.mts +2 -2
- package/dist/store/repo-record.mjs +3 -3
- package/dist/store/request-snapshot.mjs +5 -0
- package/dist/store/reservations.mjs +2 -2
- package/dist/store/topic-jobs.mjs +5 -11
- package/dist/sync/bound.d.mts +3 -3
- package/dist/sync/bound.mjs +10 -7
- package/dist/sync/github.mjs +65 -67
- package/dist/sync/http.mjs +1 -1
- package/dist/sync/import.mjs +201 -66
- package/dist/sync/layer.d.mts +1 -1
- package/dist/sync/layer.mjs +6 -6
- package/dist/sync/lfs-batch.mjs +1 -1
- package/dist/sync/lfs-copy.mjs +175 -15
- package/dist/sync/mirror.mjs +5 -10
- package/dist/sync/said.mjs +1 -1
- package/dist/sync/step.mjs +268 -86
- package/dist/sync/tries.mjs +25 -6
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/topics/advance.mjs +3 -3
- package/dist/topics/calls.mjs +1 -1
- package/dist/topics/layer.d.mts +15 -14
- package/dist/topics/members.mjs +1 -1
- package/dist/topics/topic.mjs +1 -1
- package/package.json +3 -13
- package/dist/auth/helpers.mjs +0 -17
- package/dist/auth.d.mts +0 -5
- package/dist/auth.mjs +0 -5
- package/dist/core/rules/commit-changes.d.mts +0 -12
- package/dist/effect.d.mts +0 -9
- package/dist/effect.mjs +0 -7
- package/dist/server/joined.d.mts +0 -70
- package/dist/server/joined.mjs +0 -41
|
@@ -4,11 +4,10 @@ import { InternalRepoId, Oid } from "./ids.mjs";
|
|
|
4
4
|
import { BlobLimit, BlobNone, Bytes, FetchRequest, Filter, LfsPointers, ObjectType, ReadLimits, TreeFilter } from "./object-values.mjs";
|
|
5
5
|
import { RepoStats } from "./repos.mjs";
|
|
6
6
|
import { GitError, Result } from "./result.mjs";
|
|
7
|
-
import { EffectCalls } from "./services.mjs";
|
|
8
7
|
import { GitStore, Holding, Listed, Pack } from "./store.mjs";
|
|
9
|
-
import * as Clock from "effect/Clock";
|
|
10
|
-
import * as Effect from "effect/Effect";
|
|
11
8
|
import { Bucket, BucketLinks, BucketUploads, CallLimits, Key, Listing, Moment, Page, Row } from "@ref0/infra";
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
|
+
import * as Clock from "effect/Clock";
|
|
12
11
|
export interface EffectiveLimits {
|
|
13
12
|
readonly objects: number;
|
|
14
13
|
readonly bytes: number;
|
|
@@ -59,7 +58,7 @@ export interface ObjectSizesInput extends CallInput {
|
|
|
59
58
|
* after `close` fails as `FAILED_PRECONDITION`.
|
|
60
59
|
*/
|
|
61
60
|
export interface ObjectReader {
|
|
62
|
-
readonly read: (input: ObjectReadInput) =>
|
|
61
|
+
readonly read: (input: ObjectReadInput) => Effect.Effect<GitObject | undefined, GitError>;
|
|
63
62
|
/**
|
|
64
63
|
* The size of each of `oids` the repo holds, as `git cat-file -s` gives it, from the object's
|
|
65
64
|
* header: a packed entry's, a delta's result's, or its row's. No object's bytes are read whole,
|
|
@@ -67,7 +66,7 @@ export interface ObjectReader {
|
|
|
67
66
|
* object's type already, as a tree listing does from its entries' modes: it reads no delta's
|
|
68
67
|
* chain, so it costs each entry's own header alone.
|
|
69
68
|
*/
|
|
70
|
-
readonly sizes: (input: ObjectSizesInput) =>
|
|
69
|
+
readonly sizes: (input: ObjectSizesInput) => Effect.Effect<ReadonlyMap<Oid, number>, GitError>;
|
|
71
70
|
/**
|
|
72
71
|
* The type and size of each of `oids` the repo holds, as `git cat-file --batch-check` gives
|
|
73
72
|
* them, from each one's header: a packed entry's, or its row's. A delta's size is its result's,
|
|
@@ -78,21 +77,21 @@ export interface ObjectReader {
|
|
|
78
77
|
* For a caller that doesn't know the types, as a fetch's want check doesn't: a delta's type costs
|
|
79
78
|
* a header for each entry down its chain, its base's among them, which `sizes` never reads.
|
|
80
79
|
*/
|
|
81
|
-
readonly headers: (input: ObjectHeadersInput) =>
|
|
80
|
+
readonly headers: (input: ObjectHeadersInput) => Effect.Effect<ReadonlyMap<Oid, ObjectHeader>, GitError>;
|
|
82
81
|
/**
|
|
83
82
|
* Which of `oids` the repo holds, by its rows and its packs' indexes alone, no object's bytes
|
|
84
83
|
* read: a fetch's haves, a batch at a time, so each lookup a missing ID needs is made once for
|
|
85
84
|
* the batch, not once for each (#709). An ID the repo doesn't hold, or the caller can't see, is
|
|
86
85
|
* absent.
|
|
87
86
|
*/
|
|
88
|
-
readonly held: (input: ObjectHeldInput) =>
|
|
87
|
+
readonly held: (input: ObjectHeldInput) => Effect.Effect<ReadonlySet<Oid>, GitError>;
|
|
89
88
|
/**
|
|
90
89
|
* The IDs the repo holds that start with `input.prefix`, lowest first, at most `input.most`: from
|
|
91
90
|
* the listed packs' `.idx`, the rows, the packs listed since and those leaving, no object's bytes
|
|
92
91
|
* read. An ID the caller can't see is left out, and `more` says the repo holds more than `most`,
|
|
93
92
|
* counted before that, so a view that shows one of many hears there are many.
|
|
94
93
|
*/
|
|
95
|
-
readonly startingWith: (input: ObjectsStartingInput) =>
|
|
94
|
+
readonly startingWith: (input: ObjectsStartingInput) => Effect.Effect<ObjectsStarting, GitError>;
|
|
96
95
|
/**
|
|
97
96
|
* Each of `oids` the repo holds, whole, in one call: a level of a walk's trees, or its commits.
|
|
98
97
|
* Each object answered is charged to `input.bytes` before it's kept, the first one too, so the
|
|
@@ -105,7 +104,7 @@ export interface ObjectReader {
|
|
|
105
104
|
* shrinks the allotment by each object's when it lets the object go, and nothing the reader
|
|
106
105
|
* holds streams from them.
|
|
107
106
|
*/
|
|
108
|
-
readonly objects: (input: ObjectsReadInput) =>
|
|
107
|
+
readonly objects: (input: ObjectsReadInput) => Effect.Effect<ObjectsRead, GitError>;
|
|
109
108
|
/**
|
|
110
109
|
* Bytes the caller holds beside the reader's own, such as a diff's xdiff calls: at most `most`
|
|
111
110
|
* at once, `refusal` past it. Within a storage's memory budget, a grow that doesn't fit at once
|
|
@@ -161,9 +160,9 @@ export interface ObjectHeader {
|
|
|
161
160
|
readonly type: ObjectType;
|
|
162
161
|
readonly size: number;
|
|
163
162
|
}
|
|
164
|
-
export type ReadObject = (input: ObjectReadInput) =>
|
|
163
|
+
export type ReadObject = (input: ObjectReadInput) => Effect.Effect<GitObject | undefined, GitError>;
|
|
165
164
|
/** Reads objects whole, a batch at a time, as `ObjectReader.objects` does. */
|
|
166
|
-
export type ReadObjects = (input: ObjectsReadInput) =>
|
|
165
|
+
export type ReadObjects = (input: ObjectsReadInput) => Effect.Effect<ObjectsRead, GitError>;
|
|
167
166
|
export interface ReceiveInput extends CallInput {
|
|
168
167
|
readonly pack: Bytes;
|
|
169
168
|
readonly objects: number;
|
|
@@ -230,7 +229,7 @@ export interface StepInput extends CallInput {
|
|
|
230
229
|
* row, goes through it, so a try whose claim is lost writes nothing (#1378). The store `open`
|
|
231
230
|
* was given is the server's, fenced by no try.
|
|
232
231
|
*/
|
|
233
|
-
readonly store:
|
|
232
|
+
readonly store: GitStore;
|
|
234
233
|
readonly pack: string;
|
|
235
234
|
readonly objects: number;
|
|
236
235
|
readonly needs?: readonly Oid[];
|
|
@@ -298,8 +297,9 @@ export interface ObjectsChange {
|
|
|
298
297
|
/**
|
|
299
298
|
* The bytes of a server's memory budget one call takes, which it grows as it needs more and
|
|
300
299
|
* releases when it ends. `grow` answers `undefined` once the bytes are allotted, on the spot when
|
|
301
|
-
* they fit, else
|
|
302
|
-
* `too-large` or `diff-limit`, past the most the call may take.
|
|
300
|
+
* they fit, else as an Effect that waits; or the refusal: busy, when no room came within the wait,
|
|
301
|
+
* or `too-large` or `diff-limit`, past the most the call may take. A wait interrupted holds
|
|
302
|
+
* nothing.
|
|
303
303
|
*
|
|
304
304
|
* A push's is what a storage keeps past its receive's answer, for its rules: the readers' floors,
|
|
305
305
|
* its pointers and its open trees, whose walk grows and shrinks it. Core passes it to each reader
|
|
@@ -307,7 +307,7 @@ export interface ObjectsChange {
|
|
|
307
307
|
* it ends.
|
|
308
308
|
*/
|
|
309
309
|
export interface Allotment {
|
|
310
|
-
readonly grow: (bytes: number) => GitError | undefined |
|
|
310
|
+
readonly grow: (bytes: number) => GitError | undefined | Effect.Effect<GitError | undefined>;
|
|
311
311
|
/** Gives back `bytes` of what `grow` allotted, such as when a walk closes a tree. */
|
|
312
312
|
readonly shrink: (bytes: number) => void;
|
|
313
313
|
/** Gives back everything it was allotted. Called again, it does nothing. */
|
|
@@ -478,7 +478,7 @@ export interface MaintainInput extends CallInput {
|
|
|
478
478
|
* delete of that row, goes through it, so a try whose claim is lost writes nothing (#784). The
|
|
479
479
|
* store `open` was given is the server's, fenced by no try.
|
|
480
480
|
*/
|
|
481
|
-
readonly store:
|
|
481
|
+
readonly store: GitStore;
|
|
482
482
|
readonly stats: RepoStats;
|
|
483
483
|
readonly at: Moment;
|
|
484
484
|
/** The default branch's tip, when the repo has the branch: what a ready shallow pack is for. */
|
|
@@ -646,7 +646,7 @@ export interface ObjectsOpenInput<NeedsBucket extends boolean = boolean> {
|
|
|
646
646
|
* request and budget at the store's door, and a server's refuses once the server is closed and
|
|
647
647
|
* dies closed as it closes.
|
|
648
648
|
*/
|
|
649
|
-
readonly store:
|
|
649
|
+
readonly store: GitStore;
|
|
650
650
|
readonly bucket: NeedsBucket extends true ? Bucket$1 : Bucket$1 | undefined;
|
|
651
651
|
/** The host's Effect `Clock` service (`effect/Clock`). */
|
|
652
652
|
readonly clock: Clock.Clock;
|
|
@@ -971,6 +971,9 @@ export interface IndexTryInput extends CallInput {
|
|
|
971
971
|
* the row again and asks once more with `lastCheck`, so a move that changed none of them costs a
|
|
972
972
|
* second check, not an update. An implementation never has to answer it: one that updates instead
|
|
973
973
|
* is answered as today. No answer to a `lastCheck` try is `moved`.
|
|
974
|
+
*
|
|
975
|
+
* A `more` whose data is the data the try was given made no progress, as a build a staged batch
|
|
976
|
+
* held back: the job runs it on its next try, not again in this one.
|
|
974
977
|
*/
|
|
975
978
|
export type IndexTry = {
|
|
976
979
|
readonly kind: 'more';
|
|
@@ -3,8 +3,8 @@ import { CandidateId, EntryFields, EntryId, HoldId } from "./queue.mjs";
|
|
|
3
3
|
import { RefEdit, RefSource } from "./refs.mjs";
|
|
4
4
|
import { ActorId } from "./actors.mjs";
|
|
5
5
|
import { TokenCoverage, TokenScope } from "./tokens.mjs";
|
|
6
|
-
import * as Schema from "effect/Schema";
|
|
7
6
|
import { JobRef } from "@ref0/infra";
|
|
7
|
+
import * as Schema from "effect/Schema";
|
|
8
8
|
// src/contracts/operations.ts
|
|
9
9
|
/** What `authorize` is asked about. */
|
|
10
10
|
const RepoOperation = /* @__PURE__ */ Schema.Struct({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ActorInput, Caller, WriteInput } from "./actors.mjs";
|
|
2
|
-
import { ByCalls,
|
|
2
|
+
import { ByCalls, Needing } from "./services.mjs";
|
|
3
3
|
import { Duration } from "./time.mjs";
|
|
4
4
|
import { RefName, RepoName } from "./ids.mjs";
|
|
5
5
|
import { RepoInput } from "./repos.mjs";
|
|
6
|
-
import { DecisionAnswer, GitError
|
|
7
|
-
import * as Effect from "effect/Effect";
|
|
8
|
-
import * as Schema from "effect/Schema";
|
|
6
|
+
import { DecisionAnswer, GitError } from "./result.mjs";
|
|
9
7
|
import { Listing, Page } from "@ref0/infra";
|
|
8
|
+
import * as Schema from "effect/Schema";
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
10
|
import * as Context from "effect/Context";
|
|
11
11
|
/**
|
|
12
12
|
* The merge queue: entries ask for a source's head on a target, and candidates, the commits a
|
|
@@ -491,23 +491,199 @@ export type QueueOf = (input: {
|
|
|
491
491
|
}) => MergeQueueOptions | undefined;
|
|
492
492
|
/** What `MergeQueue.layer` takes: one queue every repo has, or one per repo. */
|
|
493
493
|
export type MergeQueueLayerOptions = MergeQueueOptions | QueueOf;
|
|
494
|
-
declare const MergeQueue_base: Context.ServiceClass<MergeQueue, "@ref0/git/MergeQueue",
|
|
495
|
-
readonly add: (repo: string, input: QueueAddInput, by?: Caller<unknown> | undefined) =>
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
494
|
+
declare const MergeQueue_base: Context.ServiceClass<MergeQueue, "@ref0/git/MergeQueue", Needing<{
|
|
495
|
+
readonly add: (repo: string, input: QueueAddInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
496
|
+
readonly revision: number;
|
|
497
|
+
readonly repeat: boolean;
|
|
498
|
+
readonly entry: {
|
|
499
|
+
readonly target: string;
|
|
500
|
+
readonly source: string;
|
|
501
|
+
readonly head: string;
|
|
502
|
+
readonly key: string;
|
|
503
|
+
readonly priority?: number;
|
|
504
|
+
readonly meta?: {
|
|
505
|
+
readonly [x: string]: Schema.Json;
|
|
506
|
+
};
|
|
507
|
+
readonly id: string;
|
|
508
|
+
readonly repo: string;
|
|
509
|
+
readonly actor: {
|
|
510
|
+
readonly id: string;
|
|
511
|
+
};
|
|
512
|
+
readonly subject?: {
|
|
513
|
+
readonly id: string;
|
|
514
|
+
};
|
|
515
|
+
readonly state: "checking" | "failed" | "held" | "merged" | "removed" | "waiting";
|
|
516
|
+
readonly lanes: readonly string[];
|
|
517
|
+
readonly report?: {
|
|
518
|
+
readonly summary?: string;
|
|
519
|
+
readonly url?: string;
|
|
520
|
+
readonly meta?: {
|
|
521
|
+
readonly [x: string]: Schema.Json;
|
|
522
|
+
};
|
|
523
|
+
readonly verdict: "cancel" | "fail" | "pass";
|
|
524
|
+
};
|
|
525
|
+
readonly pinned?: true;
|
|
526
|
+
};
|
|
527
|
+
readonly ahead: number;
|
|
528
|
+
readonly replaced?: string;
|
|
529
|
+
}, GitError, never>;
|
|
530
|
+
readonly remove: (entry: string, input: WriteInput<unknown>, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
531
|
+
readonly revision: number;
|
|
532
|
+
readonly repeat: boolean;
|
|
533
|
+
readonly entry: string;
|
|
534
|
+
}, GitError, never>;
|
|
535
|
+
readonly hold: (...args: [entry: string, input: EntryHoldInput, by?: Caller<unknown>] | [repo: string, input: TargetHoldInput, by?: Caller<unknown>]) => Effect.Effect<{
|
|
536
|
+
readonly revision: number;
|
|
537
|
+
readonly repeat: boolean;
|
|
538
|
+
readonly hold: {
|
|
539
|
+
readonly id: string;
|
|
540
|
+
readonly repo: string;
|
|
541
|
+
readonly reason: string;
|
|
542
|
+
readonly entry: string;
|
|
543
|
+
} | {
|
|
544
|
+
readonly id: string;
|
|
545
|
+
readonly repo: string;
|
|
546
|
+
readonly reason: string;
|
|
547
|
+
readonly target: string;
|
|
548
|
+
};
|
|
549
|
+
}, GitError, never>;
|
|
550
|
+
readonly release: (hold: string, input: WriteInput<unknown>, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
551
|
+
readonly revision: number;
|
|
552
|
+
readonly repeat: boolean;
|
|
553
|
+
readonly hold: string;
|
|
554
|
+
readonly entry?: string;
|
|
555
|
+
}, GitError, never>;
|
|
556
|
+
readonly report: (candidate: string, input: CandidateReportInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
557
|
+
readonly repeat: boolean;
|
|
558
|
+
}, GitError, never>;
|
|
559
|
+
readonly retry: (candidate: string, input: WriteInput<unknown>, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
560
|
+
readonly revision: number;
|
|
561
|
+
readonly repeat: boolean;
|
|
562
|
+
readonly candidate: string;
|
|
563
|
+
}, GitError, never>;
|
|
564
|
+
readonly restart: (repo: string, input: QueueTargetInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
565
|
+
readonly revision: number;
|
|
566
|
+
readonly repeat: boolean;
|
|
567
|
+
readonly target: string;
|
|
568
|
+
readonly head: string;
|
|
569
|
+
}, GitError, never>;
|
|
570
|
+
readonly get: (entry: string, input: ActorInput<unknown>, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
571
|
+
readonly target: string;
|
|
572
|
+
readonly source: string;
|
|
573
|
+
readonly head: string;
|
|
574
|
+
readonly key: string;
|
|
575
|
+
readonly priority?: number;
|
|
576
|
+
readonly meta?: {
|
|
577
|
+
readonly [x: string]: Schema.Json;
|
|
578
|
+
};
|
|
579
|
+
readonly id: string;
|
|
580
|
+
readonly repo: string;
|
|
581
|
+
readonly actor: {
|
|
582
|
+
readonly id: string;
|
|
583
|
+
};
|
|
584
|
+
readonly subject?: {
|
|
585
|
+
readonly id: string;
|
|
586
|
+
};
|
|
587
|
+
readonly state: "checking" | "failed" | "held" | "merged" | "removed" | "waiting";
|
|
588
|
+
readonly lanes: readonly string[];
|
|
589
|
+
readonly report?: {
|
|
590
|
+
readonly summary?: string;
|
|
591
|
+
readonly url?: string;
|
|
592
|
+
readonly meta?: {
|
|
593
|
+
readonly [x: string]: Schema.Json;
|
|
594
|
+
};
|
|
595
|
+
readonly verdict: "cancel" | "fail" | "pass";
|
|
596
|
+
};
|
|
597
|
+
readonly pinned?: true;
|
|
598
|
+
}, GitError, never>;
|
|
599
|
+
readonly list: (repo: string, input: QueueListInput, by?: Caller<unknown> | undefined) => Effect.Effect<Listing<{
|
|
600
|
+
readonly target: string;
|
|
601
|
+
readonly source: string;
|
|
602
|
+
readonly head: string;
|
|
603
|
+
readonly key: string;
|
|
604
|
+
readonly priority?: number;
|
|
605
|
+
readonly meta?: {
|
|
606
|
+
readonly [x: string]: Schema.Json;
|
|
607
|
+
};
|
|
608
|
+
readonly id: string;
|
|
609
|
+
readonly repo: string;
|
|
610
|
+
readonly actor: {
|
|
611
|
+
readonly id: string;
|
|
612
|
+
};
|
|
613
|
+
readonly subject?: {
|
|
614
|
+
readonly id: string;
|
|
615
|
+
};
|
|
616
|
+
readonly state: "checking" | "failed" | "held" | "merged" | "removed" | "waiting";
|
|
617
|
+
readonly lanes: readonly string[];
|
|
618
|
+
readonly report?: {
|
|
619
|
+
readonly summary?: string;
|
|
620
|
+
readonly url?: string;
|
|
621
|
+
readonly meta?: {
|
|
622
|
+
readonly [x: string]: Schema.Json;
|
|
623
|
+
};
|
|
624
|
+
readonly verdict: "cancel" | "fail" | "pass";
|
|
625
|
+
};
|
|
626
|
+
readonly pinned?: true;
|
|
627
|
+
}>, GitError, never>;
|
|
628
|
+
readonly holds: (...args: [entry: string, input: EntryHoldsInput, by?: Caller<unknown>] | [repo: string, input: QueueListInput, by?: Caller<unknown>]) => Effect.Effect<Listing<{
|
|
629
|
+
readonly id: string;
|
|
630
|
+
readonly repo: string;
|
|
631
|
+
readonly reason: string;
|
|
632
|
+
readonly entry: string;
|
|
633
|
+
} | {
|
|
634
|
+
readonly id: string;
|
|
635
|
+
readonly repo: string;
|
|
636
|
+
readonly reason: string;
|
|
637
|
+
readonly target: string;
|
|
638
|
+
}>, GitError, never>;
|
|
639
|
+
readonly candidates: (repo: string, input: QueueListInput, by?: Caller<unknown> | undefined) => Effect.Effect<Listing<{
|
|
640
|
+
readonly id: string;
|
|
641
|
+
readonly repo: string;
|
|
642
|
+
readonly target: string;
|
|
643
|
+
readonly base: string | null;
|
|
644
|
+
readonly entries: readonly string[];
|
|
645
|
+
readonly state: "building" | "checking" | "closed";
|
|
646
|
+
readonly ref?: string;
|
|
647
|
+
readonly commit?: string;
|
|
648
|
+
readonly report?: {
|
|
649
|
+
readonly summary?: string;
|
|
650
|
+
readonly url?: string;
|
|
651
|
+
readonly meta?: {
|
|
652
|
+
readonly [x: string]: Schema.Json;
|
|
653
|
+
};
|
|
654
|
+
readonly verdict: "cancel" | "fail" | "pass";
|
|
655
|
+
};
|
|
656
|
+
readonly reason?: "cancelled" | "failed" | "merged" | "passed" | "restarted" | "superseded" | "timeout";
|
|
657
|
+
}>, GitError, never>;
|
|
658
|
+
readonly candidate: (candidate: string, input: ActorInput<unknown>, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
659
|
+
readonly id: string;
|
|
660
|
+
readonly repo: string;
|
|
661
|
+
readonly target: string;
|
|
662
|
+
readonly base: string | null;
|
|
663
|
+
readonly entries: readonly string[];
|
|
664
|
+
readonly state: "building" | "checking" | "closed";
|
|
665
|
+
readonly ref?: string;
|
|
666
|
+
readonly commit?: string;
|
|
667
|
+
readonly report?: {
|
|
668
|
+
readonly summary?: string;
|
|
669
|
+
readonly url?: string;
|
|
670
|
+
readonly meta?: {
|
|
671
|
+
readonly [x: string]: Schema.Json;
|
|
672
|
+
};
|
|
673
|
+
readonly verdict: "cancel" | "fail" | "pass";
|
|
674
|
+
};
|
|
675
|
+
readonly reason?: "cancelled" | "failed" | "merged" | "passed" | "restarted" | "superseded" | "timeout";
|
|
676
|
+
}, GitError, never>;
|
|
677
|
+
}, never> & {
|
|
678
|
+
/**
|
|
679
|
+
* The `keys` every repo's queue has, as `MergeQueue.layer`'s options name them, read once
|
|
680
|
+
* the queue builds: `undefined` for a queue per repo, whose options each name their own.
|
|
681
|
+
*/
|
|
682
|
+
readonly keys: QueueKeys | undefined;
|
|
683
|
+
}>;
|
|
508
684
|
/**
|
|
509
|
-
* `git.queue`'s calls as Effects, each deciding for `by
|
|
510
|
-
* the queue's jobs, events and `git push -o queue` with them.
|
|
685
|
+
* `git.queue`'s calls as Effects, each deciding for `by`, and the queue's `keys`: what
|
|
686
|
+
* `MergeQueue.layer` provides, and the queue's jobs, events and `git push -o queue` with them.
|
|
511
687
|
*/
|
|
512
688
|
export declare class MergeQueue extends /* @__PURE__ */ MergeQueue_base {}
|
|
513
689
|
/**
|
|
@@ -641,18 +817,6 @@ export declare const Restarted: Schema.Struct<{
|
|
|
641
817
|
readonly head: Schema.String;
|
|
642
818
|
}>;
|
|
643
819
|
export type Restarted = typeof Restarted.Type;
|
|
644
|
-
export type AddResult = Result<Added>;
|
|
645
|
-
export type RemoveResult = Result<Removed>;
|
|
646
|
-
export type HoldResult = Result<Held>;
|
|
647
|
-
export type ReleaseResult = Result<Released>;
|
|
648
|
-
export type ReportResult = Result<Reported>;
|
|
649
|
-
export type RetryResult = Result<Retried>;
|
|
650
|
-
export type RestartResult = Result<Restarted>;
|
|
651
|
-
export type EntryResult = Result<Entry>;
|
|
652
|
-
export type QueueListResult = Result<Listing<Entry>>;
|
|
653
|
-
export type HoldsResult = Result<Listing<Hold>>;
|
|
654
|
-
export type CandidateResult = Result<Candidate>;
|
|
655
|
-
export type CandidatesResult = Result<Listing<Candidate>>;
|
|
656
820
|
/**
|
|
657
821
|
* `git.queue`. A repo whose `QueueOf` answers `undefined` has none: each call is `NOT_FOUND`,
|
|
658
822
|
* reason `no-queue`, its message naming the repo and any target, as "acme/app's main has no merge
|
|
@@ -669,22 +833,22 @@ export type CandidatesResult = Result<Listing<Candidate>>;
|
|
|
669
833
|
* `ALREADY_EXISTS`, naming nothing of that entry.
|
|
670
834
|
*/
|
|
671
835
|
export interface MergeQueueCalls {
|
|
672
|
-
readonly add: (repo: RepoName, input: QueueAddInput) =>
|
|
673
|
-
readonly remove: (entry: EntryId, input: WriteInput) =>
|
|
836
|
+
readonly add: (repo: RepoName, input: QueueAddInput) => Effect.Effect<Added, GitError>;
|
|
837
|
+
readonly remove: (entry: EntryId, input: WriteInput) => Effect.Effect<Removed, GitError>;
|
|
674
838
|
/** A target's hold names its `target`; an entry's names none. */
|
|
675
|
-
readonly hold: (...args: [repo: RepoName, input: TargetHoldInput] | [entry: EntryId, input: EntryHoldInput]) =>
|
|
839
|
+
readonly hold: (...args: [repo: RepoName, input: TargetHoldInput] | [entry: EntryId, input: EntryHoldInput]) => Effect.Effect<Held, GitError>;
|
|
676
840
|
/**
|
|
677
841
|
* The last hold on an entry released sends it to the back. A `work-failed` hold's release retries
|
|
678
842
|
* the job it names: while that job runs, its failure perhaps not yet settled, or once it failed
|
|
679
843
|
* again since the release read it, the release is `UNAVAILABLE` and the hold stays, so release it
|
|
680
844
|
* again. 14 days after its release, `queue.trim` deletes a hold, and it's `NOT_FOUND`.
|
|
681
845
|
*/
|
|
682
|
-
readonly release: (hold: HoldId, input: WriteInput) =>
|
|
846
|
+
readonly release: (hold: HoldId, input: WriteInput) => Effect.Effect<Released, GitError>;
|
|
683
847
|
/**
|
|
684
848
|
* A `fail` with `blame` fails those entries, and the rest wait again. One without, of more than
|
|
685
849
|
* one entry, asks `bisect`; of one, fails it. A `retry` brings back the entries it failed.
|
|
686
850
|
*/
|
|
687
|
-
readonly report: (candidate: CandidateId, input: CandidateReportInput) =>
|
|
851
|
+
readonly report: (candidate: CandidateId, input: CandidateReportInput) => Effect.Effect<Reported, GitError>;
|
|
688
852
|
/**
|
|
689
853
|
* Closes the candidate, puts its entries back at their places and wakes advance, which opens
|
|
690
854
|
* them in order under a new ID, `queue.candidate.opened`. After a `fail`, each entry its report
|
|
@@ -694,14 +858,14 @@ export interface MergeQueueCalls {
|
|
|
694
858
|
* and one on a target deleted since is `FAILED_PRECONDITION`, as `restart` is. One `queue.trim`
|
|
695
859
|
* deleted, 14 days after it closed and its entries went, is `NOT_FOUND`.
|
|
696
860
|
*/
|
|
697
|
-
readonly retry: (candidate: CandidateId, input: WriteInput) =>
|
|
861
|
+
readonly retry: (candidate: CandidateId, input: WriteInput) => Effect.Effect<Retried, GitError>;
|
|
698
862
|
/** Closes the target's open candidates and builds them again under new IDs. */
|
|
699
|
-
readonly restart: (repo: RepoName, input: QueueTargetInput) =>
|
|
863
|
+
readonly restart: (repo: RepoName, input: QueueTargetInput) => Effect.Effect<Restarted, GitError>;
|
|
700
864
|
/**
|
|
701
865
|
* One entry, open or ended. One that merged, failed or was removed 14 days ago is `NOT_FOUND`:
|
|
702
866
|
* `queue.trim` deleted it, and each other write by its ID is `NOT_FOUND` too.
|
|
703
867
|
*/
|
|
704
|
-
readonly get: (entry: EntryId, input: ActorInput) =>
|
|
868
|
+
readonly get: (entry: EntryId, input: ActorInput) => Effect.Effect<Entry, GitError>;
|
|
705
869
|
/**
|
|
706
870
|
* A target's entries in the order they're tried in. A page's `next` names where it ended in that
|
|
707
871
|
* order, and the page after it goes on from there, though that entry left (Q435): an entry that
|
|
@@ -711,27 +875,27 @@ export interface MergeQueueCalls {
|
|
|
711
875
|
* names its list: one from another target, entry or repo, or with a number no place has, is
|
|
712
876
|
* `INVALID_ARGUMENT`.
|
|
713
877
|
*/
|
|
714
|
-
readonly list: (repo: RepoName, input: QueueListInput) =>
|
|
878
|
+
readonly list: (repo: RepoName, input: QueueListInput) => Effect.Effect<Listing<Entry>, GitError>;
|
|
715
879
|
/**
|
|
716
880
|
* A target's holds, or one entry's: an ID an entry could have names the entry. They come in the
|
|
717
881
|
* order they were made, and `next` names where a page ended, as `list`'s does: each hold open
|
|
718
882
|
* throughout comes exactly once, though the one `next` names was released.
|
|
719
883
|
*/
|
|
720
|
-
readonly holds: (...args: [repo: RepoName, input: QueueListInput] | [entry: EntryId, input: EntryHoldsInput]) =>
|
|
884
|
+
readonly holds: (...args: [repo: RepoName, input: QueueListInput] | [entry: EntryId, input: EntryHoldsInput]) => Effect.Effect<Listing<Hold>, GitError>;
|
|
721
885
|
/**
|
|
722
886
|
* A target's open candidates, a bisect's groups among them, in the order advance opened them.
|
|
723
887
|
* `next` names where a page ended, as `holds`' does: each candidate open throughout comes
|
|
724
888
|
* exactly once, though the one `next` names closed. Under `access`, a caller who doesn't see
|
|
725
889
|
* every ref gets none, since a candidate holds what its entries hold.
|
|
726
890
|
*/
|
|
727
|
-
readonly candidates: (repo: RepoName, input: QueueListInput) =>
|
|
891
|
+
readonly candidates: (repo: RepoName, input: QueueListInput) => Effect.Effect<Listing<Candidate>, GitError>;
|
|
728
892
|
/**
|
|
729
893
|
* One candidate, open or closed. A closed one keeps its base, entries, commit, report and
|
|
730
894
|
* `reason`, and has no `ref`. Under `access`, one is `NOT_FOUND` to a caller who doesn't see
|
|
731
895
|
* every ref, as an ID that names nothing is. 14 days after it closed, once none of its entries
|
|
732
896
|
* is left, `queue.trim` deletes it, with its report, and it's `NOT_FOUND`.
|
|
733
897
|
*/
|
|
734
|
-
readonly candidate: (candidate: CandidateId, input: ActorInput) =>
|
|
898
|
+
readonly candidate: (candidate: CandidateId, input: ActorInput) => Effect.Effect<Candidate, GitError>;
|
|
735
899
|
}
|
|
736
900
|
type QueueService = ByCalls<MergeQueueCalls>;
|
|
737
901
|
export declare const add: (...args: Parameters<QueueService['add']>) => Effect.Effect<{
|
package/dist/contracts/queue.mjs
CHANGED
|
@@ -5,11 +5,11 @@ import { Oid, RefName, RepoName } from "./ids.mjs";
|
|
|
5
5
|
import { EffectValue } from "./opaque.mjs";
|
|
6
6
|
import "./repos.mjs";
|
|
7
7
|
import { Verdict, decisionAnswer } from "./result.mjs";
|
|
8
|
-
import * as Effect from "effect/Effect";
|
|
9
|
-
import * as Schema from "effect/Schema";
|
|
10
8
|
import { jsonBytes } from "@ref0/infra";
|
|
11
|
-
import * as
|
|
9
|
+
import * as Schema from "effect/Schema";
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
12
11
|
import * as Context from "effect/Context";
|
|
12
|
+
import * as SchemaTransformation from "effect/SchemaTransformation";
|
|
13
13
|
// src/contracts/queue.ts
|
|
14
14
|
/**
|
|
15
15
|
* The merge queue: entries ask for a source's head on a target, and candidates, the commits a
|
|
@@ -202,8 +202,8 @@ const EntryGroups = /* @__PURE__ */ Schema.Array(EntryGroup).check(Schema.isMinL
|
|
|
202
202
|
/** What a numeric schedule function (`concurrency` or `batch.maxSize`) answers: a finite number. */
|
|
203
203
|
const ScheduleAnswer = Schema.Finite;
|
|
204
204
|
/**
|
|
205
|
-
* `git.queue`'s calls as Effects, each deciding for `by
|
|
206
|
-
* the queue's jobs, events and `git push -o queue` with them.
|
|
205
|
+
* `git.queue`'s calls as Effects, each deciding for `by`, and the queue's `keys`: what
|
|
206
|
+
* `MergeQueue.layer` provides, and the queue's jobs, events and `git push -o queue` with them.
|
|
207
207
|
*/
|
|
208
208
|
var MergeQueue = class extends (/* @__PURE__ */ Context.Service()("@ref0/git/MergeQueue")) {};
|
|
209
209
|
/** `revision` is the event's `seq`: every event at or under it came before. */
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ByCalls,
|
|
1
|
+
import { ByCalls, Needing } from "./services.mjs";
|
|
2
2
|
import { ActorInput, Caller, WriteInput } from "./actors.mjs";
|
|
3
3
|
import { RefOwner } from "./git.mjs";
|
|
4
4
|
import { RefName, RepoName } from "./ids.mjs";
|
|
5
5
|
import { RepoInput } from "./repos.mjs";
|
|
6
6
|
import { GitError } from "./result.mjs";
|
|
7
|
-
import * as Effect from "effect/Effect";
|
|
8
|
-
import * as Schema from "effect/Schema";
|
|
9
7
|
import { Listing, Page } from "@ref0/infra";
|
|
8
|
+
import * as Schema from "effect/Schema";
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
10
|
import * as Context from "effect/Context";
|
|
11
11
|
declare namespace refs_d_exports {
|
|
12
12
|
export { Ref, RefApplied, RefCalls, RefCount, RefCountFields, RefCountInput, RefEdit, RefGetInput, RefInput, RefList, RefListInput, RefOutcome, RefProtection, RefRejected, RefSource, RefUpdate, RefUpdateKind, Refs, RefsCalls, RefsProtections, RefsProtectionsInput, RefsSees, RefsSeesInput, RefsUpdate, RefsUpdateInput, RefsUpdated, count, get, list, maxProtectionRefs, maxSeenRefs, protection, protections, sees, update };
|
|
@@ -225,7 +225,7 @@ export declare const RefOutcome: Schema.Union<readonly [Schema.Struct<{
|
|
|
225
225
|
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
226
226
|
readonly hint: Schema.optionalKey<Schema.decodeTo<Schema.String, Schema.String, never, never>>;
|
|
227
227
|
readonly context: Schema.optionalKey<Schema.StructWithRest<Schema.Struct<{
|
|
228
|
-
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
228
|
+
reason: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["too-large", "rate-limited", "walk-limit", "diff-limit", "object-too-large", "repo-too-large", "delta-too-large", "response-too-large", "too-many-pointers", "fetch-plan-too-large", "too-many-store-calls", "call-budget", "events-undelivered", "events-waiting", "name-churn", "queue-full", "queue-targets-full", "too-many-gitmodules-and-gitattributes", "prune-walk-too-large", "job-step-calls", "job-step-yielded", "fork-chunks-past-budget", "delta-chain-too-deep"]>, Schema.decodeTo<Schema.String, Schema.String, never, never>]>>;
|
|
229
229
|
indexBytes: Schema.optionalKey<Schema.Number>;
|
|
230
230
|
pushBytes: Schema.optionalKey<Schema.Number>;
|
|
231
231
|
most: Schema.optionalKey<Schema.Number>;
|
|
@@ -297,7 +297,7 @@ export interface RefCalls {
|
|
|
297
297
|
}
|
|
298
298
|
/** `RefCalls` as Effects, each deciding for `by`, as `ByCalls` says. */
|
|
299
299
|
export type RefsCalls<R = never> = ByCalls<RefCalls, R>;
|
|
300
|
-
declare const Refs_base: Context.ServiceClass<Refs, "@ref0/git/Refs",
|
|
300
|
+
declare const Refs_base: Context.ServiceClass<Refs, "@ref0/git/Refs", Needing<{
|
|
301
301
|
readonly get: (repo: string, input: RefGetInput, by?: Caller<unknown> | undefined) => Effect.Effect<{
|
|
302
302
|
readonly name: string;
|
|
303
303
|
readonly oid: string;
|
package/dist/contracts/refs.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { Oid, RefName } from "./ids.mjs";
|
|
3
3
|
import { GitErrorBody } from "./result.mjs";
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
4
|
import * as Schema from "effect/Schema";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
6
|
import * as Context from "effect/Context";
|
|
7
7
|
// src/contracts/refs.ts
|
|
8
8
|
var refs_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ActorInput } from "./actors.mjs";
|
|
2
|
-
import { GitError
|
|
3
|
-
import * as Effect from "effect/Effect";
|
|
2
|
+
import { GitError } from "./result.mjs";
|
|
4
3
|
import * as Schema from "effect/Schema";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
5
|
/** What a client sends as Basic: Git's own credential, such as `x-access-token` and a token. */
|
|
6
6
|
export declare const BasicCredential: Schema.Struct<{
|
|
7
7
|
readonly username: Schema.String;
|
|
@@ -69,11 +69,8 @@ export interface RemoteOptions {
|
|
|
69
69
|
export type WithoutActor<Input> = Input extends ActorInput ? Omit<Input, 'actor' | 'internalId'> : Input;
|
|
70
70
|
/** A call's input without `signal`: interrupting the call's fiber stops it. */
|
|
71
71
|
export type WithoutSignal<Input> = Input extends object ? Omit<Input, 'signal'> : Input;
|
|
72
|
-
/** A call's answer as a remote gives it: an Effect that fails with the call's `GitError`. */
|
|
73
|
-
type RemoteAnswer<Answer> = Answer extends Promise<Result<infer A>> ? Effect.Effect<A, GitError> : Answer;
|
|
74
72
|
/**
|
|
75
73
|
* A group of server calls as a remote makes them: each an Effect, its input without `actor` or
|
|
76
74
|
* `signal`.
|
|
77
75
|
*/
|
|
78
|
-
export type RemoteCalls<Calls> = { readonly [Key in keyof Calls]-?: NonNullable<Calls[Key]> extends ((...args: infer Args) => infer Answer) ? (...args: { [Index in keyof Args]: WithoutSignal<WithoutActor<Args[Index]>>; }) =>
|
|
79
|
-
export {};
|
|
76
|
+
export type RemoteCalls<Calls> = { readonly [Key in keyof Calls]-?: NonNullable<Calls[Key]> extends ((...args: infer Args) => infer Answer) ? (...args: { [Index in keyof Args]: WithoutSignal<WithoutActor<Args[Index]>>; }) => Answer : RemoteCalls<NonNullable<Calls[Key]>>; };
|
|
@@ -2,9 +2,9 @@ import { ActorInput, Caller, WriteInput } from "./actors.mjs";
|
|
|
2
2
|
import { InternalRepoId, RefName, RepoName } from "./ids.mjs";
|
|
3
3
|
import { GitError } from "./result.mjs";
|
|
4
4
|
import { ImportStatus } from "./sync.mjs";
|
|
5
|
-
import * as Effect from "effect/Effect";
|
|
6
|
-
import * as Schema from "effect/Schema";
|
|
7
5
|
import { Listing, Page } from "@ref0/infra";
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
8
|
import * as Context from "effect/Context";
|
|
9
9
|
declare namespace repos_d_exports {
|
|
10
10
|
export { JobCounts, Moment$1 as Moment, PinnedRepo, RenamedRepo, RepoCatalogueEntry, RepoCreate, RepoCreateInput, RepoDeleted, RepoGetInput, RepoIndexHold, RepoInfo, RepoInfoStats, RepoInput, RepoListInput, RepoListOrder, RepoRecord, RepoRenameInput, RepoStats, RepoUpdateInput, RepoWork, Repos, create, remove as delete, get, importState, list, rename, update };
|
|
@@ -412,7 +412,7 @@ export declare const create: (input: RepoCreateInput, by?: Caller) => Effect.Eff
|
|
|
412
412
|
};
|
|
413
413
|
};
|
|
414
414
|
}, GitError, Repos>;
|
|
415
|
-
export declare const get: (repo: RepoName, input:
|
|
415
|
+
export declare const get: (repo: RepoName, input: RepoGetInput, by?: Caller) => Effect.Effect<{
|
|
416
416
|
readonly name: string;
|
|
417
417
|
readonly defaultBranch?: string;
|
|
418
418
|
readonly public: boolean;
|
package/dist/contracts/repos.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { InternalRepoId, RepoName } from "./ids.mjs";
|
|
3
|
-
import * as Effect from "effect/Effect";
|
|
4
3
|
import * as Schema from "effect/Schema";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
5
|
import * as Context from "effect/Context";
|
|
6
6
|
// src/contracts/repos.ts
|
|
7
7
|
var repos_exports = /* @__PURE__ */ __exportAll({
|