Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/Dependabot - Auto Approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Dependabot - Auto Approve

permissions: { }
on:
workflow_dispatch:
pull_request:
branches:
- 'main'

jobs:

ApproveDependabotPr:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
permissions:
id-token: write
pull-requests: write
steps:

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: ApproveDependabotPr
id: ApproveDependabotPr
run: dotnet run --project _atom/_atom.csproj ApproveDependabotPr --skip --headless
env:
azure-vault-app-secret: ${{ secrets.AZURE_VAULT_APP_SECRET }}
azure-vault-address: ${{ vars.AZURE_VAULT_ADDRESS }}
azure-vault-tenant-id: ${{ vars.AZURE_VAULT_TENANT_ID }}
azure-vault-app-id: ${{ vars.AZURE_VAULT_APP_ID }}
github-token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion DecSm.Atom.Module.AzureKeyVault/AzureKeySecretsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ private TokenCredential GetCredential(IAzureKeyVault definition)
{
string portString => int.TryParse(portString, out var parsedPort)
? parsedPort
: throw new InvalidOperationException($"Invalid port value for AzureVaultAuthPort: '{portString}'. Please provide a valid integer."),
: throw new InvalidOperationException(
$"Invalid port value for AzureVaultAuthPort: '{portString}'. Please provide a valid integer."),
int portInt => portInt,
_ => 0,
};
Expand Down
1 change: 0 additions & 1 deletion DecSm.Atom.Module.AzureStorage/IAzureArtifactStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/// enabling the build to both upload and download artifacts from Azure Blob Storage.
/// </remarks>
[ConfigureHostBuilder]

public partial interface IAzureArtifactStorage : IStoreArtifact, IRetrieveArtifact
{
/// <summary>
Expand Down
1 change: 0 additions & 1 deletion DecSm.Atom.Module.AzureStorage/_usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
global using Azure.Storage.Blobs;
global using Azure.Storage.Blobs.Models;
global using DecSm.Atom.Artifacts;
global using DecSm.Atom.Build.Definition;
global using DecSm.Atom.BuildInfo;
global using DecSm.Atom.Hosting;
global using DecSm.Atom.Params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public partial class DuplicateDependencyBuild : MinimalBuildDefinition, IDevopsW
];
}


[ConfigureHostBuilder]
public partial interface IDuplicateDependencyTarget : IStoreArtifact, IRetrieveArtifact
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ ILogger<GitVersionBuildVersionProvider> logger
/// <exception cref="InvalidOperationException">
/// Thrown if the version information cannot be determined from GitVersion's output.
/// </exception>
[field: AllowNull]
[field: MaybeNull]
public SemVer Version
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public partial class DuplicateDependencyBuild : MinimalBuildDefinition, IGithubW
];
}


[ConfigureHostBuilder]
public partial interface IDuplicateDependencyTarget : IStoreArtifact, IRetrieveArtifact
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace DecSm.Atom.Module.GithubWorkflows.Tests.Workflows;

[BuildDefinition]
public partial class SnapshotImageBuild : MinimalBuildDefinition, IGithubWorkflows, ICheckoutOptionTarget
public partial class SnapshotImageBuild : MinimalBuildDefinition, IGithubWorkflows, ISnapshotImageTarget
{
public override IReadOnlyList<WorkflowDefinition> Workflows =>
[
Expand All @@ -10,7 +10,7 @@ public partial class SnapshotImageBuild : MinimalBuildDefinition, IGithubWorkflo
Triggers = [ManualTrigger.Empty],
Targets =
[
WorkflowTargets.CheckoutOptionTarget.WithOptions(
WorkflowTargets.SnapshotImageTarget.WithOptions(
GithubSnapshotImageOption.Create(new("snapshot-image-test", "1.*.*"))),
],
WorkflowTypes = [new GithubWorkflowType()],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:

CheckoutOptionTarget:
SnapshotImageTarget:
runs-on: ubuntu-latest
snapshot:
image-name: snapshot-image-test
Expand All @@ -17,6 +17,6 @@ jobs:
with:
fetch-depth: 0

- name: CheckoutOptionTarget
id: CheckoutOptionTarget
run: dotnet run --project AtomTest/AtomTest.csproj CheckoutOptionTarget --skip --headless
- name: SnapshotImageTarget
id: SnapshotImageTarget
run: dotnet run --project AtomTest/AtomTest.csproj SnapshotImageTarget --skip --headless
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,9 @@ private void WriteStep(WorkflowModel workflow, WorkflowStepModel step, WorkflowJ
?.InformationalVersion ??
"",
out var semVer))
toolVersion = semVer;
toolVersion =
SemVer.Parse(
$"{semVer.Prefix}{(semVer.IsPreRelease ? $"-{semVer.PreRelease}" : string.Empty)}");
Comment thread
DecSmith42 marked this conversation as resolved.
else
throw new InvalidOperationException(
"Failed to parse DecSm.Atom.Host assembly version as SemVer for syncing atom tool version");
Expand All @@ -518,12 +520,9 @@ private void WriteStep(WorkflowModel workflow, WorkflowStepModel step, WorkflowJ
using (WriteSection("run: |"))
{
foreach (var feedToAdd in feedsToAdd)
if (syncAtomToolVersionToLibraryVersion)
WriteLine(
$"dotnet tool exec decsm.atom.tool@{toolVersion} -y -- nuget-add --name \"{feedToAdd.FeedName}\" --url \"{feedToAdd.FeedUrl}\"");
else
WriteLine(
$"dotnet tool exec decsm.atom.tool -y -- nuget-add --name \"{feedToAdd.FeedName}\" --url \"{feedToAdd.FeedUrl}\"");
WriteLine(syncAtomToolVersionToLibraryVersion
? $"dotnet tool exec decsm.atom.tool@{toolVersion} -y -- nuget-add --name \"{feedToAdd.FeedName}\" --url \"{feedToAdd.FeedUrl}\""
: $"dotnet tool exec decsm.atom.tool -y -- nuget-add --name \"{feedToAdd.FeedName}\" --url \"{feedToAdd.FeedUrl}\"");
}

WriteLine("shell: bash");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public sealed record GithubTokenPermissionsOption : IWorkflowOption
.Select(x => (x.Item1, x.Item2!))
.ToList();

private string? GetTokenPermissionString(GithubTokenPermission? permission) =>
private static string? GetTokenPermissionString(GithubTokenPermission? permission) =>
permission switch
{
GithubTokenPermission.None => "none",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ namespace DecSm.Atom.Module.GithubWorkflows.Generation.Options;
[PublicAPI]
public interface IGithubCustomStepOption : IWorkflowOption
{
bool IWorkflowOption.AllowMultiple => true;

GithubCustomStepOrder Order { get; }

int Priority { get; }

bool IWorkflowOption.AllowMultiple => true;

void WriteStep(GithubStepWriter writer);
}
3 changes: 0 additions & 3 deletions DecSm.Atom.SourceGenerators/Symbols.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ public static class Symbols
{
public const string BuildDefinitionAttribute = "DecSm.Atom.Build.Definition.BuildDefinitionAttribute";

public const string GeneratedBuildDefinitionAttribute =
"DecSm.Atom.Build.Definition.GeneratedBuildDefinitionAttribute";

public const string GenerateEntryPointAttribute = "DecSm.Atom.Hosting.GenerateEntryPointAttribute";

public const string GenerateInterfaceMembersAttribute =
Expand Down
2 changes: 1 addition & 1 deletion DecSm.Atom.Tests/BuildTests/Core/TestTargetAtomBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public partial class TestTargetAtomBuild : MinimalBuildDefinition, ITestTarget

public interface ITestTarget
{
string Description { get; set; }
string Description { get; }

Func<Task> Execute { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions DecSm.Atom.Tests/BuildTests/Params/OptionalParamBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public interface IOptionalParamTarget1 : IBuildAccessor
[ParamDefinition("param-2", "Param 2")]
string? Param2 => GetParam(() => Param2);

string? ExecuteValue1 { get; set; }
string? ExecuteValue1 { set; }

string? ExecuteValue2 { get; set; }
string? ExecuteValue2 { set; }

Target OptionalParamTarget1 =>
t => t
Expand Down
4 changes: 2 additions & 2 deletions DecSm.Atom.Tests/BuildTests/Params/ParamBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public interface IParamTarget1 : IBuildAccessor
[ParamDefinition("param-1", "Param 1")]
string Param1 => GetParam(() => Param1, "DefaultValue");

string? ExecuteValue { get; set; }
string? ExecuteValue { set; }

Target ParamTarget1 =>
t => t.Executes(() =>
Expand All @@ -27,7 +27,7 @@ public interface IParamTarget2 : IBuildAccessor
[ParamDefinition("param-2", "Param 2")]
string Param2 => GetParam(() => Param2)!;

string? ExecuteValue { get; set; }
string? ExecuteValue { set; }

Target ParamTarget2 =>
t => t
Expand Down
2 changes: 1 addition & 1 deletion DecSm.Atom.Tests/BuildTests/Secrets/UserSecretsBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public interface IUserSecretsTarget : IBuildAccessor
[SecretDefinition("secret-1", "Secret 1")]
string? Secret1 => GetParam(() => Secret1);

string? ExecutionValue { get; set; }
string? ExecutionValue { set; }

Target UserSecretsTarget =>
t => t
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public partial class CircularTargetDependencyBuild : MinimalBuildDefinition, ICi

public interface ICircularTarget1
{
bool CircularTarget1Executed { get; set; }
bool CircularTarget1Executed { set; }

Target CircularTarget1 =>
t => t
Expand All @@ -25,7 +25,7 @@ public interface ICircularTarget1

public interface ICircularTarget2
{
bool CircularTarget2Executed { get; set; }
bool CircularTarget2Executed { set; }

Target CircularTarget2 =>
t => t
Expand Down Expand Up @@ -53,7 +53,7 @@ public partial class CircularTargetDependencyBuild2 : MinimalBuildDefinition,

public interface ITestCircularTarget3
{
bool CircularTarget3Executed { get; set; }
bool CircularTarget3Executed { set; }

Target TestCircularTarget3 =>
t => t
Expand All @@ -68,7 +68,7 @@ public interface ITestCircularTarget3

public interface ITestCircularTarget4
{
bool CircularTarget4Executed { get; set; }
bool CircularTarget4Executed { set; }

Target TestCircularTarget4 =>
t => t
Expand All @@ -83,7 +83,7 @@ public interface ITestCircularTarget4

public interface ITestCircularTarget5
{
bool CircularTarget5Executed { get; set; }
bool CircularTarget5Executed { set; }

Target TestCircularTarget5 =>
t => t
Expand Down
8 changes: 4 additions & 4 deletions DecSm.Atom.Tests/BuildTests/Targets/DependencyTargetBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public partial class DependencyTargetBuild : MinimalBuildDefinition,

public interface IDependencyTarget1
{
bool DependencyTarget1Executed { get; set; }
bool DependencyTarget1Executed { set; }

Target DependencyTarget1 =>
t => t.Executes(() =>
Expand All @@ -31,7 +31,7 @@ public interface IDependencyTarget1

public interface IDependencyTarget2
{
bool DependencyTarget2Executed { get; set; }
bool DependencyTarget2Executed { set; }

Target DependencyTarget2 =>
t => t
Expand All @@ -46,7 +46,7 @@ public interface IDependencyTarget2

public interface IDependencyFailTarget1
{
bool DependencyFailTarget1Executed { get; set; }
bool DependencyFailTarget1Executed { set; }

Target DependencyFailTarget1 =>
t => t.Executes(() =>
Expand All @@ -59,7 +59,7 @@ public interface IDependencyFailTarget1

public interface IDependencyFailTarget2
{
bool DependencyFailTarget2Executed { get; set; }
bool DependencyFailTarget2Executed { set; }

Target DependencyFailTarget2 =>
t => t
Expand Down
4 changes: 2 additions & 2 deletions DecSm.Atom.Tests/BuildTests/Targets/ExtensionTargetBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public partial class ExtensionTargetBuild : MinimalBuildDefinition, IBaseExtensi

public interface IBaseExtensionTarget
{
bool BaseExtensionTargetExecuted { get; set; }
bool BaseExtensionTargetExecuted { set; }

Target BaseExtensionTarget =>
t => t.Executes(() =>
Expand All @@ -23,7 +23,7 @@ public interface IBaseExtensionTarget

public interface IExtendedExtensionTarget
{
bool ExtendedExtensionTargetExecuted { get; set; }
bool ExtendedExtensionTargetExecuted { set; }

Target ExtendedExtensionTarget =>
t => t
Expand Down
4 changes: 2 additions & 2 deletions DecSm.Atom.Tests/BuildTests/Targets/TargetOverrideBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public partial class TargetOverrideBuild : MinimalBuildDefinition, IOverrideTarg

public interface IBaseOverrideTarget
{
bool BaseOverrideTargetExecuted { get; set; }
bool BaseOverrideTargetExecuted { set; }

Target OverrideTarget =>
t => t.Executes(() =>
Expand All @@ -23,7 +23,7 @@ public interface IBaseOverrideTarget

public interface IOverrideTarget : IBaseOverrideTarget
{
bool OverrideOverrideTargetExecuted { get; set; }
bool OverrideOverrideTargetExecuted { set; }

new Target OverrideTarget =>
t => t.Executes(() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ public void Version_Returns_VersionInfo()
var version = provider.Version;

// Assert
version.ShouldSatisfyAllConditions(x => x.ShouldNotBeNull(),
x => x
version
.ShouldNotBeNull()
.ShouldSatisfyAllConditions(x => x
.ToString()
.ShouldBe("1.2.3"));
}
Expand Down
34 changes: 0 additions & 34 deletions DecSm.Atom.Tests/ClassTests/SemVerBuildNumberExtractionTests.cs

This file was deleted.

Loading
Loading