MCPcopy Index your code
hub / github.com/jetify-com/devbox / AreAllOutputsInCache

Method AreAllOutputsInCache

internal/devpkg/narinfo_cache.go:165–189  ·  view source on GitHub ↗
(
	ctx context.Context, w io.Writer, cacheURI string,
)

Source from the content-addressed store, hash-verified

163}
164
165func (p *Package) AreAllOutputsInCache(
166 ctx context.Context, w io.Writer, cacheURI string,
167) (bool, error) {
168 storePaths, err := p.GetStorePaths(ctx, w)
169 if err != nil {
170 return false, err
171 }
172
173 for _, storePath := range storePaths {
174 pathParts := nix.NewStorePathParts(storePath)
175 hash := pathParts.Hash
176 if strings.HasPrefix(cacheURI, "s3") {
177 inCache, err := fetchNarInfoStatusFromS3(ctx, cacheURI, hash)
178 if err != nil || !inCache {
179 return false, err
180 }
181 } else {
182 inCache, err := fetchNarInfoStatusFromHTTP(ctx, cacheURI, hash)
183 if err != nil || !inCache {
184 return false, err
185 }
186 }
187 }
188 return true, nil
189}
190
191func (p *Package) outputsForOutputName(output string) ([]lock.Output, error) {
192 sysInfo, err := p.sysInfoIfExists()

Callers 1

UploadProjectToCacheMethod · 0.80

Calls 4

GetStorePathsMethod · 0.95
NewStorePathPartsFunction · 0.92
fetchNarInfoStatusFromS3Function · 0.85

Tested by

no test coverage detected