Skip to content

Commit 5ed19a2

Browse files
committed
fix: refresh the artifact on both incremental paths
cbm_pipeline_refresh_artifact already encodes the policy this PR was written to add: it exports when persistence is on even with no artifact present, picks BEST over FAST for that first export, and propagates an export failure. The full path and the semantic_manifest_equal no-op already call it; the other two incremental exits did not. The no_changes no-op returned 0 without refreshing, so a run that changed nothing never created the first artifact. The dump path hand-rolled an exists-only FAST export and discarded its result. Both now route through the helper, which is also why this diff is much smaller than the original branch. Signed-off-by: Matt Van Horn <[email protected]>
1 parent 70a9539 commit 5ed19a2

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

‎src/pipeline/pipeline_incremental.c‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,10 +1493,6 @@ static int dump_and_persist(cbm_gbuf_t *gbuf, const char *db_path, const char *p
14931493
return rc;
14941494
}
14951495

1496-
/* Auto-update artifact if one already exists (persistence was enabled previously) */
1497-
if (repo_path && cbm_artifact_exists(repo_path)) {
1498-
cbm_artifact_export(db_path, repo_path, project, CBM_ARTIFACT_FAST);
1499-
}
15001496
return 0;
15011497
}
15021498

@@ -2488,7 +2484,9 @@ int cbm_pipeline_run_incremental(cbm_pipeline_t *p, const char *db_path, cbm_fil
24882484
free_mode_skipped(mode_skipped, mode_skipped_count);
24892485
cbm_store_free_file_hashes(stored, stored_count);
24902486
cbm_store_close(store);
2491-
return 0;
2487+
/* Same contract as the semantic_manifest_equal no-op above: a run that
2488+
* changed nothing still owes the first artifact when persistence is on. */
2489+
return cbm_pipeline_refresh_artifact(p, db_path);
24922490
}
24932491

24942492
#if defined(CBM_INCREMENTAL_TEST_API) && CBM_INCREMENTAL_TEST_API
@@ -2859,5 +2857,11 @@ int cbm_pipeline_run_incremental(cbm_pipeline_t *p, const char *db_path, cbm_fil
28592857
cbm_gbuf_free(existing);
28602858

28612859
cbm_log_info("incremental.done", "elapsed_ms", itoa_buf((int)elapsed_ms(t0)));
2862-
return persist_rc;
2860+
if (persist_rc != 0) {
2861+
return persist_rc;
2862+
}
2863+
/* Mirrors the full path: publication succeeded, so refresh the artifact.
2864+
* The helper creates the FIRST one when persistence is on and propagates
2865+
* an export failure instead of leaving the run looking successful. */
2866+
return cbm_pipeline_refresh_artifact(p, db_path);
28632867
}

0 commit comments

Comments
 (0)