(params: CommonParams, node: FNode, expectedDigest: string | undefined)
| 509 | } |
| 510 | |
| 511 | async function getTgzFeatureMetadata(params: CommonParams, node: FNode, expectedDigest: string | undefined): Promise<Feature | undefined> { |
| 512 | const { output } = params; |
| 513 | |
| 514 | // TODO: Implement a caching layer here! |
| 515 | // This can be optimized to share work done here |
| 516 | // with the 'fetchFeatures()` stage later on. |
| 517 | const srcInfo = node?.featureSet?.sourceInformation; |
| 518 | if (!node.featureSet || !srcInfo || srcInfo.type !== 'direct-tarball') { |
| 519 | return; |
| 520 | } |
| 521 | |
| 522 | const tmp = path.join(os.tmpdir(), crypto.randomUUID()); |
| 523 | const result = await fetchContentsAtTarballUri(params, srcInfo.tarballUri, expectedDigest, tmp, undefined, tmp, DEVCONTAINER_FEATURE_FILE_NAME); |
| 524 | if (!result || !result.metadata) { |
| 525 | output.write(`No metadata for Feature '${node.userFeatureId}' from '${srcInfo.tarballUri}'`, LogLevel.Trace); |
| 526 | return; |
| 527 | } |
| 528 | |
| 529 | const metadata = result.metadata as Feature; |
| 530 | return metadata; |
| 531 | |
| 532 | } |
| 533 | |
| 534 | // Creates the directed acyclic graph (DAG) of Features and their dependencies. |
| 535 | export async function buildDependencyGraph( |
no test coverage detected