feat(worker): add hg-edge and bugzilla pollers
Wires two historical sources for completeness with the 2019 timeline: - hg-edge.mozilla.org: scans json-pushes for a configured set of build/* repos and matches changeset author client-side, since the pushlog `user=` filter targets the pusher (sheriffs/reviewers in this case) rather than the author. Daily poll cadence — mozilla retired hg, no new events expected. - bugzilla.mozilla.org: queries /rest/bug?creator=<email>. Without an api key the unauthenticated endpoint only returns public bugs, which is what the public timeline wants anyway. Reshape renders "<author> committed <short_node> in <repo>" for hg and "filed bug #<id> in <product>" for bugzilla, both linking back to the canonical upstream URL via a stamped `_host` payload field. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,31 +3,18 @@
|
||||
//! Storage holds the upstream payload verbatim; transformation lives here so
|
||||
//! the rendering can evolve without re-fetching upstream data.
|
||||
|
||||
use moments_entities::{Event, Source, TimelineIcon, TimelineItem, TitleSegment};
|
||||
use moments_entities::{Event, Source, TimelineItem};
|
||||
|
||||
mod bugzilla;
|
||||
mod gitea;
|
||||
mod github;
|
||||
mod hg;
|
||||
|
||||
pub fn reshape(event: &Event) -> TimelineItem {
|
||||
match event.source {
|
||||
Source::Github => github::reshape(event),
|
||||
Source::Gitea => gitea::reshape(event),
|
||||
Source::Hg | Source::Bugzilla => generic_fallback(event),
|
||||
}
|
||||
}
|
||||
|
||||
fn generic_fallback(event: &Event) -> TimelineItem {
|
||||
TimelineItem {
|
||||
id: event.id.clone(),
|
||||
source: event.source,
|
||||
action: event.action.clone(),
|
||||
occurred_at: event.occurred_at,
|
||||
icon: TimelineIcon::Generic,
|
||||
title: vec![
|
||||
TitleSegment::text(format!("{} from ", event.action)),
|
||||
TitleSegment::text(event.source.as_str().to_string()),
|
||||
],
|
||||
subtitle: None,
|
||||
body: None,
|
||||
Source::Hg => hg::reshape(event),
|
||||
Source::Bugzilla => bugzilla::reshape(event),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user