Showing the changes to packages/plugins/apps/src/source/github-source.ts (1 of 20 files). Show all
Unified · Split
| @@ -2,7 +2,7 @@ import { Data, Effect, Result } from "effect"; · 1 unmodified line | ||
| 2 | 2 | |
| 3 | 3 | import { PublishError, type FileDiagnostic } from "../pipeline/discover"; |
| 4 | 4 | import { PUBLISH_LIMITS, enforcePublishLimits } from "../pipeline/publish"; |
| 5 | −import type { AppSourceRef } from "../pipeline/descriptor"; | |
| 5 | +import type { AppSourceRef, SourceSkippedArtifact } from "../pipeline/descriptor"; | |
| 6 | 6 | import type { AppsRuntime } from "../plugin/runtime"; |
| 7 | 7 | import type { FileSet, SnapshotId } from "../seams/artifact-store"; |
| 8 | 8 | |
| @@ -36,10 +36,7 @@ export interface SyncErrorData { · 27 unmodified lines | ||
| 36 | 36 | readonly diagnostics?: readonly FileDiagnostic[]; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | −export interface GitHubSkippedArtifact { | |
| 40 | − readonly path: string; | |
| 41 | − readonly reason: "not supported yet" | "unsupported file type" | "ignored"; | |
| 42 | −} | |
| 39 | +export type GitHubSkippedArtifact = SourceSkippedArtifact; | |
| 43 | 40 | |
| 44 | 41 | export type GitHubSyncResult = |
| 45 | 42 | | { |
| @@ -69,6 +66,7 @@ export interface SyncGitHubSourceInput extends GitHubSourceInput { · 23 unmodified lines | ||
| 69 | 66 | readonly runtime: AppsRuntime; |
| 70 | 67 | readonly tenant?: string; |
| 71 | 68 | readonly scope: string; |
| 69 | + readonly connection?: string; | |
| 72 | 70 | } |
| 73 | 71 | |
| 74 | 72 | const TOOL_RE = /^tools\/([a-z0-9][a-z0-9-]*)\.(ts|tsx|js|jsx)$/; |
| @@ -374,11 +372,13 @@ const sourceErrorToSyncError = (error: GitHubSourceError): SyncErrorData => ({ · 299 unmodified lines | ||
| 374 | 372 | diagnostics: error.path ? [{ path: error.path, message: error.message }] : [], |
| 375 | 373 | }); |
| 376 | 374 | |
| 377 | −const sourceRef = (snapshot: GitHubSourceSnapshot): AppSourceRef => ({ | |
| 375 | +const sourceRef = (snapshot: GitHubSourceSnapshot, connection?: string): AppSourceRef => ({ | |
| 378 | 376 | kind: "github", |
| 379 | 377 | repo: snapshot.repo, |
| 380 | 378 | ref: snapshot.ref, |
| 381 | 379 | upstreamSha: snapshot.upstreamSha, |
| 380 | + ...(connection ? { connection } : {}), | |
| 381 | + skipped: snapshot.skipped, | |
| 382 | 382 | }); |
| 383 | 383 | |
| 384 | 384 | export const syncGitHubSource = (input: SyncGitHubSourceInput): Effect.Effect<GitHubSyncResult> => |
| @@ -420,7 +420,7 @@ export const syncGitHubSource = (input: SyncGitHubSourceInput): Effect.Effect<Gi · 35 unmodified lines | ||
| 420 | 420 | scope: input.scope, |
| 421 | 421 | files: snapshot.files, |
| 422 | 422 | description: snapshot.description, |
| 423 | − source: sourceRef(snapshot), | |
| 423 | + source: sourceRef(snapshot, input.connection), | |
| 424 | 424 | message: `sync ${snapshot.repo}@${snapshot.upstreamSha}`, |
| 425 | 425 | }) |
| 426 | 426 | .pipe(Effect.result); |