Skip to content

Add Dockerfile versioning support, upgrade to .NET 10, and harden path/config handling - #20

Merged
philasmar merged 2 commits into
devfrom
dockerfile-versioning-and-hardening
Aug 20, 2026
Merged

Add Dockerfile versioning support, upgrade to .NET 10, and harden path/config handling#20
philasmar merged 2 commits into
devfrom
dockerfile-versioning-and-hardening

Conversation

@philasmar

Copy link
Copy Markdown
Owner

Summary

  • Adds native Dockerfile versioning (via LABEL org.opencontainers.image.version), alongside existing .csproj/.nuspec support, through a new pluggable IProjectFileHandler architecture. Handles multi-stage builds, multi-line LABEL continuations, and preserves original line endings.
  • Upgrades to .NET 10 (from .NET 8) and moves the test suite onto the Microsoft.Testing.Platform runner.
  • Adds --increment-type validation (errors on invalid values instead of silently defaulting to Patch) and a --verbose flag on version/change/changelog.
  • Extracts the ambient "current directory" state duplicated across FileManager/DirectoryManager/PathManager into one shared ICurrentDirectoryContext singleton.

Bugs fixed along the way

  • --project-path crashing when given as a relative path.
  • --project-path pointing at a subdirectory with no project files forcing an unnecessary discovery scan even when a valid autover.json already existed elsewhere.
  • 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 current autover.json settings (e.g. UseCommitsForChangelog) - when autover.json or a change file was added after the last release tag.
  • A stdout/stderr deadlock risk in the integration test process-runner helper.

Test plan

  • dotnet build AutoVer.slnx - clean, 0 warnings/errors
  • dotnet test AutoVer.slnx - 152/152 passing
  • Every new regression test verified against the pre-fix code (confirmed it fails) before restoring the fix
  • Manual end-to-end walkthrough in a scratch repo: version a Dockerfile with no version label (clean failure), add a version label, run version, change, changelog through the full change-file lifecycle

🤖 Generated with Claude Code

https://claude.ai/code/session_01X5zPe25HSm1MGwcWUB7r6J

Phil Asmar and others added 2 commits August 20, 2026 12:42
…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
@philasmar
philasmar merged commit 79e20dd into dev Aug 20, 2026
2 checks passed
@philasmar
philasmar deleted the dockerfile-versioning-and-hardening branch August 20, 2026 17:06
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