Skip to content

opendatamesh-initiative/git-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git Utils

Git utilities: a Java library providing a unified abstraction over Git hosting providers ( GitHub, GitLab, Bitbucket, Azure DevOps) and optional REST client helpers.

Overview

This library is part of the Open Data Mesh Platform. It offers:

  • Git provider abstraction — A single GitProvider interface implemented for GitHub, GitLab, Bitbucket, and Azure DevOps, with operations for users, organizations, repositories, commits, branches, and tags.
  • Low-level Git operations — Clone, init, add, commit, push, tag, and resolve HEAD via a GitOperation facade ( JGit-based).
  • REST client utilities — Optional helpers for HTTP calls and pagination (org.opendatamesh.platform.git.client).

Consuming applications (e.g. the ODM Platform Registry) implement their own factory to create provider instances (using their own provider-type enum and credentials).

Prerequisites

  • Java 21 or higher
  • Maven 3.6 or higher

Building the Project

# Clone the repository
git clone https://github.com/opendatamesh-initiative/git-utils.git

# Navigate to project directory
cd git-utils

# Build the project
mvn clean install

# Run tests
mvn verify

Usage

Maven dependency

Add the library to your project:

<dependency>
    <groupId>org.opendatamesh</groupId>
    <artifactId>git-utils</artifactId>
    <version>1.0.0</version>
</dependency>

Repository configuration

If the artifact is published to GitHub Packages, add the repository (and matching server in ~/.m2/settings.xml with GITHUB_TOKEN):

<repositories>
    <repository>
        <id>odm-git-utils-repo</id>
        <name>GitHub Packages for ODM Platform Git Utils</name>
        <url>https://maven.pkg.github.com/opendatamesh-initiative/git-utils</url>
    </repository>
</repositories>

Package Structure

  • org.opendatamesh.platform.git.providerGitProvider interface, GitProviderIdentifier, and implementations ( GitHub, GitLab, Bitbucket, Azure DevOps).
  • org.opendatamesh.platform.git.model — Shared models (Repository, Branch, Commit, Tag, User, Organization, RepositoryPointer, etc.).
  • org.opendatamesh.platform.git.git — Low-level Git operations (GitOperation, GitOperationImpl) and credential types.
  • org.opendatamesh.platform.git.exceptionsGitException, GitOperationException, GitClientException, GitProviderAuthenticationException, GitProviderConfigurationException.
  • org.opendatamesh.platform.git.client — Optional REST client utilities and exceptions.

Architecture

For detailed design, extension points, and how-to guides (extending resources, custom resources, adding a provider), see:

Git Handler Architecture

Testing

Run the test suite:

# Run all tests
mvn test

# Full verify (tests + any checks)
mvn verify

Unit tests for each provider (GitHub, GitLab, Bitbucket, Azure) and for GitOperationImpl are under src/test/java/org/opendatamesh/platform/git/, with JSON fixtures in src/test/resources/.

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the Apache License 2.0 — see the LICENSE file for details.

Support

For support, please open an issue in the GitHub repository.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages