Skip to content

Commit da288b6

Browse files
committed
refactor(telemetry): simplify type references by removing redundant namespaces
Remove fully qualified names for build agent interfaces and assembly reflection types to improve code readability.
1 parent cfaf997 commit da288b6

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/GitVersion.App.Tests/TelemetryContextEnricherTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void SetEnvironmentVariable(string variableName, string? value)
6868
}
6969
}
7070

71-
private sealed class GitHubActions : GitVersion.Agents.ICurrentBuildAgent
71+
private sealed class GitHubActions : Agents.ICurrentBuildAgent
7272
{
7373
public bool IsDefault => false;
7474
public bool CanApplyToCurrentContext() => true;
@@ -80,7 +80,7 @@ public void WriteIntegration(Action<string?> writer, GitVersionVariables variabl
8080
}
8181
}
8282

83-
private sealed class LocalBuild : GitVersion.Agents.ICurrentBuildAgent
83+
private sealed class LocalBuild : Agents.ICurrentBuildAgent
8484
{
8585
public bool IsDefault => true;
8686
public bool CanApplyToCurrentContext() => true;
@@ -92,7 +92,7 @@ public void WriteIntegration(Action<string?> writer, GitVersionVariables variabl
9292
}
9393
}
9494

95-
private sealed class UnsupportedBuildAgent : GitVersion.Agents.ICurrentBuildAgent
95+
private sealed class UnsupportedBuildAgent : Agents.ICurrentBuildAgent
9696
{
9797
public bool IsDefault => false;
9898
public bool CanApplyToCurrentContext() => true;

src/GitVersion.App.Tests/TelemetryReporterTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using GitVersion.Core.Tests.Helpers;
1+
using GitVersion.Tests;
22

33
namespace GitVersion.App.Tests;
44

src/GitVersion.App/Telemetry/TelemetryReporting.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ internal interface ITelemetryContextEnricher
3737
internal sealed class AssemblyTelemetryReleaseDateProvider : ITelemetryReleaseDateProvider
3838
{
3939
public bool TryGetReleaseDate(out DateOnly releaseDate) =>
40-
TelemetryReleaseDate.TryGetReleaseDate(System.Reflection.Assembly.GetExecutingAssembly(), out releaseDate);
40+
TelemetryReleaseDate.TryGetReleaseDate(Assembly.GetExecutingAssembly(), out releaseDate);
4141
}
4242

4343
internal sealed class TelemetryUtcDateProvider : ITelemetryUtcDateProvider
@@ -54,9 +54,9 @@ public void Write(CommandLineTelemetry telemetry)
5454
}
5555
}
5656

57-
internal sealed class TelemetryContextEnricher(GitVersion.Agents.ICurrentBuildAgent currentBuildAgent, IEnvironment environment) : ITelemetryContextEnricher
57+
internal sealed class TelemetryContextEnricher(Agents.ICurrentBuildAgent currentBuildAgent, IEnvironment environment) : ITelemetryContextEnricher
5858
{
59-
private readonly GitVersion.Agents.ICurrentBuildAgent currentBuildAgent = currentBuildAgent.NotNull();
59+
private readonly Agents.ICurrentBuildAgent currentBuildAgent = currentBuildAgent.NotNull();
6060
private readonly IEnvironment environment = environment.NotNull();
6161

6262
public CommandLineTelemetry Enrich(CommandLineTelemetry telemetry)
@@ -70,7 +70,7 @@ public CommandLineTelemetry Enrich(CommandLineTelemetry telemetry)
7070
};
7171
}
7272

73-
private static string ResolveContinuousIntegrationProvider(GitVersion.Agents.ICurrentBuildAgent currentBuildAgent) => currentBuildAgent.GetType().Name switch
73+
private static string ResolveContinuousIntegrationProvider(Agents.ICurrentBuildAgent currentBuildAgent) => currentBuildAgent.GetType().Name switch
7474
{
7575
"AppVeyor" => "appveyor",
7676
"AzurePipelines" => "azure-pipelines",

0 commit comments

Comments
 (0)