MCPcopy Index your code
hub / github.com/dagger/dagger / currentModuleCacheKey

Method currentModuleCacheKey

core/schema/module.go:2005–2029  ·  view source on GitHub ↗
(
	ctx context.Context,
	parent dagql.ObjectResult[*core.Query],
	args currentModuleArgs,
	req *dagql.CallRequest,
)

Source from the content-addressed store, hash-verified

2003}
2004
2005func (s *moduleSchema) currentModuleCacheKey(
2006 ctx context.Context,
2007 parent dagql.ObjectResult[*core.Query],
2008 args currentModuleArgs,
2009 req *dagql.CallRequest,
2010) error {
2011 if args.ImplementationScopedMod.Valid {
2012 return nil
2013 }
2014
2015 mod, err := parent.Self().CurrentModule(ctx)
2016 if err != nil {
2017 return fmt.Errorf("failed to get current module: %w", err)
2018 }
2019 scopedMod, err := core.ImplementationScopedModule(ctx, mod)
2020 if err != nil {
2021 return fmt.Errorf("failed to get implementation-scoped current module: %w", err)
2022 }
2023 scopedModID, err := scopedMod.ID()
2024 if err != nil {
2025 return fmt.Errorf("failed to get implementation-scoped current module ID: %w", err)
2026 }
2027 args.ImplementationScopedMod = dagql.Opt(dagql.NewID[*core.Module](scopedModID))
2028 return req.SetArgInput(ctx, "implementationScopedMod", dagql.NewID[*core.Module](scopedModID), false)
2029}
2030
2031func (s *moduleSchema) currentModule(
2032 ctx context.Context,

Callers

nothing calls this directly

Calls 6

OptFunction · 0.92
SelfMethod · 0.80
SetArgInputMethod · 0.80
CurrentModuleMethod · 0.65
IDMethod · 0.65

Tested by

no test coverage detected