Skip to main content

IntegrationPlugin

Trait IntegrationPlugin 

Source
pub trait IntegrationPlugin: Plugin {
    // Required methods
    fn push_issues(&mut self, issues: &[Issue]) -> PluginResult<Vec<SyncResult>>;
    fn pull_issues(&mut self) -> PluginResult<Vec<Issue>>;
    fn map_status_outbound(&self, status: &str) -> String;
    fn map_status_inbound(&self, external_status: &str) -> String;
    fn integration_info(&self) -> IntegrationInfo;

    // Provided methods
    fn resolve_conflict(
        &mut self,
        local: &Issue,
        remote: &Issue,
    ) -> PluginResult<ConflictResolution> { ... }
    fn handle_webhook(&mut self, _payload: &Value) -> PluginResult<Vec<Issue>> { ... }
    fn field_mappings(&self) -> FieldMappings { ... }
    fn validate_connection(&mut self) -> PluginResult<bool> { ... }
}
Expand description

Trait for plugins that sync with external issue trackers

Required Methods§

Source

fn push_issues(&mut self, issues: &[Issue]) -> PluginResult<Vec<SyncResult>>

Push issues to external system

Called periodically or on-demand to sync issues TO the external system. Returns list of sync results indicating what happened for each issue.

Source

fn pull_issues(&mut self) -> PluginResult<Vec<Issue>>

Pull issues from external system

Called to fetch issues FROM the external system. Returns issues that should be merged into local storage.

Source

fn map_status_outbound(&self, status: &str) -> String

Map local status to external status

Converts ProGit status (e.g., “in-progress”) to external system status (e.g., “In Progress” for Jira).

Source

fn map_status_inbound(&self, external_status: &str) -> String

Map external status to local status

Converts external system status to ProGit status.

Source

fn integration_info(&self) -> IntegrationInfo

Get integration metadata

Returns information about this integration for UI display and capability detection.

Provided Methods§

Source

fn resolve_conflict( &mut self, local: &Issue, remote: &Issue, ) -> PluginResult<ConflictResolution>

Resolve conflict between local and remote versions

Called when local and remote versions of an issue have diverged. Default implementation uses timestamp-based resolution (newer wins).

Source

fn handle_webhook(&mut self, _payload: &Value) -> PluginResult<Vec<Issue>>

Handle incoming webhook payload

Process a webhook from the external system. Returns issues that were affected by the webhook.

Source

fn field_mappings(&self) -> FieldMappings

Get field mappings configuration

Returns the current field mapping configuration for this integration.

Source

fn validate_connection(&mut self) -> PluginResult<bool>

Validate connection to external system

Tests that the integration can connect to the external system with the current configuration.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§