feat(ingestion): Mark entities dirty on ingest for document regeneration
Integrates the dirty tracking system into all four ingestion paths (issues, MRs, issue discussions, MR discussions). After each entity is upserted within its transaction, a corresponding dirty_queue entry is inserted so the document regenerator knows which documents need rebuilding. This ensures that document generation stays transactionally consistent with data changes: if the ingest transaction rolls back, the dirty marker rolls back too, preventing stale document regeneration attempts. Also updates GiError references to LoreError in these files as part of the codebase-wide rename, and adjusts issue discussion logging from info to debug level to reduce noise during normal sync runs. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,8 @@ use crate::Config;
|
||||
use crate::core::error::Result;
|
||||
use crate::core::payloads::{StorePayloadOptions, store_payload};
|
||||
use crate::core::time::now_ms;
|
||||
use crate::documents::SourceType;
|
||||
use crate::ingestion::dirty_tracker;
|
||||
use crate::gitlab::GitLabClient;
|
||||
use crate::gitlab::transformers::{
|
||||
NormalizedDiscussion, NormalizedNote, transform_mr_discussion,
|
||||
@@ -189,6 +191,9 @@ pub fn write_prefetched_mr_discussions(
|
||||
|row| row.get(0),
|
||||
)?;
|
||||
|
||||
// Mark dirty for document regeneration (inside transaction)
|
||||
dirty_tracker::mark_dirty_tx(&tx, SourceType::Discussion, local_discussion_id)?;
|
||||
|
||||
// Upsert notes
|
||||
for note in &disc.notes {
|
||||
let should_store_payload = !note.is_system
|
||||
@@ -402,6 +407,9 @@ async fn ingest_discussions_for_mr(
|
||||
|row| row.get(0),
|
||||
)?;
|
||||
|
||||
// Mark dirty for document regeneration (inside transaction)
|
||||
dirty_tracker::mark_dirty_tx(&tx, SourceType::Discussion, local_discussion_id)?;
|
||||
|
||||
// Upsert notes (not delete-all-then-insert)
|
||||
for note in ¬es {
|
||||
// Selective payload storage: skip system notes without position
|
||||
|
||||
Reference in New Issue
Block a user