CtrlK
BlogDocsLog inGet started
Tessl Logo

finkel/jgit

JGit documentation and API reference with code examples

92

1.09x
Quality

Pending

Does it follow best practices?

Impact

92%

1.09x

Average score across 10 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

task.mdevals/scenario-3/

Git Remote Synchronization Service

Problem/Feature Description

Our deployment automation system needs to reliably synchronize with remote Git repositories across unreliable network connections. The current implementation uses simple Git commands that fail when network issues occur, causing deployment failures.

We need a Java service that can perform Git remote operations (fetch, pull, push) with robust error handling and retry logic. The service will be used in CI/CD pipelines running in cloud environments where network connectivity can be intermittent.

Requirements:

  • Fetch changes from a remote repository with configurable retry logic (exponential backoff)
  • Pull changes (fetch + merge) with conflict detection and handling
  • Push local changes to remote with retry on network failures
  • Support multiple remote configurations (HTTP, SSH, Git protocol)
  • Provide detailed status reporting for each operation
  • Handle authentication failures gracefully (prompt for credentials or fail cleanly)
  • Implement circuit breaker pattern to avoid overwhelming remote servers during outages
  • Thread-safe for concurrent operations on different repositories

The service should follow enterprise integration patterns for reliability and be suitable for inclusion in mission-critical deployment pipelines.

Output Specification

Create a Java class GitSynchronizer that provides the following:

  1. Constructor: Takes repository path and remote configuration
  2. fetchWithRetry(): Fetches from remote with configurable retry parameters
  3. pullWithRetry(): Pulls changes with merge and conflict handling
  4. pushWithRetry(): Pushes local changes to remote
  5. getSyncStatus(): Returns detailed status of last operation
  6. Support classes: For retry configuration, circuit breaker, status reporting

Include unit tests demonstrating retry behavior (can use mocks for network failures).

Expected output files:

  • GitSynchronizer.java - Main synchronization service
  • RetryConfig.java - Configuration for retry logic (max attempts, backoff, etc.)
  • CircuitBreaker.java - Circuit breaker implementation for remote operations
  • SyncStatus.java - Status reporting data structure
  • GitSynchronizerTest.java - Unit tests demonstrating retry behavior
  • build.gradle or pom.xml - Build configuration with JGit and testing dependencies
  • README.md - Documentation on configuration and usage

The solution should demonstrate production-ready error handling patterns and resilience strategies for network operations.

tile.json