Add Dockerfile versioning support, upgrade to .NET 10, and harden path/config handling - #20
Merged
Merged
Conversation
…en path/config handling Adds native support for versioning Dockerfiles via a `LABEL org.opencontainers.image.version` tag, alongside the existing .csproj/.nuspec support, through a new pluggable IProjectFileHandler architecture (CsprojNuspecFileHandler, DockerfileFileHandler, ProjectFileHandlerResolver). Dockerfile support handles multi-stage builds and multi-line LABEL continuations, and preserves the file's original line endings. Upgrades the project to .NET 10 (from .NET 8) and moves the test suite onto the Microsoft.Testing.Platform runner via global.json. Adds --increment-type validation (case-insensitive match against None/Patch/Minor/Major, erroring instead of silently defaulting to Patch) and a --verbose flag on version/change/changelog to surface full exception details on failure. Fixes found while hardening this area: - --project-path crashing when given as a relative path instead of an absolute one. - --project-path pointing at a subdirectory with no project files of its own incorrectly forcing a fresh discovery scan even when a valid autover.json already existed elsewhere in the repo. - A false "not a valid git repository" error when an existing autover.json has no (or an empty) Projects list. - `changelog` crashing with an unhandled LINQ exception - and separately, silently discarding the current autover.json settings (e.g. UseCommitsForChangelog) - when autover.json or a change file was added to the repo after the last release tag. - A classic stdout/stderr deadlock risk in the integration test process-runner helper. Extracts the ambient "current directory" state that FileManager, DirectoryManager, and PathManager each tracked independently into one shared ICurrentDirectoryContext singleton, removing a whole class of bug where the three could drift out of sync. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X5zPe25HSm1MGwcWUB7r6J
… flakiness
The Build and Test workflow was failing on CI (Linux), with a different,
unrelated test failing on each run - always one that opens a
LibGit2Sharp.Repository directly (VersionTest, GitWorktreeTest,
DockerfileVersionTest, ConfigurationManagerTest, GitHandlerTest).
That pattern points to libgit2's native library racing on its lazy
first-time initialization when many Repository objects are opened
concurrently across threads under CI's higher parallelism - the same
class of issue AutoVer.IntegrationTests already works around via
[assembly: NotInParallel].
Add a shared [NotInParallel("git")] constraint to the five unit test
classes that construct a Repository directly, so they serialize
against each other without slowing down the rest of the (much larger)
unit test suite, which stays fully parallel.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X5zPe25HSm1MGwcWUB7r6J
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.
Summary
LABEL org.opencontainers.image.version), alongside existing .csproj/.nuspec support, through a new pluggableIProjectFileHandlerarchitecture. Handles multi-stage builds, multi-lineLABELcontinuations, and preserves original line endings.--increment-typevalidation (errors on invalid values instead of silently defaulting toPatch) and a--verboseflag onversion/change/changelog.FileManager/DirectoryManager/PathManagerinto one sharedICurrentDirectoryContextsingleton.Bugs fixed along the way
--project-pathcrashing when given as a relative path.--project-pathpointing at a subdirectory with no project files forcing an unnecessary discovery scan even when a validautover.jsonalready existed elsewhere.autover.jsonhas no (or an empty)Projectslist.changelogcrashing with an unhandled LINQ exception - and separately, silently discarding currentautover.jsonsettings (e.g.UseCommitsForChangelog) - whenautover.jsonor a change file was added after the last release tag.Test plan
dotnet build AutoVer.slnx- clean, 0 warnings/errorsdotnet test AutoVer.slnx- 152/152 passingversion,change,changelogthrough the full change-file lifecycle🤖 Generated with Claude Code
https://claude.ai/code/session_01X5zPe25HSm1MGwcWUB7r6J