-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gathering repo provider information #49
* Getting ownerName and repoName from clone URL. * Setting GitLab server and GitHub API from clone URL.
- Loading branch information
1 parent
3c0bf2f
commit dd84970
Showing
13 changed files
with
204 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#!/bin/bash | ||
cp src/main/resources/git-changelog-template.mustache changelog.mustache | ||
./gradlew clean build -i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
# Git Changelog changelog | ||
# Changelog | ||
|
||
Changelog of Git Changelog. | ||
Changelog for {{ownerName}} {{repoName}}. | ||
|
||
{{#tags}} | ||
## {{name}} | ||
{{#issues}} | ||
### {{name}} {{issue}} | ||
{{#authors}} | ||
* {{authorName}} | ||
{{#commits}} | ||
{{commitTime}} | ||
{{{message}}} | ||
{{#hasIssue}} | ||
{{#hasLink}} | ||
### {{name}} [{{issue}}]({{link}}) {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}} | ||
{{/hasLink}} | ||
{{^hasLink}} | ||
### {{name}} {{issue}} {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}} | ||
{{/hasLink}} | ||
{{/hasIssue}} | ||
{{^hasIssue}} | ||
### {{name}} | ||
{{/hasIssue}} | ||
|
||
{{/commits}} | ||
{{#commits}} | ||
**{{{messageTitle}}}** | ||
|
||
{{#messageBodyItems}} | ||
* {{.}} | ||
{{/messageBodyItems}} | ||
|
||
[{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}) {{authorName}} *{{commitTime}}* | ||
|
||
{{/commits}} | ||
|
||
{{/authors}} | ||
{{/issues}} | ||
{{/tags}} | ||
{{/tags}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/test/java/se/bjurr/gitchangelog/internal/git/GitRepoDataTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package se.bjurr.gitchangelog.internal.git; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import org.junit.Test; | ||
import se.bjurr.gitchangelog.internal.git.model.GitTag; | ||
|
||
public class GitRepoDataTest { | ||
|
||
public GitRepoData newGitRepoData(String originUrl) { | ||
List<GitTag> gitTags = new ArrayList<>(); | ||
return new GitRepoData(originUrl, gitTags); | ||
} | ||
|
||
@Test | ||
public void testGitHubRepo() { | ||
GitRepoData sut = newGitRepoData("git@github.com:tomasbjerre/git-changelog-lib.git"); | ||
|
||
assertThat(sut.findOwnerName().orNull()) // | ||
.isEqualTo("tomasbjerre"); | ||
assertThat(sut.findRepoName().orNull()) // | ||
.isEqualTo("git-changelog-lib"); | ||
|
||
assertThat(sut.findGitHubApi().orNull()) // | ||
.isEqualTo("https://api.github.com/repos/tomasbjerre/git-changelog-lib"); | ||
assertThat(sut.findGitLabServer().orNull()) // | ||
.isEqualTo(null); | ||
} | ||
|
||
@Test | ||
public void testGitBitbucketRepo() { | ||
GitRepoData sut = | ||
newGitRepoData("https://tomasbjerre@bitbucket.org/ljohansson/grunt-connect-apimock.git"); | ||
|
||
assertThat(sut.findOwnerName().orNull()) // | ||
.isEqualTo("ljohansson"); | ||
assertThat(sut.findRepoName().orNull()) // | ||
.isEqualTo("grunt-connect-apimock"); | ||
|
||
assertThat(sut.findGitHubApi().orNull()) // | ||
.isEqualTo(null); | ||
assertThat(sut.findGitLabServer().orNull()) // | ||
.isEqualTo(null); | ||
} | ||
|
||
@Test | ||
public void testGitLabRepo() { | ||
GitRepoData sut = newGitRepoData("http://root@gitlab.com/root/violations-test.git"); | ||
|
||
assertThat(sut.findOwnerName().orNull()) // | ||
.isEqualTo("root"); | ||
assertThat(sut.findRepoName().orNull()) // | ||
.isEqualTo("violations-test"); | ||
|
||
assertThat(sut.findGitHubApi().orNull()) // | ||
.isEqualTo(null); | ||
assertThat(sut.findGitLabServer().orNull()) // | ||
.isEqualTo("https://gitlab.com/"); | ||
} | ||
} |