feat: Add commit SHAs, closes_issues watermark, and PRD alignment

Migration 015 adds merge_commit_sha/squash_commit_sha to merge_requests
(Gate 4/5 prerequisites), closes_issues_synced_for_updated_at watermark
for incremental sync, and the missing idx_label_events_label index.

The MR transformer and ingestion pipeline now populate commit SHAs during
sync. The orchestrator uses watermark-based filtering for closes_issues
jobs instead of re-enqueuing all MRs every sync.

The Phase B PRD is updated to match the actual codebase: corrected
migration numbering (011-015), documented nullable label/milestone
fields (migration 012), watermark patterns (013), observability
infrastructure (014), simplified source_method values, and updated
entity_references schema to match implementation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Taylor Eernisse
2026-02-05 15:29:51 -05:00
parent ddcfff1026
commit 233eb546af
7 changed files with 189 additions and 63 deletions

View File

@@ -24,6 +24,8 @@ pub struct NormalizedMergeRequest {
pub closed_at: Option<i64>,
pub last_seen_at: i64,
pub web_url: String,
pub merge_commit_sha: Option<String>,
pub squash_commit_sha: Option<String>,
}
#[derive(Debug, Clone)]
@@ -100,6 +102,8 @@ pub fn transform_merge_request(
closed_at,
last_seen_at: now_ms(),
web_url: gitlab_mr.web_url.clone(),
merge_commit_sha: gitlab_mr.merge_commit_sha.clone(),
squash_commit_sha: gitlab_mr.squash_commit_sha.clone(),
},
label_names: gitlab_mr.labels.clone(),
assignee_usernames,

View File

@@ -247,4 +247,6 @@ pub struct GitLabMergeRequest {
#[serde(default)]
pub reviewers: Vec<GitLabReviewer>,
pub web_url: String,
pub merge_commit_sha: Option<String>,
pub squash_commit_sha: Option<String>,
}