pub enum TicketChange {
Priority {
old: String,
new: String,
},
Status {
old: String,
new: String,
},
Assignee {
old: String,
new: String,
},
Version {
old: String,
new: String,
},
DoneRatio {
old: String,
new: String,
},
}Expand description
Represents a single field change detected between two versions of a LinkedTicket.
§Design
This enum is the only place in the codebase where “which fields are trackable”
is declared. Adding a new tracked field (e.g. Sprint, DoneRatio) only requires:
- Adding a variant here.
- Adding a match arm in
LinkedTicket::diff. - Handling the new variant in the orchestrator’s notification dispatch.
The orchestrator (gitlab-tracker) and notification plugin (gitlab-tracker-notify)
never need to know about field names directly — they only receive TicketChange values.
This satisfies OCP: providers (Redmine, Jira, …) and consumers (app, notify) are
decoupled from the field enumeration.
Variants§
Priority
The priority label changed (e.g. “Normal” → “High”).
Status
The status label changed (e.g. “In Progress” → “Resolved”).
Assignee
The assignee changed (e.g. “Alice” → “Bob”, or “Unassigned” when empty).
Version
The target version/release changed (e.g. “v1.2” → “v1.3”, or “None” when unset).
DoneRatio
The completion percentage changed (0–100). Fires on both increase and decrease.
old and new are formatted as "N%" strings for display consistency.
Implementations§
Source§impl TicketChange
impl TicketChange
Sourcepub fn field_label(&self) -> &'static str
pub fn field_label(&self) -> &'static str
Returns a human-readable label for the changed field, suitable for notification summaries.
Sourcepub fn before_after(&self) -> (&str, &str)
pub fn before_after(&self) -> (&str, &str)
Returns the before/after values as (&str, &str) for display purposes.
Trait Implementations§
Source§impl Clone for TicketChange
impl Clone for TicketChange
Source§fn clone(&self) -> TicketChange
fn clone(&self) -> TicketChange
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more