MCPcopy Index your code
hub / github.com/devcontainers/cli / getTgzFeatureMetadata

Function getTgzFeatureMetadata

src/spec-configuration/containerFeaturesOrder.ts:511–532  ·  view source on GitHub ↗
(params: CommonParams, node: FNode, expectedDigest: string | undefined)

Source from the content-addressed store, hash-verified

509}
510
511async 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.
535export async function buildDependencyGraph(

Callers 1

_buildDependencyGraphFunction · 0.85

Calls 3

tmpdirMethod · 0.80
writeMethod · 0.65

Tested by

no test coverage detected