Skip to content
Closed

vNext #274

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c00c3f1
fix(azure-storage): remove redundant cancellation token assignments
DecSmith42 Jan 22, 2026
8f845cf
feat(dependencies): add LibGit2Sharp package to _atom project
DecSmith42 Jan 22, 2026
ace29fe
feat(workflows): improve workflow options and update framework/versio…
DecSmith42 Jan 22, 2026
d316710
feat(dotnet): add Workflow Definition namespace to _usings.cs
DecSmith42 Jan 22, 2026
93d3d73
feat(workflows): refactor GitHub runner matrix and token injection logic
DecSmith42 Jan 22, 2026
5cbdeb1
feat(params): introduce EnvVarName property for parameter handling
DecSmith42 Jan 22, 2026
3f96e0c
feat(workflows): introduce and integrate `IWorkflowExpressionGenerator`
DecSmith42 Jan 22, 2026
0953152
refactor(workflows): simplify workflow option records and remove redu…
DecSmith42 Jan 22, 2026
82f69d7
refactor(expressions): remove legacy GitHub Actions expression defini…
DecSmith42 Jan 22, 2026
27c370e
refactor(workflows): streamline WithDevopsPoolMatrix implementation
DecSmith42 Jan 22, 2026
e3e1f54
feat(workflows): implement advanced expression handling and PR breaki…
DecSmith42 Jan 22, 2026
dec902b
feat(workflows): regenerate workflows
DecSmith42 Jan 22, 2026
c3081a5
refactor(workflows): re-order and update PR breaking change target logic
DecSmith42 Jan 22, 2026
6fd3ab0
fix(workflows): include workflow step options in environment injections
DecSmith42 Jan 22, 2026
f662d3d
fix(workflows): add pull request number to breaking change check
DecSmith42 Jan 22, 2026
17dc277
fix(targets): refine comment logic for breaking change detection
DecSmith42 Jan 22, 2026
520b29e
fix(targets): include additional file for breaking change detection
DecSmith42 Jan 22, 2026
d27b25a
fix(targets): enhance breaking change detection and PR review threads
DecSmith42 Jan 22, 2026
f562536
fix(targets): consolidate breaking change detection and refactor work…
DecSmith42 Jan 22, 2026
f8473dc
fix(workflows): add Azure Vault secrets and improve PR review logic
DecSmith42 Jan 22, 2026
1ecf334
fix(targets): improve repository variable formatting and file path ha…
DecSmith42 Jan 22, 2026
d78b27b
fix(targets): improve breaking change detection and PR review thread …
DecSmith42 Jan 22, 2026
b7754ec
fix(targets): refine formatting and breaking change path handling
DecSmith42 Jan 22, 2026
c0f9459
fix(targets): enhance breaking change detection with detailed analysis
DecSmith42 Jan 22, 2026
a210332
fix(targets): add detailed logging for change detection and refactor …
DecSmith42 Jan 22, 2026
35ab4c2
fix(targets): remove redundant check for suspicious changes
DecSmith42 Jan 22, 2026
1365ab7
refactor(targets): decouple setup build logic into new API surface he…
DecSmith42 Jan 22, 2026
033584a
fix(targets): add check run for breaking changes in PRs
DecSmith42 Jan 22, 2026
ba792c8
fix(workflows): add checks permission to GitHub actions
DecSmith42 Jan 22, 2026
b6a4d79
fix(targets): refine breaking change detection and PR review logic
DecSmith42 Jan 22, 2026
0006c6a
fix(targets): remove redundant logic for PR comments and simplify checks
DecSmith42 Jan 22, 2026
f83c487
fix(targets): improve breaking change detection and action messaging
DecSmith42 Jan 22, 2026
51dab8f
refactor(targets): relocate `FindLatestReleaseInfo` to `ICheckPrForBr…
DecSmith42 Jan 22, 2026
2f99c05
major: bump major version
DecSmith42 Jan 22, 2026
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
8 changes: 7 additions & 1 deletion .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:

SetupBuildInfo:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
pull-requests: write
outputs:
build-name: ${{ steps.SetupBuildInfo.outputs.build-name }}
build-id: ${{ steps.SetupBuildInfo.outputs.build-id }}
Expand All @@ -34,6 +38,8 @@ jobs:
- name: SetupBuildInfo
id: SetupBuildInfo
run: dotnet run --project _atom/_atom.csproj SetupBuildInfo --skip --headless
env:
pull-request-number: ${{ github.event.number }}

PackProjects:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -291,7 +297,7 @@ jobs:
PushToRelease:
needs: [ PackProjects, PackTool, TestProjects, SetupBuildInfo ]
runs-on: ubuntu-latest
if: contains(needs.SetupBuildInfo.outputs.build-version, '-') == false
if: !contains(needs.SetupBuildInfo.outputs.build-version, '-')
permissions:
contents: write
steps:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/Validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:

SetupBuildInfo:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
pull-requests: write
outputs:
build-name: ${{ steps.SetupBuildInfo.outputs.build-name }}
build-id: ${{ steps.SetupBuildInfo.outputs.build-id }}
Expand All @@ -29,6 +33,8 @@ jobs:
- name: SetupBuildInfo
id: SetupBuildInfo
run: dotnet run --project _atom/_atom.csproj SetupBuildInfo --skip --headless
env:
pull-request-number: ${{ github.event.number }}

PackProjects:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -133,3 +139,33 @@ jobs:
with:
name: DecSm.Atom.Tool.Tests-${{ matrix.job-runs-on }}-${{ matrix.test-framework }}
path: "${{ github.workspace }}/.github/publish/DecSm.Atom.Tool.Tests"

CheckPrForBreakingChanges:
needs: [ SetupBuildInfo ]
runs-on: ubuntu-latest
permissions:
checks: write
contents: write
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: CheckPrForBreakingChanges
id: CheckPrForBreakingChanges
run: dotnet run --project _atom/_atom.csproj CheckPrForBreakingChanges --skip --headless
env:
build-version: ${{ needs.SetupBuildInfo.outputs.build-version }}
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 }}
pull-request-number: ${{ github.event.number }}
29 changes: 20 additions & 9 deletions DecSm.Atom.Module.AzureKeyVault/AzureKeySecretsProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace DecSm.Atom.Module.AzureKeyVault;
using DecSm.Atom.Workflows.Options;

namespace DecSm.Atom.Module.AzureKeyVault;

/// <summary>
/// Provides an implementation of <see cref="ISecretsProvider" /> and <see cref="IWorkflowOptionProvider" />
Expand Down Expand Up @@ -83,12 +85,14 @@ public IReadOnlyList<IWorkflowOption> WorkflowOptions
{
case AzureKeyVaultValueInjectionType.EnvironmentVariable:
valueInjections.Add(
WorkflowSecretsEnvironmentInjection.Create(nameof(IAzureKeyVault.AzureVaultAddress)));
Workflows.Definition.Options.WorkflowOptions.Inject.SecretFromWorkflowEnvironment(
nameof(IAzureKeyVault.AzureVaultAddress)));

break;
case AzureKeyVaultValueInjectionType.Secret:
valueInjections.Add(
WorkflowSecretsSecretInjection.Create(nameof(IAzureKeyVault.AzureVaultAddress)));
Workflows.Definition.Options.WorkflowOptions.Inject.SecretForSecretProvider(
nameof(IAzureKeyVault.AzureVaultAddress)));

break;
case AzureKeyVaultValueInjectionType.None:
Expand All @@ -103,12 +107,14 @@ public IReadOnlyList<IWorkflowOption> WorkflowOptions
{
case AzureKeyVaultValueInjectionType.EnvironmentVariable:
valueInjections.Add(
WorkflowSecretsEnvironmentInjection.Create(nameof(IAzureKeyVault.AzureVaultTenantId)));
Workflows.Definition.Options.WorkflowOptions.Inject.SecretFromWorkflowEnvironment(
nameof(IAzureKeyVault.AzureVaultTenantId)));

break;
case AzureKeyVaultValueInjectionType.Secret:
valueInjections.Add(
WorkflowSecretsSecretInjection.Create(nameof(IAzureKeyVault.AzureVaultTenantId)));
Workflows.Definition.Options.WorkflowOptions.Inject.SecretForSecretProvider(
nameof(IAzureKeyVault.AzureVaultTenantId)));

break;
case AzureKeyVaultValueInjectionType.None:
Expand All @@ -123,11 +129,14 @@ public IReadOnlyList<IWorkflowOption> WorkflowOptions
{
case AzureKeyVaultValueInjectionType.EnvironmentVariable:
valueInjections.Add(
WorkflowSecretsEnvironmentInjection.Create(nameof(IAzureKeyVault.AzureVaultAppId)));
Workflows.Definition.Options.WorkflowOptions.Inject.SecretFromWorkflowEnvironment(
nameof(IAzureKeyVault.AzureVaultAppId)));

break;
case AzureKeyVaultValueInjectionType.Secret:
valueInjections.Add(WorkflowSecretsSecretInjection.Create(nameof(IAzureKeyVault.AzureVaultAppId)));
valueInjections.Add(
Workflows.Definition.Options.WorkflowOptions.Inject.SecretForSecretProvider(
nameof(IAzureKeyVault.AzureVaultAppId)));

break;
case AzureKeyVaultValueInjectionType.None:
Expand All @@ -142,12 +151,14 @@ public IReadOnlyList<IWorkflowOption> WorkflowOptions
{
case AzureKeyVaultValueInjectionType.EnvironmentVariable:
valueInjections.Add(
WorkflowSecretsEnvironmentInjection.Create(nameof(IAzureKeyVault.AzureVaultAppSecret)));
Workflows.Definition.Options.WorkflowOptions.Inject.SecretFromWorkflowEnvironment(
nameof(IAzureKeyVault.AzureVaultAppSecret)));

break;
case AzureKeyVaultValueInjectionType.Secret:
valueInjections.Add(
WorkflowSecretsSecretInjection.Create(nameof(IAzureKeyVault.AzureVaultAppSecret)));
Workflows.Definition.Options.WorkflowOptions.Inject.SecretForSecretProvider(
nameof(IAzureKeyVault.AzureVaultAppSecret)));

break;
case AzureKeyVaultValueInjectionType.None:
Expand Down
30 changes: 30 additions & 0 deletions DecSm.Atom.Module.AzureKeyVault/WorkflowOptionsExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
namespace DecSm.Atom.Module.AzureKeyVault;

[PublicAPI]
[SuppressMessage("Performance", "CA1822:Mark members as static")]
public static class WorkflowOptionsExtensions
{
[PublicAPI]
public class Options
{
internal static Options Instance { get; } = new();

public UseAzureKeyVault Use =>
new()
{
Value = true,
};

public UseAzureKeyVault DoNotUse =>
new()
{
Value = false,
};
}

extension(WorkflowOptions)
{
[PublicAPI]
public static Options AzureKeyVault => Options.Instance;
}
}
3 changes: 2 additions & 1 deletion DecSm.Atom.Module.AzureKeyVault/_usings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
global using Azure.Core;
global using System.Diagnostics.CodeAnalysis;
global using Azure.Core;
global using Azure.Identity;
global using Azure.Security.KeyVault.Secrets;
global using DecSm.Atom.Args;
Expand Down
6 changes: 3 additions & 3 deletions DecSm.Atom.Module.AzureStorage/AzureBlobArtifactProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public async Task RetrieveArtifacts(
{
Prefix = artifactBlobDir,
},
cancellationToken: cancellationToken);
cancellationToken);

await foreach (var blobItem in blobs)
{
Expand Down Expand Up @@ -272,7 +272,7 @@ public async Task Cleanup(IReadOnlyList<string> runIdentifiers, CancellationToke
{
Prefix = $"{buildName}/{buildIdPath}/",
},
cancellationToken: cancellationToken);
cancellationToken);

await foreach (var blob in blobs)
{
Expand Down Expand Up @@ -324,7 +324,7 @@ public async Task<IReadOnlyList<string>> GetStoredRunIdentifiers(
{
Prefix = $"{buildName}/",
},
cancellationToken: cancellationToken);
cancellationToken);

var buildIds = new List<string>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public partial class CustomArtifactBuild : MinimalBuildDefinition,
}),
],
WorkflowTypes = [Devops.WorkflowType],
Options = [UseCustomArtifactProvider.Enabled],
Options = [WorkflowOptions.Artifacts.UseCustomProvider],
},
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ public partial class CheckoutOptionBuild : MinimalBuildDefinition, IDevopsWorkfl
[
new("checkoutoption-workflow")
{
Triggers = [ManualTrigger.Empty],
Triggers = [WorkflowTriggers.Manual],
Targets =
[
WorkflowTargets.CheckoutOptionTarget.WithOptions(
DevopsCheckoutOption.Create(new(true, "recursive"))),
WorkflowOptions.Devops.ConfigureCheckout(true, "recursive")),
],
WorkflowTypes = [Devops.WorkflowType],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
[BuildDefinition]
public partial class DuplicateDependencyBuild : MinimalBuildDefinition, IDevopsWorkflows, IDuplicateDependencyTarget
{
public override IReadOnlyList<IWorkflowOption> GlobalWorkflowOptions => [UseCustomArtifactProvider.Enabled];
public override IReadOnlyList<IWorkflowOption> GlobalWorkflowOptions =>
[
WorkflowOptions.Artifacts.UseCustomProvider,
];

public override IReadOnlyList<WorkflowDefinition> Workflows =>
[
new("duplicatedependency-workflow")
{
Triggers = [ManualTrigger.Empty],
Triggers = [WorkflowTriggers.Manual],
Targets = [WorkflowTargets.DuplicateDependencyTarget1],
WorkflowTypes = [Devops.WorkflowType],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ public partial class EnvironmentBuild : MinimalBuildDefinition, IDevopsWorkflows
[
new("environment-workflow")
{
Triggers = [ManualTrigger.Empty],
Targets = [WorkflowTargets.EnvironmentTarget.WithOptions(DeployToEnvironment.Create("test-env-1"))],
Triggers = [WorkflowTriggers.Manual],
Targets =
[
WorkflowTargets.EnvironmentTarget.WithOptions(WorkflowOptions.Deploy.ToEnvironment("test-env-1")),
],
WorkflowTypes = [Devops.WorkflowType],
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ public partial class ManualInputBuild : MinimalBuildDefinition, IDevopsWorkflows
{
Inputs =
[
ManualStringInput.ForParam(ParamDefinitions[Params.StringParamWithoutDefault]),
ManualStringInput.ForParam(ParamDefinitions[Params.StringParamWithDefault]),
ManualBoolInput.ForParam(ParamDefinitions[Params.BoolParamWithoutDefault]),
ManualBoolInput.ForParam(ParamDefinitions[Params.BoolParamWithDefault]),
ManualChoiceInput.ForParam(ParamDefinitions[Params.ChoiceParamWithoutDefault],
ManualStringInput.ForParam(ParamDefinitions[WorkflowParams.StringParamWithoutDefault]),
ManualStringInput.ForParam(ParamDefinitions[WorkflowParams.StringParamWithDefault]),
ManualBoolInput.ForParam(ParamDefinitions[WorkflowParams.BoolParamWithoutDefault]),
ManualBoolInput.ForParam(ParamDefinitions[WorkflowParams.BoolParamWithDefault]),
ManualChoiceInput.ForParam(ParamDefinitions[WorkflowParams.ChoiceParamWithoutDefault],
["choice 1", "choice 2", "choice 3"]),
ManualChoiceInput.ForParam(ParamDefinitions[Params.ChoiceParamWithDefault],
ManualChoiceInput.ForParam(ParamDefinitions[WorkflowParams.ChoiceParamWithDefault],
["choice 1", "choice 2", "choice 3"]),
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public partial class SetupDotnetBuild : MinimalBuildDefinition, IDevopsWorkflows
[
new("setup-dotnet")
{
Triggers = [GitPushTrigger.ToMain],
Triggers = [WorkflowTriggers.PushToMain],
Targets = [WorkflowTargets.SetupDotnetTarget.WithOptions(new SetupDotnetStep("9.0.x"))],
WorkflowTypes = [Devops.WorkflowType],
},
Expand Down
23 changes: 0 additions & 23 deletions DecSm.Atom.Module.DevopsWorkflows/DevopsCheckoutOption.cs

This file was deleted.

40 changes: 20 additions & 20 deletions DecSm.Atom.Module.DevopsWorkflows/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
[PublicAPI]
public static class Extensions
{
/// <summary>
/// Configures the workflow target to run on a matrix of Azure DevOps agent pool labels.
/// </summary>
/// <param name="workflowTargetDefinition">The workflow target definition to extend.</param>
/// <param name="labels">An array of agent pool labels (e.g., "ubuntu-latest", "windows-latest").</param>
/// <returns>The modified <see cref="WorkflowTargetDefinition" /> for chaining.</returns>
/// <remarks>
/// This method sets up a matrix dimension for the `JobRunsOn` parameter, allowing the job
/// to execute on multiple agent pool environments. It also adds the <see cref="DevopsPool.SetByMatrix" />
/// option to indicate that the agent pool is determined by the matrix.
/// </remarks>
public static WorkflowTargetDefinition WithDevopsPoolMatrix(
this WorkflowTargetDefinition workflowTargetDefinition,
string[] labels) =>
workflowTargetDefinition
.WithMatrixDimensions(new MatrixDimension(nameof(IJobRunsOn.JobRunsOn))
{
Values = labels,
})
.WithOptions(DevopsPool.SetByMatrix);
extension(WorkflowTargetDefinition workflowTargetDefinition)
{
/// <summary>
/// Configures the workflow target to run on a matrix of Azure DevOps agent pool labels.
/// </summary>
/// <param name="labels">An array of agent pool labels (e.g., "ubuntu-latest", "windows-latest").</param>
/// <returns>The modified <see cref="WorkflowTargetDefinition" /> for chaining.</returns>
/// <remarks>
/// This method sets up a matrix dimension for the `JobRunsOn` parameter, allowing the job
/// to execute on multiple agent pool environments. It also adds the SetByMatrix options ( "$(job-runs-on)" )
/// option to indicate that the agent pool is determined by the matrix.
/// </remarks>
public WorkflowTargetDefinition WithDevopsPoolMatrix(string[] labels) =>
workflowTargetDefinition
.WithMatrixDimensions(new MatrixDimension(nameof(IJobRunsOn.JobRunsOn))
{
Values = labels,
})
.WithOptions(WorkflowOptions.Devops.DevopsPool.SetByMatrix);
}
}
Loading
Loading