-
Notifications
You must be signed in to change notification settings - Fork 323
Extract git tags from embedded git.properties and datadog_git.properties #8561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
341e015
Extract git tags from embedded git.properties and datadog_git.properties
wmouchere f440bd3
Prioritize datadog_git.properties even in spring boot context
wmouchere b3bf09b
Add test for ordering
wmouchere d63f220
PR review: inline constants
wmouchere a16f0d6
Merge branch 'master' into william.mouchere/embedded-gitinfo-spring
mcculls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ class EmbeddedGitInfoBuilderTest extends Specification { | |
|
|
||
| def "test no embedded git info"() { | ||
| when: | ||
| def gitInfo = new EmbeddedGitInfoBuilder("non-existent-git.properties").build(null) | ||
| def gitInfo = new EmbeddedGitInfoBuilder(["non-existent-git.properties"]).build(null) | ||
|
|
||
| then: | ||
| gitInfo.isEmpty() | ||
|
|
@@ -16,7 +16,7 @@ class EmbeddedGitInfoBuilderTest extends Specification { | |
| def "test maven-plugin-generated git info"() { | ||
| when: | ||
| def mavenGitProperties = "datadog/trace/bootstrap/git/maven-git.properties" | ||
| def gitInfo = new EmbeddedGitInfoBuilder(mavenGitProperties).build(null) | ||
| def gitInfo = new EmbeddedGitInfoBuilder([mavenGitProperties]).build(null) | ||
|
|
||
| then: | ||
| gitInfo.repositoryURL == "[email protected]:DataDog/ciapp-test-resources.git" | ||
|
|
@@ -35,7 +35,7 @@ class EmbeddedGitInfoBuilderTest extends Specification { | |
| def "test gradle-plugin-generated git info"() { | ||
| when: | ||
| def gradleGitProperties = "datadog/trace/bootstrap/git/gradle-git.properties" | ||
| def gitInfo = new EmbeddedGitInfoBuilder(gradleGitProperties).build(null) | ||
| def gitInfo = new EmbeddedGitInfoBuilder([gradleGitProperties]).build(null) | ||
|
|
||
| then: | ||
| gitInfo.repositoryURL == "[email protected]:DataDog/ciapp-test-resources.git" | ||
|
|
@@ -50,4 +50,13 @@ class EmbeddedGitInfoBuilderTest extends Specification { | |
| gitInfo.commit.committer.email == "[email protected]" | ||
| gitInfo.commit.committer.iso8601Date == "2023-03-22T14:43:21+0100" | ||
| } | ||
|
|
||
| def "test embedded gitinfo has a lower priority than user supplied gitinfo"() { | ||
| when: | ||
| def embeddedGitInfoBuilder = new EmbeddedGitInfoBuilder() | ||
| def userSuppliedGitInfoBuilder = new UserSuppliedGitInfoBuilder() | ||
|
|
||
| then: | ||
| embeddedGitInfoBuilder.order() > userSuppliedGitInfoBuilder.order() | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if the constants were inline right here, along with useful comments and ordering, it would be easier to read and maintain. WDYT?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree 👍