Skip to content

Dependabot auto approve & SemVer improvements#266

Merged
DecSmith42 merged 10 commits intomainfrom
development
Jan 15, 2026
Merged

Dependabot auto approve & SemVer improvements#266
DecSmith42 merged 10 commits intomainfrom
development

Conversation

@DecSmith42
Copy link
Owner

This pull request includes a variety of improvements and refactorings across the codebase, focusing on workflow automation, interface and property consistency, and minor code cleanups. The most notable changes are the introduction of an auto-approve workflow for Dependabot PRs, updates to workflow and test target interfaces to clarify property mutability, and several small code and documentation improvements.

Workflow Automation and Generation:

  • Added a new GitHub Actions workflow .github/workflows/Dependabot - Auto Approve.yml to automatically approve Dependabot pull requests targeting the main branch. This workflow checks out the repository, sets up .NET, and runs an approval command with appropriate secrets and variables.
  • Updated the SnapshotImageBuild workflow and its associated test to use the correct target interface and naming (ISnapshotImageTarget and SnapshotImageTarget), improving clarity and correctness in workflow definitions and verification. [1] [2] [3] [4]

Interface and Property Consistency:

  • Refactored various test interfaces to change properties from { get; set; } to { set; } or { get; } as appropriate, clarifying intended usage and mutability. This affects parameter, secret, and target execution properties across multiple test files. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]

Code Cleanup and Minor Refactoring:

  • Improved formatting and consistency in exception handling and method signatures, such as splitting long exception messages and marking helper methods as static. [1] [2]
  • Removed unused or redundant code, like the GeneratedBuildDefinitionAttribute constant from Symbols.cs.
  • Cleaned up using directives and whitespace in several files for better readability. [1] [2] [3] [4]

GitHub Workflow Step Improvements:

  • Adjusted the logic for parsing and formatting tool versions in workflow generation to ensure pre-release identifiers are handled correctly.
  • Simplified the conditional logic for writing NuGet feed addition steps in workflow scripts.

Other Minor Fixes:

  • Removed unnecessary or redundant nullable annotations from property definitions.
  • Reordered interface member declarations for clarity and consistency.

These changes collectively improve automation, code clarity, and maintainability across the project.

…logic

Converted `SemVer` from a class to a readonly struct to improve performance and immutability. Added new methods for parsing and TryParse with `ReadOnlySpan<char>` support. Improved null handling, default initialization, and error robustness. Updated related test cases for consistency.
Introduced a GitHub Actions workflow to automatically approve pull requests from Dependabot. Implemented the `IApproveDependabotPr` target to handle pull request validation, approval, and auto-merge via GitHub GraphQL API. Added new triggers for the workflow and integrated it into the build system.
Copilot AI review requested due to automatic review settings January 15, 2026 11:05
…onality

Renamed the `ApprovePr` target and related workflow jobs to `ApproveDependabotPr` for improved clarity and alignment with purpose. Modified GitHub token permissions from `Read` to `Write` to facilitate approval. Removed redundant review mutation logic from the `IApproveDependabotPr` target for better maintainability. Updated product header name in GraphQL connection to "Atom".
@DecSmith42 DecSmith42 enabled auto-merge January 15, 2026 11:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces automated Dependabot PR approval capabilities, along with SemVer improvements and various code quality enhancements. The changes refactor interfaces to clarify property mutability, consolidate test files, and improve code maintainability.

Changes:

  • Added automated Dependabot PR approval workflow with GitHub GraphQL API integration
  • Improved SemVer build number extraction with comprehensive test coverage
  • Fixed OverrideSourcesScope disposal logic to properly restore previous state
  • Refactored extension methods to use C# 13 extension syntax

Reviewed changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
_atom/_atom.csproj Added Octokit.GraphQL dependency for GitHub API interactions
_atom/Targets/IApproveDependabotPr.cs New target implementing automated Dependabot PR approval logic
_atom/Build.cs Registered new Dependabot auto-approval workflow
DecSm.Atom/Paths/AtomPaths.cs Converted to C# 13 extension syntax
DecSm.Atom/Paths/AtomFileSystem.cs Reordered field declarations
DecSm.Atom/Params/ParamService.cs Fixed OverrideSourcesScope disposal bug and reordered fields
DecSm.Atom/IValidateBuild.cs Added PublicAPI attribute
DecSm.Atom/Build/Definition/IBuildDefinition.cs Fixed XML comment formatting
DecSm.Atom.Tool/RunArgsFilter.cs Fixed operator precedence issue
DecSm.Atom.Tool/Commands/RunCommand.cs Simplified conditional logic
DecSm.Atom.Tool.Tests/_usings.cs Removed unused using directives
DecSm.Atom.Tool.Tests/RunCommandTests.cs Made helper method static and reordered fields
DecSm.Atom.Tests/ClassTests/SemVerTests.cs Consolidated build number extraction tests and added nullable handling
DecSm.Atom.Tests/ClassTests/SemVerBuildNumberExtractionTests.cs Removed duplicate test file
DecSm.Atom.Tests/ClassTests/Build/DefaultBuildVersionProviderTests.cs Improved assertion formatting
DecSm.Atom.Tests/BuildTests/Targets/*.cs Changed property accessors from { get; set; } to { set; } or { get; }
DecSm.Atom.SourceGenerators/Symbols.cs Removed unused constant
DecSm.Atom.Module.GithubWorkflows/Generation/Options/IGithubCustomStepOption.cs Reordered interface members
DecSm.Atom.Module.GithubWorkflows/Generation/Options/GithubTokenPermissionsOption.cs Made helper method static
DecSm.Atom.Module.GithubWorkflows/Generation/GithubWorkflowWriter.cs Fixed SemVer version formatting for pre-release versions and simplified conditional
DecSm.Atom.Module.GithubWorkflows.Tests/Workflows/WorkflowTests.SnapshotImageBuild_GeneratesWorkflow.verified.txt Updated verified workflow output to match interface rename
DecSm.Atom.Module.GithubWorkflows.Tests/Workflows/SnapshotImageBuild.cs Renamed interface from ICheckoutOptionTarget to ISnapshotImageTarget
DecSm.Atom.Module.GithubWorkflows.Tests/Workflows/DuplicateDependencyBuild.cs Removed blank line
DecSm.Atom.Module.GitVersion/GitVersionBuildVersionProvider.cs Removed redundant nullable annotations
DecSm.Atom.Module.DevopsWorkflows.Tests/Workflows/DuplicateDependencyBuild.cs Removed blank line
DecSm.Atom.Module.AzureStorage/_usings.cs Removed unused using directive
DecSm.Atom.Module.AzureStorage/IAzureArtifactStorage.cs Removed blank line
DecSm.Atom.Module.AzureKeyVault/AzureKeySecretsProvider.cs Improved exception message formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…te logic

Renamed the `PushToNuget` target and associated jobs to `PushToNugetDevops` for improved clarity and consistency within the DevOps pipeline. Updated related steps to include distinct download tasks for platform-specific artifacts. Adjusted invocation of the new target in `_atom.csproj` to align with the updated workflow.
Introduced `PublicApiSurfaceTests` to validate the assembly's public API surface. Implemented logic to collect and serialize public types and their members, ensuring API stability through JSON-based verification. Added the initial verified API representation file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant