MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / sh_link_build

Function sh_link_build

src/pipeline/pass_shell.c:3641–3660  ·  view source on GitHub ↗

The edge hit `x` draws from source `src`; 1 when drawn. */ An image a build command makes DEPENDS_ON {via:build} the Dockerfile * it is built from (edges recomputed whole every run, as the image belongs * to no file). */

Source from the content-addressed store, hash-verified

3639 * it is built from (edges recomputed whole every run, as the image belongs
3640 * to no file). */
3641static int sh_link_build(cbm_pipeline_ctx_t *ctx, const sh_hit_t *x, CBMHashTable *modules) {
3642 int64_t mod = (int64_t)(intptr_t)cbm_ht_get(modules, x->path);
3643 int64_t img = mod > 0 ? cbm_pipeline_image_node(ctx, x->ext) : 0;
3644 if (img <= 0) {
3645 return 0;
3646 }
3647 char esc_file[CBM_SZ_1K];
3648 char esc_img[CBM_SZ_1K];
3649 char ci[CBM_SZ_1K];
3650 char props[CBM_SZ_4K];
3651 cbm_json_escape(esc_file, (int)sizeof(esc_file), x->file);
3652 cbm_json_escape(esc_img, (int)sizeof(esc_img), x->ext);
3653 sh_ci_props(x, ci, sizeof(ci));
3654 snprintf(props, sizeof(props),
3655 "{\"via\":\"build\",\"tool\":\"docker-build\",\"file\":\"%s\",\"image\":\"%s\"%s,"
3656 "\"line\":%d}",
3657 esc_file, esc_img, ci, x->line);
3658 cbm_gbuf_insert_edge(ctx->gbuf, img, mod, "DEPENDS_ON", props);
3659 return SKIP_ONE;
3660}
3661
3662/* A host that is a service of the repository: one DNS label or a
3663 * `<svc>.<ns>.svc...` name whose first label names a Kubernetes Service of

Callers 1

sh_linkFunction · 0.85

Calls 5

cbm_ht_getFunction · 0.85
cbm_pipeline_image_nodeFunction · 0.85
cbm_json_escapeFunction · 0.85
sh_ci_propsFunction · 0.85
cbm_gbuf_insert_edgeFunction · 0.85

Tested by

no test coverage detected