| author | |
| committer | |
| log | 3b6ce931cc225b4b743daaa063e0bc9875555582 |
| tree | 19c728a40a85c84e40314650bf99d29ddfd87c72 |
| parent | 060c576f8922703725f0dbdd01443ed88ecc9baa |
| signature | Signed by PGP key B5690EEEBB952194 |
22 files changed, 21 insertions(+), 28 deletions(-)
apps/server/src/pullRequest/AzureDevOpsPullRequestCli.ts+1| ... | ... | @@ -261,6 +261,7 @@ function isReviewerName(value: string): boolean { |
| 261 | 261 | return name.length > 0 && !name.startsWith("-"); |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 264 | 265 | export const make = Effect.gen(function* () { |
| 265 | 266 | const azure = yield* AzureDevOpsCli.AzureDevOpsCli; |
| 266 | 267 |
apps/server/src/pullRequest/BitbucketPullRequestApi.ts+1| ... | ... | @@ -378,6 +378,7 @@ function bitbucketReviewPosition( |
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 381 | 382 | export const make = Effect.gen(function* () { |
| 382 | 383 | const bitbucket = yield* BitbucketApi.BitbucketApi; |
| 383 | 384 |
apps/server/src/pullRequest/GitHubPullRequestCli.ts+2-1| ... | ... | @@ -714,7 +714,7 @@ export class GitHubPullRequestCli extends Context.Service< |
| 714 | 714 | * The host is not read off the identity: it travels alongside it, because the identity a |
| 715 | 715 | * project records is the path below its host and never names the host itself. |
| 716 | 716 | */ |
| 717 | export function parseRepositorySelector(value: string): { | |
| 717 | function parseRepositorySelector(value: string): { | |
| 718 | 718 | readonly owner: string; |
| 719 | 719 | readonly name: string; |
| 720 | 720 | } { |
| ... | ... | @@ -980,6 +980,7 @@ function actionArgs( |
| 980 | 980 | } |
| 981 | 981 | } |
| 982 | 982 | |
| 983 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 983 | 984 | export const make = Effect.gen(function* () { |
| 984 | 985 | const github = yield* GitHubCli.GitHubCli; |
| 985 | 986 | const graphQlBudget = yield* GitHubGraphQlBudget.GitHubGraphQlBudget; |
apps/server/src/pullRequest/GitLabPullRequestCli.ts+1| ... | ... | @@ -511,6 +511,7 @@ function actionArgs( |
| 511 | 511 | } |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 514 | 515 | export const make = Effect.gen(function* () { |
| 515 | 516 | const gitlab = yield* GitLabCli.GitLabCli; |
| 516 | 517 |
apps/server/src/pullRequest/PullRequestProviderRegistry.ts+2| ... | ... | @@ -41,6 +41,8 @@ export function fromProviders( |
| 41 | 41 | /** |
| 42 | 42 | * The hosts this build can read change requests from. A host with no entry here still shows up |
| 43 | 43 | * in the provider list as unimplemented, so its projects are explained rather than missing. |
| 44 | * | |
| 45 | * @public Service construction is part of the canonical Effect module API. | |
| 44 | 46 | */ |
| 45 | 47 | export const make = Effect.map( |
| 46 | 48 | Effect.all([ |
apps/server/src/sourceControl/AzureDevOpsCli.ts+1-2| ... | ... | @@ -203,8 +203,6 @@ export const AzureDevOpsCliError = Schema.Union([ |
| 203 | 203 | ]); |
| 204 | 204 | export type AzureDevOpsCliError = typeof AzureDevOpsCliError.Type; |
| 205 | 205 | |
| 206 | export const isAzureDevOpsCliError = Schema.is(AzureDevOpsCliError); | |
| 207 | ||
| 208 | 206 | export interface AzureDevOpsRepositoryCloneUrls { |
| 209 | 207 | readonly nameWithOwner: string; |
| 210 | 208 | readonly url: string; |
| ... | ... | @@ -352,6 +350,7 @@ function decodeAzureDevOpsJson<S extends Schema.Top>( |
| 352 | 350 | ); |
| 353 | 351 | } |
| 354 | 352 | |
| 353 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 355 | 354 | export const make = Effect.gen(function* () { |
| 356 | 355 | const process = yield* VcsProcess.VcsProcess; |
| 357 | 356 |
apps/server/src/sourceControl/AzureDevOpsSourceControlProvider.ts-3| ... | ... | @@ -1,5 +1,4 @@ |
| 1 | 1 | import * as Effect from "effect/Effect"; |
| 2 | import * as Layer from "effect/Layer"; | |
| 3 | 2 | import { SourceControlProviderError, type ChangeRequest } from "@t3tools/contracts"; |
| 4 | 3 | |
| 5 | 4 | import * as AzureDevOpsCli from "./AzureDevOpsCli.ts"; |
| ... | ... | @@ -235,5 +234,3 @@ export const make = Effect.gen(function* () { |
| 235 | 234 | ), |
| 236 | 235 | }); |
| 237 | 236 | }); |
| 238 | ||
| 239 | export const layer = Layer.effect(SourceControlProvider.SourceControlProvider, make); |
apps/server/src/sourceControl/BitbucketApi.ts+2-1| ... | ... | @@ -262,7 +262,7 @@ export const BitbucketApiError = Schema.Union([ |
| 262 | 262 | BitbucketCheckoutError, |
| 263 | 263 | ]); |
| 264 | 264 | export type BitbucketApiError = typeof BitbucketApiError.Type; |
| 265 | export const isBitbucketApiError = Schema.is(BitbucketApiError); | |
| 265 | const isBitbucketApiError = Schema.is(BitbucketApiError); | |
| 266 | 266 | |
| 267 | 267 | const RawBitbucketRepositorySchema = Schema.Struct({ |
| 268 | 268 | full_name: TrimmedNonEmptyString, |
| ... | ... | @@ -606,6 +606,7 @@ function responseError( |
| 606 | 606 | }); |
| 607 | 607 | } |
| 608 | 608 | |
| 609 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 609 | 610 | export const make = Effect.gen(function* () { |
| 610 | 611 | const config = yield* BitbucketApiEnvConfig; |
| 611 | 612 | const httpClient = yield* HttpClient.HttpClient; |
apps/server/src/sourceControl/BitbucketSourceControlProvider.ts-3| ... | ... | @@ -1,5 +1,4 @@ |
| 1 | 1 | import * as Effect from "effect/Effect"; |
| 2 | import * as Layer from "effect/Layer"; | |
| 3 | 2 | import * as Option from "effect/Option"; |
| 4 | 3 | import { SourceControlProviderError, type ChangeRequest } from "@t3tools/contracts"; |
| 5 | 4 | |
| ... | ... | @@ -186,8 +185,6 @@ export const make = Effect.gen(function* () { |
| 186 | 185 | }); |
| 187 | 186 | }); |
| 188 | 187 | |
| 189 | export const layer = Layer.effect(SourceControlProvider.SourceControlProvider, make); | |
| 190 | ||
| 191 | 188 | export const makeDiscovery = Effect.gen(function* () { |
| 192 | 189 | const bitbucket = yield* BitbucketApi.BitbucketApi; |
| 193 | 190 |
apps/server/src/sourceControl/GitHubCli.ts+1| ... | ... | @@ -338,6 +338,7 @@ function deriveRepositoryCloneUrlsFromCreateOutput( |
| 338 | 338 | }; |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 341 | 342 | export const make = Effect.gen(function* () { |
| 342 | 343 | const process = yield* VcsProcess.VcsProcess; |
| 343 | 344 |
apps/server/src/sourceControl/GitHubSourceControlProvider.ts-3| ... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 | import * as DateTime from "effect/DateTime"; |
| 2 | 2 | import * as Effect from "effect/Effect"; |
| 3 | import * as Layer from "effect/Layer"; | |
| 4 | 3 | import * as Option from "effect/Option"; |
| 5 | 4 | import * as Result from "effect/Result"; |
| 6 | 5 | import { |
| ... | ... | @@ -322,5 +321,3 @@ export const make = Effect.gen(function* () { |
| 322 | 321 | ), |
| 323 | 322 | }); |
| 324 | 323 | }); |
| 325 | ||
| 326 | export const layer = Layer.effect(SourceControlProvider.SourceControlProvider, make); |
apps/server/src/sourceControl/GitLabCli.ts+1-1| ... | ... | @@ -237,7 +237,6 @@ export const GitLabCliError = Schema.Union([ |
| 237 | 237 | GitLabNamespaceDecodeError, |
| 238 | 238 | ]); |
| 239 | 239 | export type GitLabCliError = typeof GitLabCliError.Type; |
| 240 | export const isGitLabCliError = Schema.is(GitLabCliError); | |
| 241 | 240 | |
| 242 | 241 | export interface GitLabMergeRequestSummary { |
| 243 | 242 | readonly number: number; |
| ... | ... | @@ -409,6 +408,7 @@ function parseRepositoryPath(repository: string): { |
| 409 | 408 | return { namespacePath, projectPath }; |
| 410 | 409 | } |
| 411 | 410 | |
| 411 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 412 | 412 | export const make = Effect.gen(function* () { |
| 413 | 413 | const process = yield* VcsProcess.VcsProcess; |
| 414 | 414 |
apps/server/src/sourceControl/GitLabSourceControlProvider.ts-3| ... | ... | @@ -1,5 +1,4 @@ |
| 1 | 1 | import * as Effect from "effect/Effect"; |
| 2 | import * as Layer from "effect/Layer"; | |
| 3 | 2 | import * as Option from "effect/Option"; |
| 4 | 3 | import { SourceControlProviderError, type ChangeRequest } from "@t3tools/contracts"; |
| 5 | 4 | |
| ... | ... | @@ -250,5 +249,3 @@ export const make = Effect.gen(function* () { |
| 250 | 249 | ), |
| 251 | 250 | }); |
| 252 | 251 | }); |
| 253 | ||
| 254 | export const layer = Layer.effect(SourceControlProvider.SourceControlProvider, make); |
apps/server/src/sourceControl/SourceControlDiscovery.ts+1| ... | ... | @@ -64,6 +64,7 @@ export class SourceControlDiscovery extends Context.Service< |
| 64 | 64 | } |
| 65 | 65 | >()("t3/sourceControl/SourceControlDiscovery") {} |
| 66 | 66 | |
| 67 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 67 | 68 | export const make = Effect.gen(function* () { |
| 68 | 69 | const config = yield* ServerConfig; |
| 69 | 70 | const process = yield* VcsProcess.VcsProcess; |
apps/server/src/sourceControl/SourceControlProvider.ts+1-1| ... | ... | @@ -61,7 +61,7 @@ export function parseSourceControlOwnerRef( |
| 61 | 61 | return owner && refName ? { owner, refName } : undefined; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | export function normalizeSourceBranch(headSelector: string): string { | |
| 64 | function normalizeSourceBranch(headSelector: string): string { | |
| 65 | 65 | return parseSourceControlOwnerRef(headSelector)?.refName ?? headSelector.trim(); |
| 66 | 66 | } |
| 67 | 67 |
apps/server/src/sourceControl/SourceControlProviderDiscovery.ts+1-1| ... | ... | @@ -115,7 +115,7 @@ export function providerAuth(input: { |
| 115 | 115 | }; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | export function unknownAuth(detail?: string): SourceControlProviderAuth { | |
| 118 | function unknownAuth(detail?: string): SourceControlProviderAuth { | |
| 119 | 119 | return providerAuth({ status: "unknown", detail }); |
| 120 | 120 | } |
| 121 | 121 |
apps/server/src/sourceControl/SourceControlRateLimit.ts+1| ... | ... | @@ -82,6 +82,7 @@ export function retryAtFromHeader(value: string | undefined, now: number): numbe |
| 82 | 82 | return Number.isFinite(retryAt) && retryAt > now ? retryAt : undefined; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 85 | 86 | export const make = Effect.gen(function* () { |
| 86 | 87 | const entries = yield* Ref.make<ReadonlyMap<string, RateLimitEntry>>(new Map()); |
| 87 | 88 |
apps/server/src/sourceControl/SourceControlRepositoryService.ts+1| ... | ... | @@ -77,6 +77,7 @@ function selectRemoteUrl( |
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 80 | 81 | export const make = Effect.gen(function* () { |
| 81 | 82 | const config = yield* ServerConfig; |
| 82 | 83 | const fileSystem = yield* FileSystem.FileSystem; |
apps/server/src/sourceControl/azureDevOpsPullRequests.ts+1-3| ... | ... | @@ -5,7 +5,7 @@ import * as Option from "effect/Option"; |
| 5 | 5 | import * as Result from "effect/Result"; |
| 6 | 6 | import * as Schema from "effect/Schema"; |
| 7 | 7 | import { PositiveInt, TrimmedNonEmptyString } from "@t3tools/contracts"; |
| 8 | import { decodeJsonResult, formatSchemaError } from "@t3tools/shared/schemaJson"; | |
| 8 | import { decodeJsonResult } from "@t3tools/shared/schemaJson"; | |
| 9 | 9 | |
| 10 | 10 | export interface NormalizedAzureDevOpsPullRequestRecord { |
| 11 | 11 | readonly number: number; |
| ... | ... | @@ -190,8 +190,6 @@ const decodeAzureDevOpsPullRequestList = decodeJsonResult(Schema.Array(Schema.Un |
| 190 | 190 | const decodeAzureDevOpsPullRequest = decodeJsonResult(AzureDevOpsPullRequestSchema); |
| 191 | 191 | const decodeAzureDevOpsPullRequestEntry = Schema.decodeUnknownExit(AzureDevOpsPullRequestSchema); |
| 192 | 192 | |
| 193 | export const formatAzureDevOpsJsonDecodeError = formatSchemaError; | |
| 194 | ||
| 195 | 193 | export function decodeAzureDevOpsPullRequestListJson( |
| 196 | 194 | raw: string, |
| 197 | 195 | ): Result.Result< |
apps/server/src/sourceControl/gitHubPullRequests.ts+1-3| ... | ... | @@ -5,7 +5,7 @@ import * as Option from "effect/Option"; |
| 5 | 5 | import * as Result from "effect/Result"; |
| 6 | 6 | import * as Schema from "effect/Schema"; |
| 7 | 7 | import { PositiveInt, TrimmedNonEmptyString } from "@t3tools/contracts"; |
| 8 | import { decodeJsonResult, formatSchemaError } from "@t3tools/shared/schemaJson"; | |
| 8 | import { decodeJsonResult } from "@t3tools/shared/schemaJson"; | |
| 9 | 9 | |
| 10 | 10 | export interface NormalizedGitHubPullRequestRecord { |
| 11 | 11 | readonly number: number; |
| ... | ... | @@ -114,8 +114,6 @@ const decodeGitHubPullRequestList = decodeJsonResult(Schema.Array(Schema.Unknown |
| 114 | 114 | const decodeGitHubPullRequest = decodeJsonResult(GitHubPullRequestSchema); |
| 115 | 115 | const decodeGitHubPullRequestEntry = Schema.decodeUnknownExit(GitHubPullRequestSchema); |
| 116 | 116 | |
| 117 | export const formatGitHubJsonDecodeError = formatSchemaError; | |
| 118 | ||
| 119 | 117 | export function decodeGitHubPullRequestListJson( |
| 120 | 118 | raw: string, |
| 121 | 119 | ): Result.Result< |
apps/server/src/sourceControl/gitLabMergeRequests.ts+1-3| ... | ... | @@ -5,7 +5,7 @@ import * as Option from "effect/Option"; |
| 5 | 5 | import * as Result from "effect/Result"; |
| 6 | 6 | import * as Schema from "effect/Schema"; |
| 7 | 7 | import { PositiveInt, TrimmedNonEmptyString } from "@t3tools/contracts"; |
| 8 | import { decodeJsonResult, formatSchemaError } from "@t3tools/shared/schemaJson"; | |
| 8 | import { decodeJsonResult } from "@t3tools/shared/schemaJson"; | |
| 9 | 9 | |
| 10 | 10 | export interface NormalizedGitLabMergeRequestRecord { |
| 11 | 11 | readonly number: number; |
| ... | ... | @@ -129,8 +129,6 @@ const decodeGitLabMergeRequestList = decodeJsonResult(Schema.Array(Schema.Unknow |
| 129 | 129 | const decodeGitLabMergeRequest = decodeJsonResult(GitLabMergeRequestSchema); |
| 130 | 130 | const decodeGitLabMergeRequestEntry = Schema.decodeUnknownExit(GitLabMergeRequestSchema); |
| 131 | 131 | |
| 132 | export const formatGitLabJsonDecodeError = formatSchemaError; | |
| 133 | ||
| 134 | 132 | export function decodeGitLabMergeRequestListJson( |
| 135 | 133 | raw: string, |
| 136 | 134 | ): Result.Result< |
apps/server/src/sourceControl/githubGraphQlBudget.ts+1| ... | ... | @@ -77,6 +77,7 @@ function withRateLimit(document: string): string { |
| 77 | 77 | return `${document.slice(0, end)}\n ${RATE_LIMIT_SELECTION}\n${document.slice(end)}`; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | /** @public Service construction is part of the canonical Effect module API. */ | |
| 80 | 81 | export const make = Effect.gen(function* () { |
| 81 | 82 | const snapshots = yield* Ref.make<ReadonlyMap<string, GraphQlBudgetSnapshot>>(new Map()); |
| 82 | 83 |