| 344 | /* ── Graph scope, seeding, selection ─────────────────────────────── */ |
| 345 | |
| 346 | static bool te_open_scope(te_ctx_t *c) { |
| 347 | if (cbm_store_read_scope_open(c->store, NULL, NULL, &c->scope) != CBM_STORE_OK) { |
| 348 | return te_fallback(c, CBM_TEST_RESULT_FALLBACK_GRAPH_UNAVAILABLE, |
| 349 | "the graph of HEAD could not be read") && |
| 350 | false; |
| 351 | } |
| 352 | static const unsigned char project[] = "test-impact"; |
| 353 | cbm_store_graph_digest_limits_t limits = {.max_rows = (uint64_t)1 << 32, |
| 354 | .max_framed_bytes = (uint64_t)1 << 40}; |
| 355 | cbm_store_graph_digest_t digest; |
| 356 | if (cbm_store_graph_digest(c->scope, project, sizeof(project) - 1, &limits, &digest) != |
| 357 | CBM_STORE_GRAPH_DIGEST_OK) { |
| 358 | return te_fallback(c, CBM_TEST_RESULT_FALLBACK_GRAPH_REJECTED, |
| 359 | "the graph of HEAD could not be digested") && |
| 360 | false; |
| 361 | } |
| 362 | memcpy(c->graph_sha256, digest.sha256, sizeof(c->graph_sha256)); |
| 363 | c->graph_digest = true; |
| 364 | return true; |
| 365 | } |
| 366 | |
| 367 | static bool te_seed(te_ctx_t *c) { |
| 368 | cbm_ti_seed_input_t in = {.changes = c->seed_changes, |
no test coverage detected