Github Maven Plugin

Tooling for managing Kuali Git workflows

License

License

Categories

Categories

Maven Build Tools Git Development Tools Version Controls
GroupId

GroupId

org.kuali.maven.plugins
ArtifactId

ArtifactId

git-workflow-maven-plugin
Last Version

Last Version

0.0.9
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Github Maven Plugin
Tooling for managing Kuali Git workflows
Project Organization

Project Organization

The Kuali Foundation
Source Code Management

Source Code Management

https://github.com/kuali-student/git-workflow-maven-plugin

Download git-workflow-maven-plugin

How to add to project

<plugin>
    <groupId>org.kuali.maven.plugins</groupId>
    <artifactId>git-workflow-maven-plugin</artifactId>
    <version>0.0.9</version>
</plugin>

Dependencies

compile (9)

Group / Artifact Type Version
org.kuali.student.repository : repository-tools-common-git jar 0.0.4
org.kuali.common : kuali-core jar 1.0.9
org.kohsuke : github-api jar 1.58
commons-io : commons-io jar 2.4
org.kuali.common : kuali-util jar 4.4.16
net.rcarz : jira-client jar 0.5
org.apache.commons : commons-lang3 jar 3.2.1
org.slf4j : slf4j-api jar 1.7.5
org.slf4j : jcl-over-slf4j jar 1.7.5

provided (6)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.2
org.apache.maven : maven-plugin-api jar 3.0.4
org.apache.maven : maven-model jar 3.0.4
org.apache.maven : maven-core jar 3.0.4
org.apache.maven : maven-aether-provider jar 3.0.4
org.apache.maven : maven-compat jar 3.0.4

runtime (1)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.5

test (4)

Group / Artifact Type Version
org.kuali.student.repository : repository-tools-common-git test-jar 0.0.4
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 2.1
org.codehaus.plexus : plexus-container-default jar 1.5.5
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Git Workflow Maven Plugin

This plugin is not for the Git Flow model of git branching but rather a set of mojo's that are used to orchestrate the Kuali Student Git conversion.

For the Kuali Student conversion the https://github.com/kuali-student/pull-request-processing project was created to store the base plugin setup and associated helper scripts that would be called by the various Jenkins Build Steps.

Mojo's:

IdentifyPullRequestChangesThroughApiMojo

Identifies which top level module has changes and if there are sql changes.

Each module change will cause a properties file named target/$module-changes.dat to be created.

These will contain the PULL_REQUEST_NUMBER and the MODULE variables.

An sql change will cause a properties file named target/sql-changes.dat to be created.

CI can be configured to spawn downstream jobs based on the existense of these files.

ListOpenPullRequestsMojo

For each open pull request where the tip commit does not have completed or pending CI a file is created like:

open-pull-requests.x

Where x is the pull request number.

Within each file are two parameters:

  • PULL_REQUEST_NUMBER : the pull request number.
  • PULL_REQUEST_COMMIT_ID : the current commit id of the head of the pull request.

The existense of these files can be used to spawn downstream CI jobs to perform pull request processing.

FetchOpenPullRequestsMojo

These variables can be set using the -D operator: git-flow.sourceGithubUser git-flow.sourceGithubRepo git-flow.sourceGithubBranch

Checkout the latest commit on master:

git clone git://some-server.com/repo.git --depth 1 repo

cd repo

mvn org.kuali.maven.plugins.git-workflow-maven-plugin:0.0.9:fetchOpenPullRequests -e -Dgit-flow.sourceGithubUer=user -Dgit-flow.sourceGithubRepo=repo -Dgit-flow.sourceGithubBranch=master -N

This will pull down the pull request branch tips for the open applicable branches.

Applicable if the base branch of the pull request matches the git-flow.sourceGithubBranch string value.

PushGitReferenceMojo

JGit based Mojo that will push a specified refspec to a specified remote.

The credentials come from environment variables.

This mojo can be invoked in a Jenkins shell which will allow pushing a reference into github.

For example: https://github.com/kuali-student/pull-request-processing/blob/master/pull-request-builder/run-manual-impex-process.sh

GithubCommentsMojo

Proof of Concept to list the comments on a pull request.

GithubStatusMojo.java

Proof of Concept to add a pending build status and to list of existing statuses.

IdentifyChangesInGitMojo.java

Proof of concept to compare the file differences between two git tree's.

org.kuali.maven.plugins

Kuali Student

Versions

Version
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1