e-gineering / gitflow-helper-maven-plugin

An extension and plugin that teaches Maven to work well with gitflow projects and CI servers.
Apache License 2.0
76 stars 21 forks source link

gitBranchExpression should override local git branch if provided #100

Open impulse-jprice opened 6 years ago

impulse-jprice commented 6 years ago

We were using gitBranchExpression to provide the git branch name via environment variables, intending to override the git branch name as can be detected via the git metadata on the filesystem. Since the addition of detecting the git branch name from the local git metadata was added the use of the environment variable seems to have been dropped.

This PR restores that behavior. Now if the environment variable resolves to some string that doesn't contain any additional replacement characters (${ }) it will be used, even if the local git metadata could provide a branch name. The actual git branch name will only be used if the gitBranchExpression is not provided, or doesn't fully resolve.

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 379


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/com/e_gineering/maven/gitflowhelper/ScmUtils.java 10 16 62.5%
<!-- Total: 10 16 62.5% -->
Files with Coverage Reduction New Missed Lines %
src/main/java/com/e_gineering/maven/gitflowhelper/PlexusLoggerToMavenLog.java 2 19.35%
src/main/java/com/e_gineering/maven/gitflowhelper/ScmUtils.java 5 30.97%
<!-- Total: 7 -->
Totals Coverage Status
Change from base Build 377: -1.1%
Covered Lines: 576
Relevant Lines: 799

💛 - Coveralls
bvarner commented 6 years ago

To clarify: This is a question of priority, correct?

You're wanting the environment variable to override whatever would be detected from the git metadata.

That seems reasonable. Any chance I can talk you into providing test cases to enforce this semantic?