-
Notifications
You must be signed in to change notification settings - Fork 315
Add commit discrepancies telemetry when building repository git information #8763
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
daniel-mohedano
merged 8 commits into
master
from
daniel.mohedano/sha-discrepancies-telemetry
May 8, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6ae2190
add sha discrepancies telemetry
daniel-mohedano b905387
unified naming and simplified git provider tag implementation
daniel-mohedano 13576ac
spotless
daniel-mohedano 8a4f723
reverted back to separate tag enums for git providers
daniel-mohedano 50c743c
Merge branch 'master' into daniel.mohedano/sha-discrepancies-telemetry
daniel-mohedano a05859b
pr suggestions
daniel-mohedano 967decc
sha discrepancy detection unit tests
daniel-mohedano 0a4cc59
Merge branch 'master' into daniel.mohedano/sha-discrepancies-telemetry
daniel-mohedano 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
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
16 changes: 16 additions & 0 deletions
16
...api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/GitProviderDiscrepant.java
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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package datadog.trace.api.civisibility.telemetry.tag; | ||
|
|
||
| import datadog.trace.api.civisibility.telemetry.TagValue; | ||
|
|
||
| public enum GitProviderDiscrepant implements TagValue { | ||
| USER_SUPPLIED, | ||
| CI_PROVIDER, | ||
| LOCAL_GIT, | ||
| GIT_CLIENT, | ||
| EMBEDDED; | ||
|
|
||
| @Override | ||
| public String asString() { | ||
| return "discrepant_provider:" + name().toLowerCase(); | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
...l-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/GitProviderExpected.java
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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package datadog.trace.api.civisibility.telemetry.tag; | ||
|
|
||
| import datadog.trace.api.civisibility.telemetry.TagValue; | ||
|
|
||
| public enum GitProviderExpected implements TagValue { | ||
| USER_SUPPLIED, | ||
| CI_PROVIDER, | ||
| LOCAL_GIT, | ||
| GIT_CLIENT, | ||
| EMBEDDED; | ||
|
|
||
| @Override | ||
| public String asString() { | ||
| return "expected_provider:" + name().toLowerCase(); | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
...api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/GitShaDiscrepancyType.java
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 |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package datadog.trace.api.civisibility.telemetry.tag; | ||
|
|
||
| import datadog.trace.api.civisibility.telemetry.TagValue; | ||
|
|
||
| public enum GitShaDiscrepancyType implements TagValue { | ||
| REPOSITORY_DISCREPANCY, | ||
| COMMIT_DISCREPANCY; | ||
|
|
||
| @Override | ||
| public String asString() { | ||
| return "type:" + name().toLowerCase(); | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/GitShaMatch.java
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 |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package datadog.trace.api.civisibility.telemetry.tag; | ||
|
|
||
| import datadog.trace.api.civisibility.telemetry.TagValue; | ||
|
|
||
| public enum GitShaMatch implements TagValue { | ||
| TRUE, | ||
| FALSE; | ||
|
|
||
| @Override | ||
| public String asString() { | ||
| return "matched:" + name().toLowerCase(); | ||
| } | ||
| } |
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
11 changes: 11 additions & 0 deletions
11
internal-api/src/main/java/datadog/trace/api/git/GitInfoBuilder.java
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 |
|---|---|---|
| @@ -1,9 +1,20 @@ | ||
| package datadog.trace.api.git; | ||
|
|
||
| import datadog.trace.api.civisibility.telemetry.tag.GitProviderDiscrepant; | ||
| import datadog.trace.api.civisibility.telemetry.tag.GitProviderExpected; | ||
| import javax.annotation.Nullable; | ||
|
|
||
| public interface GitInfoBuilder { | ||
| GitInfo build(@Nullable String repositoryPath); | ||
|
|
||
| int order(); | ||
|
|
||
| /** | ||
| * Used for SHA discrepancies telemetry. Two enums are needed, one for each tag: | ||
| * `expected_provider`, `discrepant_provider`. A provider can act as either of them depending on | ||
| * the discrepancy found. | ||
| */ | ||
| GitProviderExpected providerAsExpected(); | ||
|
|
||
| GitProviderDiscrepant providerAsDiscrepant(); | ||
| } | ||
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
Oops, something went wrong.
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.
Let's add a brief comment explaining why two different enums are needed