Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
JadenSimon committed Sep 7, 2024
1 parent 2c14a51 commit dfda737
Show file tree
Hide file tree
Showing 19 changed files with 561 additions and 410 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pipeline-step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
if: fromJSON(inputs.step-config).publish

- name: Pipeline Bundle
run: synapse deploy src/cli/install.ts && synapse bundle --sea --downloadOnly --pipelined ${{ fromJSON(inputs.pipeline-context).stepKeyHash }}
run: synapse deploy src/cli/install.ts && synapse run src/cli/buildInternal.ts -- --sea --downloadOnly --pipelined ${{ fromJSON(inputs.pipeline-context).stepKeyHash }}
if: fromJSON(inputs.step-config).inputs.pipelined

- name: Clean-up
Expand Down
16 changes: 11 additions & 5 deletions src/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { ExternalValue, PackageInfo } from './runtime/modules/serdes'
import { getLogger, runTask } from './logging'
import { Mutable, acquireFsLock, createRwMutex, createTrie, deepClone, getHash, isNonNullable, keyedMemoize, memoize, sortRecord, throwIfNotFileNotFoundError, tryReadJson } from './utils'
import type { TerraformPackageManifest, TfJson } from './runtime/modules/terraform'
import { BuildTarget, Deployment, Program, getBuildDir, getProgramInfoFromDeployment, getRemoteProjectId, getRootDir, getRootDirectory, getTargetDeploymentIdOrThrow, getWorkingDir, resolveProgramBuildTarget, toProgramRef } from './workspaces'
import { BuildTarget, isRemoteDisabled, getBuildDir, getProgramInfoFromDeployment, getRemoteProjectId, getRootDir, getRootDirectory, getTargetDeploymentIdOrThrow, getWorkingDir, resolveProgramBuildTarget, toProgramRef } from './workspaces'
import { NpmPackageInfo } from './pm/packages'
import { TargetsFile, readPointersFile } from './compiler/host'
import { TarballFile } from './utils/tar'
Expand Down Expand Up @@ -263,6 +263,7 @@ interface RootArtifactStore {
getMetadata(hash: string): Record<string, ArtifactMetadata> | undefined
getMetadata(hash: string, source: string): ArtifactMetadata
getMetadata2(pointer: string): Promise<ArtifactMetadata>
getMetadata2(hash: string, source: string): Promise<ArtifactMetadata>

resolveArtifact(hash: string, opt: ResolveArtifactOpts & { sync: true }): string
resolveArtifact(hash: string, opt?: ResolveArtifactOpts): Promise<string> | string
Expand Down Expand Up @@ -3643,7 +3644,14 @@ function getRepository(fs: Fs & SyncFs, buildDir: string) {
return getStoreSync(storeHash).getMetadata(hash, storeHash)
}

async function getMetadata2(pointer: string) {
async function getMetadata2(pointer: string): Promise<ArtifactMetadata>
async function getMetadata2(hash: string, source: string): Promise<ArtifactMetadata>
async function getMetadata2(pointerOrHash: string, source?: string) {
if (source) {
return _getMetadata(pointerOrHash, source, true)
}

const pointer = pointerOrHash
if (!isDataPointer(pointer)) {
throw new Error('Not implemented')
}
Expand Down Expand Up @@ -5025,10 +5033,8 @@ async function syncHeads(repo: DataRepository, remote: RemoteArtifactRepository,
}
}

const shouldUseRemote = !!process.env['SYNAPSE_SHOULD_USE_REMOTE']

export async function syncRemote(projectId: string, deploymentId: string) {
if (!shouldUseRemote) {
if (isRemoteDisabled()) {
return
}

Expand Down
Loading

0 comments on commit dfda737

Please sign in to comment.