Skip to content

Improvements#251

Merged
DecSmith42 merged 9 commits intomainfrom
improvement/startup
Dec 16, 2025
Merged

Improvements#251
DecSmith42 merged 9 commits intomainfrom
improvement/startup

Conversation

@DecSmith42
Copy link
Owner

This pull request introduces several improvements and refactorings to the build automation framework, focusing on enhanced performance, better diagnostics, improved caching for GitVersion operations, and clearer documentation and examples. The most significant changes are grouped below.

Build Performance and Diagnostics

  • Added a logger parameter to the BuildResolver class and its usages, and now log the duration of the build resolution process at debug level for better diagnostics. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

GitVersion Caching and Logging

  • Enhanced both GitVersionBuildIdProvider and GitVersionBuildVersionProvider to cache GitVersion output per commit hash, reducing redundant tool invocations. Added error handling and logging for cache read/parse failures, and ensured cache directory creation. [1] [2] [3] [4]

Documentation and Example Improvements

  • Updated the README with new badges (CodeQL, dependency submission), and improved the basic example for clarity, including explicit instructions and updated code to match current best practices. [1] [2]
  • Clarified in documentation that users must explicitly inherit from BuildDefinition or MinimalBuildDefinition, and updated code examples to reflect this requirement. [1] [2] [3]
  • Updated references to workflow targets in documentation for accuracy. [1] [2]

Minor Refactorings

  • Added a missing global using for DecSm.Atom.Paths to _usings.cs to support new file system operations.
  • Removed the IValidateBuild interface from BuildDefinition as part of codebase cleanup.

Added `ILogger<BuildResolver>` to enable logging of the build resolution duration for enhanced diagnostics. The resolution process now logs the time taken if debug logging is enabled. This improvement aids in monitoring performance and troubleshooting.
Introduced caching for GitVersion outputs to reduce redundant executions using `.gitversioncache`. Leveraged `IAtomFileSystem` for cache handling and improved logging via `ILogger` in both `GitVersionBuildIdProvider` and `GitVersionBuildVersionProvider`. This reduces overhead and provides better diagnostics for cache-related issues.
Added `ILogger<BuildResolver>` to `BuildResolverTests` to align with recent updates that enhance diagnostics. This ensures logger integration is tested across various scenarios, improving coverage and maintainability.
Removed the `IValidateBuild` interface from `BuildDefinition` as it is no longer in use. This simplifies the build definition hierarchy, reducing redundant dependencies.
Updated the `README.md` file to include additional badges for CodeQL and Automatic Dependency Submission workflows. Enhanced the basic example with clearer instructions, modernized syntax, and updated commands for running the build script.
Copilot AI review requested due to automatic review settings December 16, 2025 14:08
Enhanced logging for `GitVersionBuildIdProvider` and `GitVersionBuildVersionProvider` by introducing `InvocationLogLevel` set to `LogLevel.Debug` in `git rev-parse HEAD` process execution. This improvement aids in diagnosing issues by providing detailed command invocation details.
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 pull request introduces several improvements to the build automation framework, focusing on performance diagnostics, GitVersion caching, and documentation clarity. The changes span build resolution logging, caching mechanisms for GitVersion operations, and comprehensive updates to documentation examples.

Key Changes:

  • Added diagnostic logging to BuildResolver to track resolution duration
  • Implemented caching for GitVersion operations to avoid redundant tool invocations
  • Updated documentation to clarify build definition inheritance requirements and standardize workflow target references

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
DecSm.Atom/Build/BuildResolver.cs Added logger parameter and timing diagnostics for build resolution
DecSm.Atom.Tests/ClassTests/Build/BuildResolverTests.cs Updated all test cases to include the new logger parameter
DecSm.Atom.Module.GitVersion/GitVersionBuildIdProvider.cs Added caching logic based on git commit hash, error handling for cache failures
DecSm.Atom.Module.GitVersion/GitVersionBuildVersionProvider.cs Added caching logic for version information (missing cache write operation)
DecSm.Atom.Module.GitVersion/_usings.cs Added global using for DecSm.Atom.Paths to support file system operations
DecSm.Atom/Build/Definition/BuildDefinition.cs Removed IValidateBuild interface from inheritance list
README.md Added new status badges and updated basic example with explicit inheritance and modern syntax
docs/getting-started.md Clarified build definition must inherit from BuildDefinition, updated target references
docs/build-definitions.md Documented explicit inheritance requirement from BuildDefinition or MinimalBuildDefinition
docs/parameters.md Updated to mention parameters can be defined in build class or interfaces
docs/targets.md Clarified targets can be defined in build class or interfaces
docs/workflows.md Updated all target references from Targets.* to WorkflowTargets.*
docs/common-targets.md Updated target references from Targets.* to WorkflowTargets.*
docs/modules/github-workflows.md Modernized all examples to use current WorkflowDefinition syntax and WorkflowTargets
docs/modules/devops-workflows.md Modernized all examples to use current WorkflowDefinition syntax and WorkflowTargets

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

Applied locks around file operations and GitVersion process execution in `GitVersionBuildIdProvider` and `GitVersionBuildVersionProvider` to ensure thread safety. Updated locking mechanism to use `Lock` for `NET9_0_OR_GREATER` and `object` for other frameworks.
@DecSmith42 DecSmith42 enabled auto-merge December 16, 2025 14:28
@DecSmith42 DecSmith42 merged commit 3fe5114 into main Dec 16, 2025
31 of 33 checks passed
@DecSmith42 DecSmith42 deleted the improvement/startup branch December 16, 2025 14:30
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.

2 participants