(
ctx context.Context,
parentMod dagql.ObjectResult[*core.Module],
args struct{},
)
| 3014 | } |
| 3015 | |
| 3016 | func (s *moduleSchema) moduleImplementationScoped( |
| 3017 | ctx context.Context, |
| 3018 | parentMod dagql.ObjectResult[*core.Module], |
| 3019 | args struct{}, |
| 3020 | ) (inst dagql.ObjectResult[*core.Module], err error) { |
| 3021 | if !parentMod.Self().Source.Valid { |
| 3022 | return inst, fmt.Errorf("failed to get source implementation digest for module: no module source available") |
| 3023 | } |
| 3024 | sourceDigest, err := parentMod.Self().Source.Value.Self().SourceImplementationDigest(ctx) |
| 3025 | if err != nil { |
| 3026 | return inst, fmt.Errorf("failed to get source implementation digest for module: %w", err) |
| 3027 | } |
| 3028 | scopedDigestInputs := []string{"Module._implementationScoped", sourceDigest.String()} |
| 3029 | if parentMod.Self().AsModuleVariantDigest != "" { |
| 3030 | scopedDigestInputs = append(scopedDigestInputs, parentMod.Self().AsModuleVariantDigest) |
| 3031 | } |
| 3032 | scopedDigest := hashutil.HashStrings(scopedDigestInputs...) |
| 3033 | dag, err := core.CurrentDagqlServer(ctx) |
| 3034 | if err != nil { |
| 3035 | return inst, fmt.Errorf("failed to get dag server: %w", err) |
| 3036 | } |
| 3037 | inst, err = dagql.NewObjectResultForCurrentCall(ctx, dag, parentMod.Self().Clone()) |
| 3038 | if err != nil { |
| 3039 | return inst, err |
| 3040 | } |
| 3041 | return inst.WithContentDigest(ctx, scopedDigest) |
| 3042 | } |
nothing calls this directly
no test coverage detected