Merged
Conversation
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.
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.
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
BuildResolverclass 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
GitVersionBuildIdProviderandGitVersionBuildVersionProviderto 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
BuildDefinitionorMinimalBuildDefinition, and updated code examples to reflect this requirement. [1] [2] [3]Minor Refactorings
DecSm.Atom.Pathsto_usings.csto support new file system operations.IValidateBuildinterface fromBuildDefinitionas part of codebase cleanup.