feat(ingestion): add progress reporting for status enrichment pipeline
Previously the status enrichment phase (GraphQL work item status fetch)
ran silently — users saw no feedback between "syncing issues" and the
final enrichment summary. For projects with hundreds of issues and
adaptive page-size retries, this felt like a hang.
Changes across three layers:
GraphQL (graphql.rs):
- Extract fetch_issue_statuses_with_progress() accepting an optional
on_page callback invoked after each paginated fetch with the
running count of fetched IIDs
- Original fetch_issue_statuses() preserved as a zero-cost
delegation wrapper (no callback overhead)
Orchestrator (orchestrator.rs):
- Three new ProgressEvent variants: StatusEnrichmentStarted,
StatusEnrichmentPageFetched, StatusEnrichmentWriting
- Wire the page callback through to the new _with_progress fn
CLI (ingest.rs):
- Handle all three new events in the progress callback, updating
both the per-project spinner and the stage bar with live counts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -233,6 +233,14 @@ fn is_complexity_or_timeout_error(msg: &str) -> bool {
|
||||
pub async fn fetch_issue_statuses(
|
||||
client: &GraphqlClient,
|
||||
project_path: &str,
|
||||
) -> crate::core::error::Result<FetchStatusResult> {
|
||||
fetch_issue_statuses_with_progress(client, project_path, None).await
|
||||
}
|
||||
|
||||
pub async fn fetch_issue_statuses_with_progress(
|
||||
client: &GraphqlClient,
|
||||
project_path: &str,
|
||||
on_page: Option<&dyn Fn(usize)>,
|
||||
) -> crate::core::error::Result<FetchStatusResult> {
|
||||
let mut statuses = std::collections::HashMap::new();
|
||||
let mut all_fetched_iids = std::collections::HashSet::new();
|
||||
@@ -327,6 +335,10 @@ pub async fn fetch_issue_statuses(
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(cb) = &on_page {
|
||||
cb(all_fetched_iids.len());
|
||||
}
|
||||
|
||||
// Pagination
|
||||
if !connection.page_info.has_next_page {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user