refactor: Remove redundant doc comments throughout codebase
Removes module-level doc comments (//! lines) and excessive inline doc comments that were duplicating information already evident from: - Function/struct names (self-documenting code) - Type signatures (the what is clear from types) - Implementation context (the how is clear from code) Affected modules: - cli/* - Removed command descriptions duplicating clap help text - core/* - Removed module headers and obvious function docs - documents/* - Removed extractor/regenerator/truncation docs - embedding/* - Removed pipeline and chunking docs - gitlab/* - Removed client and transformer docs (kept type definitions) - ingestion/* - Removed orchestrator and ingestion docs - search/* - Removed FTS and vector search docs Philosophy: Code should be self-documenting. Comments should explain "why" (business decisions, non-obvious constraints) not "what" (which the code itself shows). This change reduces noise and maintenance burden while keeping the codebase just as understandable. Retains comments for: - Non-obvious business logic - Important safety invariants - Complex algorithm explanations - Public API boundaries where generated docs matter Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
//! Issue transformer: converts GitLabIssue to local schema.
|
||||
|
||||
use chrono::DateTime;
|
||||
use thiserror::Error;
|
||||
|
||||
@@ -11,7 +9,6 @@ pub enum TransformError {
|
||||
TimestampParse(String, String),
|
||||
}
|
||||
|
||||
/// Local schema representation of an issue row.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct IssueRow {
|
||||
pub gitlab_id: i64,
|
||||
@@ -21,14 +18,13 @@ pub struct IssueRow {
|
||||
pub description: Option<String>,
|
||||
pub state: String,
|
||||
pub author_username: String,
|
||||
pub created_at: i64, // ms epoch UTC
|
||||
pub updated_at: i64, // ms epoch UTC
|
||||
pub created_at: i64,
|
||||
pub updated_at: i64,
|
||||
pub web_url: String,
|
||||
pub due_date: Option<String>, // YYYY-MM-DD
|
||||
pub milestone_title: Option<String>, // Denormalized for quick display
|
||||
pub due_date: Option<String>,
|
||||
pub milestone_title: Option<String>,
|
||||
}
|
||||
|
||||
/// Local schema representation of a milestone row.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct MilestoneRow {
|
||||
pub gitlab_id: i64,
|
||||
@@ -41,7 +37,6 @@ pub struct MilestoneRow {
|
||||
pub web_url: Option<String>,
|
||||
}
|
||||
|
||||
/// Issue bundled with extracted metadata.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct IssueWithMetadata {
|
||||
pub issue: IssueRow,
|
||||
@@ -50,14 +45,12 @@ pub struct IssueWithMetadata {
|
||||
pub milestone: Option<MilestoneRow>,
|
||||
}
|
||||
|
||||
/// Parse ISO 8601 timestamp to milliseconds since Unix epoch.
|
||||
fn parse_timestamp(ts: &str) -> Result<i64, TransformError> {
|
||||
DateTime::parse_from_rfc3339(ts)
|
||||
.map(|dt| dt.timestamp_millis())
|
||||
.map_err(|e| TransformError::TimestampParse(ts.to_string(), e.to_string()))
|
||||
}
|
||||
|
||||
/// Transform a GitLab issue into local schema format.
|
||||
pub fn transform_issue(issue: &GitLabIssue) -> Result<IssueWithMetadata, TransformError> {
|
||||
let created_at = parse_timestamp(&issue.created_at)?;
|
||||
let updated_at = parse_timestamp(&issue.updated_at)?;
|
||||
@@ -182,20 +175,16 @@ mod tests {
|
||||
let issue = make_test_issue();
|
||||
let result = transform_issue(&issue).unwrap();
|
||||
|
||||
// 2024-01-15T10:00:00.000Z = 1705312800000 ms
|
||||
assert_eq!(result.issue.created_at, 1705312800000);
|
||||
// 2024-01-20T15:30:00.000Z = 1705764600000 ms
|
||||
assert_eq!(result.issue.updated_at, 1705764600000);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn handles_timezone_offset_timestamps() {
|
||||
let mut issue = make_test_issue();
|
||||
// GitLab can return timestamps with timezone offset
|
||||
issue.created_at = "2024-01-15T05:00:00-05:00".to_string();
|
||||
|
||||
let result = transform_issue(&issue).unwrap();
|
||||
// 05:00 EST = 10:00 UTC = same as original test
|
||||
assert_eq!(result.issue.created_at, 1705312800000);
|
||||
}
|
||||
|
||||
@@ -237,10 +226,8 @@ mod tests {
|
||||
|
||||
let result = transform_issue(&issue).unwrap();
|
||||
|
||||
// Denormalized title on issue for quick display
|
||||
assert_eq!(result.issue.milestone_title, Some("v1.0".to_string()));
|
||||
|
||||
// Full milestone row for normalized storage
|
||||
let milestone = result.milestone.expect("should have milestone");
|
||||
assert_eq!(milestone.gitlab_id, 500);
|
||||
assert_eq!(milestone.iid, 5);
|
||||
|
||||
Reference in New Issue
Block a user