From 824e4513e6ded5ecfe7e698116a847b1860e618b Mon Sep 17 00:00:00 2001 From: aicia-bot Date: Thu, 26 Nov 2026 00:12:06 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=90=B3=20drop=20latest=20tag=20and=20?= =?UTF-8?q?silence=20helper=20stdout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove :latest tag generation from Resolve-DocfxImageTagPlan so builds and promotions emit only versioned convenience and engine-qualified tags, and redirect Docker and Skopeo output to the host so callers receive clean return values. --- BuildAndPushDocfxImage.ps1 | 12 ++++++------ tools/DocfxImage.psm1 | 16 +++++++--------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/BuildAndPushDocfxImage.ps1 b/BuildAndPushDocfxImage.ps1 index 12db2c7..c1e6407 100644 --- a/BuildAndPushDocfxImage.ps1 +++ b/BuildAndPushDocfxImage.ps1 @@ -147,7 +147,7 @@ if ($BuildOnly) { '--provenance=mode=max' '.' ) - Invoke-DocfxDocker $ociArgs + Invoke-DocfxDocker $ociArgs | Out-Host $verified = Invoke-OciArtifact -Arguments @( 'verify', $archiveFullPath @@ -161,8 +161,8 @@ if ($BuildOnly) { $localImage = "docfx-verify:${cpu}-$([guid]::NewGuid().ToString('N'))" $loadArchive = Join-Path ([IO.Path]::GetTempPath()) "docfx-load-${cpu}-$([guid]::NewGuid().ToString('N')).docker.tar" try { - Invoke-Skopeo -Arguments @('copy', '--override-os', 'linux', '--override-arch', $cpu, "oci-archive:$archiveFullPath", "docker-archive:${loadArchive}:${localImage}") - Invoke-DocfxDocker @('load', '--input', $loadArchive) + $null = Invoke-Skopeo -Arguments @('copy', '--override-os', 'linux', '--override-arch', $cpu, "oci-archive:$archiveFullPath", "docker-archive:${loadArchive}:${localImage}") + Invoke-DocfxDocker @('load', '--input', $loadArchive) | Out-Host } finally { if (Test-Path -LiteralPath $loadArchive) { Remove-Item -LiteralPath $loadArchive -Force @@ -189,7 +189,7 @@ if ($BuildOnly) { $details = @((Invoke-DocfxDocker @('image', 'inspect', $localImage)) -join "`n" | ConvertFrom-Json)[0] foreach ($reference in $tagPlan.AllReferences) { - Invoke-DocfxDocker @('tag', $localImage, $reference) + Invoke-DocfxDocker @('tag', $localImage, $reference) | Out-Host } $record = [pscustomobject]@{ @@ -224,7 +224,7 @@ foreach ($reference in $tagPlan.AllReferences) { } if (-not $Publish) { - Invoke-DocfxDocker ($buildArguments.ToArray() + @('--load', '.')) + Invoke-DocfxDocker ($buildArguments.ToArray() + @('--load', '.')) | Out-Host if ($PassThru) { return $plan } return } @@ -235,7 +235,7 @@ foreach ($reference in $tagPlan.EngineQualifiedReferences) { $metadataTemp = New-TemporaryFile try { - Invoke-DocfxDocker ($buildArguments.ToArray() + @('--push', '--metadata-file', $metadataTemp.FullName, '.')) + Invoke-DocfxDocker ($buildArguments.ToArray() + @('--push', '--metadata-file', $metadataTemp.FullName, '.')) | Out-Host $digest = (Get-Content -LiteralPath $metadataTemp.FullName -Raw | ConvertFrom-Json).'containerimage.digest' if ($digest -cnotmatch '^sha256:[0-9a-f]{64}$') { throw 'Buildx did not report a valid published image digest.' diff --git a/tools/DocfxImage.psm1 b/tools/DocfxImage.psm1 index ab5ac61..c8c97ff 100644 --- a/tools/DocfxImage.psm1 +++ b/tools/DocfxImage.psm1 @@ -109,10 +109,8 @@ function Resolve-DocfxImageTagPlan { $convenienceTags = if ($Engine -and $Engine.IsPrerelease) { @() - } elseif ($CliVersion.IsPrerelease) { - @($CliVersion.Value) } else { - @($versionedBases + @('latest')) + @($versionedBases) } $engineQualifiedTags = if ($Engine) { @@ -271,7 +269,7 @@ function Invoke-Skopeo { } } - & skopeo @Arguments + & skopeo @Arguments | Out-Host if ($LASTEXITCODE -ne 0) { throw "skopeo $($Arguments[0]) exited with code $LASTEXITCODE." } @@ -322,7 +320,7 @@ function Invoke-Skopeo { return [Text.UTF8Encoding]::new($false).GetBytes($joined) } - Invoke-DocfxDocker ($dockerArgs.ToArray()) + Invoke-DocfxDocker ($dockerArgs.ToArray()) | Out-Host } function Invoke-OciArtifact { @@ -477,7 +475,7 @@ function Publish-DocfxOciArchive { throw "Engine-qualified tag conflict for '$tag': expected '$expectedDigest', found '$existing'. Refusing to overwrite." } if ($null -eq $existing) { - Invoke-Skopeo -Arguments @('copy', '--all', '--preserve-digests', "oci:$layoutDir", "docker://$tag") + $null = Invoke-Skopeo -Arguments @('copy', '--all', '--preserve-digests', "oci:$layoutDir", "docker://$tag") } $raw = Invoke-Skopeo -Arguments @('inspect', '--raw', "docker://$tag") -CaptureOutput @@ -490,7 +488,7 @@ function Publish-DocfxOciArchive { if ($convenienceTags.Count -gt 0) { if ($BeforeConvenience) { - & $BeforeConvenience + $null = & $BeforeConvenience } $null = Test-DocfxPromotionPreflight ` @@ -506,7 +504,7 @@ function Publish-DocfxOciArchive { -RequireEngineTagsPresent foreach ($tag in $convenienceTags) { - Invoke-Skopeo -Arguments @('copy', '--all', '--preserve-digests', "oci:$layoutDir", "docker://$tag") + $null = Invoke-Skopeo -Arguments @('copy', '--all', '--preserve-digests', "oci:$layoutDir", "docker://$tag") $raw = Invoke-Skopeo -Arguments @('inspect', '--raw', "docker://$tag") -CaptureOutput $actualDigest = 'sha256:' + [Convert]::ToHexString([Security.Cryptography.SHA256]::HashData($raw)).ToLowerInvariant() if ($actualDigest -cne $expectedDigest) { @@ -521,7 +519,7 @@ function Publish-DocfxOciArchive { New-Item -ItemType Directory -Path $verifyDir -Force | Out-Null try { $downloaded = Join-Path $verifyDir 'registry.oci.tar' - Invoke-Skopeo -Arguments @('copy', '--all', '--preserve-digests', "docker://$($preflight.Repository)@$expectedDigest", "oci-archive:$downloaded") + $null = Invoke-Skopeo -Arguments @('copy', '--all', '--preserve-digests', "docker://$($preflight.Repository)@$expectedDigest", "oci-archive:$downloaded") $verifyArgs = @('verify', $downloaded, '--version', $EngineVersion, '--docfx-version', $DocfxVersion, '--revision', $Revision, '--source', $SourceRepository, '--expected-digest', $expectedDigest, '--no-seal') if ($Platform) { $verifyArgs += @('--platform', $Platform) } $null = Invoke-OciArtifact -Arguments $verifyArgs From ede6f91d498ff0fb6b4e882d7b3eabc73b398f13 Mon Sep 17 00:00:00 2001 From: aicia-bot Date: Thu, 26 Nov 2026 00:12:07 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=E2=9C=85=20update=20image=20and=20release?= =?UTF-8?q?=20delivery=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update Pester assertions and Docker/Skopeo mocks in BuildAndPushDocfxImage and ReleaseDelivery test suites to enforce the six-tag policy without :latest and verify silent stdout behavior. --- tests/BuildAndPushDocfxImage.Tests.ps1 | 47 ++++++++++++++++++++------ tests/ReleaseDelivery.Tests.ps1 | 29 +++++++++------- 2 files changed, 54 insertions(+), 22 deletions(-) diff --git a/tests/BuildAndPushDocfxImage.Tests.ps1 b/tests/BuildAndPushDocfxImage.Tests.ps1 index ad7a782..6efe44e 100644 --- a/tests/BuildAndPushDocfxImage.Tests.ps1 +++ b/tests/BuildAndPushDocfxImage.Tests.ps1 @@ -86,7 +86,7 @@ Describe 'BuildAndPushDocfxImage versioning, OCI build-only, and safeguards' { return (@(@{ Id = 'sha256:' + ('7' * 64); Size = 123456 }) | ConvertTo-Json -Depth 4) } if ($callArgs.Count -ge 1 -and ($callArgs[0] -ceq 'load' -or $callArgs[0] -ceq 'tag')) { - return + return 'Loaded image: docfx-verify:test' } if ($callArgs.Count -ge 2 -and $callArgs[0] -ceq 'buildx' -and $callArgs[1] -ceq 'build') { if ($ds.BuildExitCode -ne 0) { @@ -109,7 +109,7 @@ Describe 'BuildAndPushDocfxImage versioning, OCI build-only, and safeguards' { ConvertTo-Json | Set-Content -LiteralPath $metadataPath } - return + return '#1 building with default instance' } if ($callArgs.Count -ge 3 -and $callArgs[0] -ceq 'buildx' -and $callArgs[1] -ceq 'imagetools' -and $callArgs[2] -ceq 'inspect') { $formatIndex = [Array]::IndexOf($callArgs, '--format') @@ -177,14 +177,15 @@ Describe 'BuildAndPushDocfxImage versioning, OCI build-only, and safeguards' { 'codebeltnet/docfx:2.81.0' 'codebeltnet/docfx:2.81' 'codebeltnet/docfx:2' - 'codebeltnet/docfx:latest' ) + $plan.Tags | Should -HaveCount 6 + $plan.Tags | Should -Not -Contain 'codebeltnet/docfx:latest' $silent = & $buildScript -Tag docfx-local -WhatIf $silent | Should -BeNullOrEmpty } - It 'preserves existing convenience tags when EngineVersion is omitted locally' { + It 'generates versioned convenience tags without latest when EngineVersion is omitted locally' { $plan = & $buildScript -Tag docfx-local -PassThru $global:DocfxBuildTestState.DockerCalls.Count | Should -Be 1 @@ -192,7 +193,8 @@ Describe 'BuildAndPushDocfxImage versioning, OCI build-only, and safeguards' { $tags = Get-ArgumentValues $buildArgs '--tag' $labels = Get-ArgumentValues $buildArgs '--label' - $tags | Should -Be @('docfx-local:2.81.0', 'docfx-local:2.81', 'docfx-local:2', 'docfx-local:latest') + $tags | Should -Be @('docfx-local:2.81.0', 'docfx-local:2.81', 'docfx-local:2') + $tags | Should -Not -Contain 'docfx-local:latest' $buildArgs | Should -Contain '--load' $buildArgs | Should -Not -Contain '--push' $labels | Should -Contain 'net.codebelt.docfx.cli.version=2.81.0' @@ -202,7 +204,7 @@ Describe 'BuildAndPushDocfxImage versioning, OCI build-only, and safeguards' { $plan.EngineVersion | Should -BeNullOrEmpty } - It 'builds all seven convenience and engine-qualified tags locally when EngineVersion is supplied' { + It 'builds all six convenience and engine-qualified tags locally when EngineVersion is supplied' { & $buildScript -Tag docfx-local -EngineVersion 1.1.0 -Platform linux/amd64 ` -FrameworkSdkImage 'example.invalid/sdk:11-amd64' ` -FrameworkSdkArm64Image 'example.invalid/sdk:11-arm64' @@ -220,7 +222,6 @@ Describe 'BuildAndPushDocfxImage versioning, OCI build-only, and safeguards' { 'docfx-local:2.81.0' 'docfx-local:2.81' 'docfx-local:2' - 'docfx-local:latest' ) $labels | Should -Contain 'org.opencontainers.image.version=1.1.0' $labels | Should -Contain 'net.codebelt.docfx.engine.version=1.1.0' @@ -263,6 +264,7 @@ Describe 'BuildAndPushDocfxImage versioning, OCI build-only, and safeguards' { if ($Arguments[-1] -match '^docker-archive:(.+\.tar):') { Set-Content -LiteralPath $Matches[1] -Value 'docker-tar' } + return 'Getting image source signatures' } Mock Invoke-OciArtifact { param([string[]] $Arguments) @@ -285,6 +287,20 @@ Describe 'BuildAndPushDocfxImage versioning, OCI build-only, and safeguards' { $record.Platform | Should -Be 'linux/amd64' $record.ConfigDigest | Should -Be ('sha256:' + ('5' * 64)) $record.NativeVerified | Should -BeFalse + $record.Tags | Should -Be @( + 'codebeltnet/docfx:2.81.0-v1.1.0' + 'codebeltnet/docfx:2.81-v1.1.0' + 'codebeltnet/docfx:2-v1.1.0' + 'codebeltnet/docfx:2.81.0' + 'codebeltnet/docfx:2.81' + 'codebeltnet/docfx:2' + ) + $record.ConvenienceTags | Should -Be @( + 'codebeltnet/docfx:2.81.0' + 'codebeltnet/docfx:2.81' + 'codebeltnet/docfx:2' + ) + $record.Tags | Should -Not -Contain 'codebeltnet/docfx:latest' Test-Path -LiteralPath $metadataPath | Should -BeTrue $global:DocfxBuildTestState.SkopeoCalls.Count | Should -Be 1 $global:DocfxBuildTestState.OciCalls.Count | Should -Be 2 @@ -332,13 +348,13 @@ Describe 'BuildAndPushDocfxImage versioning, OCI build-only, and safeguards' { CaseName = 'engine patch bump with same CLI' Docfx = '2.81.0' Engine = '1.1.1' - Expected = @('docfx:2.81.0-v1.1.1', 'docfx:2.81-v1.1.1', 'docfx:2-v1.1.1', 'docfx:2.81.0', 'docfx:2.81', 'docfx:2', 'docfx:latest') + Expected = @('docfx:2.81.0-v1.1.1', 'docfx:2.81-v1.1.1', 'docfx:2-v1.1.1', 'docfx:2.81.0', 'docfx:2.81', 'docfx:2') } @{ CaseName = 'future major CLI and engine versions' Docfx = '3.0.0' Engine = '2.0.0' - Expected = @('docfx:3.0.0-v2.0.0', 'docfx:3.0-v2.0.0', 'docfx:3-v2.0.0', 'docfx:3.0.0', 'docfx:3.0', 'docfx:3', 'docfx:latest') + Expected = @('docfx:3.0.0-v2.0.0', 'docfx:3.0-v2.0.0', 'docfx:3-v2.0.0', 'docfx:3.0.0', 'docfx:3.0', 'docfx:3') } @{ CaseName = 'prerelease engine does not move floating convenience tags' @@ -453,10 +469,21 @@ Describe 'BuildAndPushDocfxImage versioning, OCI build-only, and safeguards' { Should -Throw '*Could not verify whether engine-qualified tag*unauthorized*' } - It 'publishes once to a custom registry, checks all seven tags, verifies both platforms and OCI labels' { + It 'publishes once to a custom registry, checks all six tags, verifies both platforms and OCI labels' { $output = & $buildScript -ContainerRegistry 'localhost:5000/team/' -EngineVersion '1.1.0' -Publish $output | Should -BeExactly "localhost:5000/team/docfx:2.81.0-v1.1.0@$validIndexDigest" + $pushBuildCall = @($global:DocfxBuildTestState.DockerCalls | Where-Object { $_[0] -ceq 'buildx' -and $_[1] -ceq 'build' })[0] + $pushedTags = Get-ArgumentValues $pushBuildCall '--tag' + $pushedTags | Should -Be @( + 'localhost:5000/team/docfx:2.81.0-v1.1.0' + 'localhost:5000/team/docfx:2.81-v1.1.0' + 'localhost:5000/team/docfx:2-v1.1.0' + 'localhost:5000/team/docfx:2.81.0' + 'localhost:5000/team/docfx:2.81' + 'localhost:5000/team/docfx:2' + ) + $global:DocfxBuildTestState.DockerState.HasPushed = $false $global:DocfxBuildTestState.DockerState.IndexMediaType = 'application/vnd.docker.distribution.manifest.list.v2+json' $output2 = & $buildScript -ContainerRegistry '' -Tag 'docfx' -EngineVersion '1.1.0' -Publish diff --git a/tests/ReleaseDelivery.Tests.ps1 b/tests/ReleaseDelivery.Tests.ps1 index 622fdc4..9315773 100644 --- a/tests/ReleaseDelivery.Tests.ps1 +++ b/tests/ReleaseDelivery.Tests.ps1 @@ -23,10 +23,9 @@ BeforeAll { 'codebeltnet/docfx:2.81.0' 'codebeltnet/docfx:2.81' 'codebeltnet/docfx:2' - 'codebeltnet/docfx:latest' ) $validEngineTags = $validTags[0..2] - $validConvenienceTags = $validTags[3..6] + $validConvenienceTags = $validTags[3..5] } AfterAll { @@ -112,8 +111,9 @@ Describe 'DocfxImage shared module contracts and OCI promotion safeguards' { It 'invokes Skopeo natively and via utility container fallback with auth mount and error propagation' { Mock -ModuleName DocfxImage Test-SkopeoTransport { $true } - Mock -ModuleName DocfxImage skopeo { $global:LASTEXITCODE = 0 } - { Invoke-Skopeo -Arguments @('copy', 'oci:/tmp/x', 'docker://reg/img:1') } | Should -Not -Throw + Mock -ModuleName DocfxImage skopeo { $global:LASTEXITCODE = 0; 'Getting image source signatures'; 'Writing manifest to image destination' } + $nativeOut = Invoke-Skopeo -Arguments @('copy', 'oci:/tmp/x', 'docker://reg/img:1') + $nativeOut | Should -BeNullOrEmpty Mock -ModuleName DocfxImage skopeo { $global:LASTEXITCODE = 7 } { Invoke-Skopeo -Arguments @('copy', 'oci:/tmp/x', 'docker://reg/img:1') } | Should -Throw '*exited with code 7*' @@ -141,7 +141,8 @@ Describe 'DocfxImage shared module contracts and OCI promotion safeguards' { } $tarFile = Join-Path $TestDrive 'sample.tar' - Invoke-Skopeo -Arguments @('copy', "oci-archive:$tarFile", "docker-archive:${tarFile}:local:tag") + $fallbackOut = Invoke-Skopeo -Arguments @('copy', "oci-archive:$tarFile", "docker-archive:${tarFile}:local:tag") + $fallbackOut | Should -BeNullOrEmpty ($global:DocfxCapturedDockerArgs -join ' ') | Should -BeLike '*REGISTRY_AUTH_FILE=/auth.json*quay.io/skopeo/stable:v1.20.0*' $rawBytes = Invoke-Skopeo -Arguments @('inspect', '--raw', 'docker://reg/img:1') -CaptureOutput @@ -285,11 +286,12 @@ Describe 'DocfxImage shared module contracts and OCI promotion safeguards' { if ($Arguments[0] -ceq 'inspect') { return $s.RawIndexBytes } if ($Arguments[3].StartsWith('docker://')) { $s.Events.Add("verify-download:$($Arguments[3])") - return + return 'Writing manifest to image destination' } $dest = $Arguments[-1].Substring('docker://'.Length) $s.Registry[$dest] = $s.ComputedDigest $s.Events.Add("push:$dest") + return 'Getting image source signatures' } $summaryPath = Join-Path $TestDrive 'summary.md' @@ -305,12 +307,13 @@ Describe 'DocfxImage shared module contracts and OCI promotion safeguards' { -EngineQualifiedTags $engineTags ` -ExpectedIndexDigest $global:DocfxPromoState.ComputedDigest ` -Platform 'amd64' ` - -BeforeConvenience { $global:DocfxPromoState.Events.Add('before-convenience') } + -BeforeConvenience { $global:DocfxPromoState.Events.Add('before-convenience'); 'verified-latest' } } finally { $env:GITHUB_STEP_SUMMARY = $prevSummary } - $result.Published.Count | Should -Be 7 + $result | Should -BeOfType [pscustomobject] + $result.Published.Count | Should -Be 6 $global:DocfxPromoState.Events | Should -Be @( "push:${Repository}:2.81-v1.1.0" "push:${Repository}:2-v1.1.0" @@ -318,7 +321,6 @@ Describe 'DocfxImage shared module contracts and OCI promotion safeguards' { "push:${Repository}:2.81.0" "push:${Repository}:2.81" "push:${Repository}:2" - "push:${Repository}:latest" "verify-download:docker://$Repository@$($global:DocfxPromoState.ComputedDigest)" ) Test-Path -LiteralPath "$($global:DocfxPromoState.ArchiveFile).published.json" | Should -BeTrue @@ -795,17 +797,20 @@ Describe 'Invoke-DocfxRelease CI/CD lifecycle orchestration' { return (@{ indexDigest = 'sha256:' + ('1' * 64); platforms = @('amd64', 'arm64') } | ConvertTo-Json -Compress) } Mock Publish-DocfxOciArchive { - param([scriptblock] $BeforeConvenience) + param([string[]] $Tags, [string[]] $EngineQualifiedTags, [scriptblock] $BeforeConvenience) if ($BeforeConvenience) { & $BeforeConvenience } [pscustomobject]@{ IndexDigest = 'sha256:' + ('1' * 64) Repository = 'codebeltnet/docfx' - Published = @('1','2','3','4','5','6','7' | ForEach-Object { @{ tag = "t$_"; digest = 'sha256:' + ('1' * 64) } }) + Published = @($Tags | ForEach-Object { @{ tag = $_; digest = 'sha256:' + ('1' * 64) } }) } } $pubOut = & $releaseScript -Command Publish -ResolvedDir $script:resolvedDir -OutDir $script:outDir - $pubOut | Should -BeLike "*Promoted 7 tags to codebeltnet/docfx@$validIndexDigest*" + $pubOut | Should -BeLike "*Promoted 6 tags to codebeltnet/docfx@$validIndexDigest*" + Should -Invoke Publish-DocfxOciArchive -Times 1 -Exactly -ParameterFilter { + $Tags.Count -eq 6 -and ($Tags -notcontains 'codebeltnet/docfx:latest') -and $EngineQualifiedTags.Count -eq 3 + } { & $releaseScript -Command Publish -ResolvedDir (Join-Path $script:work 'no-resolved') -OutDir $script:outDir } | Should -Throw '*identity file is missing*' From a157e5b75edf72ba89eac68000e3c13f448d1faa Mon Sep 17 00:00:00 2001 From: aicia-bot Date: Thu, 26 Nov 2026 00:12:08 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=93=9A=20document=20six-tag=20docker?= =?UTF-8?q?=20image=20policy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update README, framework-views README, and AGENTS.md to reflect the six-tag versioned Docker image policy and state that :latest is neither generated nor published. --- AGENTS.md | 2 +- README.md | 15 ++++++++------- framework-views/README.md | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index df22104..ee3354c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,7 +33,7 @@ - `.github/workflows/container.yml` — reusable native AMD64 (`ubuntu-26.04`) and ARM64 (`ubuntu-26.04-arm`) builder image construction, OCI export with SBOM and SLSA provenance, native runtime validation, and loaded-config verification. - `.github/workflows/release.yml` — triggered on `vMAJOR.MINOR.PATCH` tags (authoritative Codebelt engine version without leading `v`); runs all quality gates, assembles the exact native-verified AMD64/ARM64 manifests into one multi-platform OCI index without rebuilding, verifies via `tools/OciArtifact.cs` and `codebeltnet/oci-artifact-verify@v1`, splits assets <= 1 GiB, creates a draft GitHub Release, verifies durable asset attachment, and cleans transient Actions artifacts. - `.github/workflows/deploy.yml` — triggered on GitHub Release `published` (human approval gate) or `workflow_dispatch` from `main` for idempotent recovery; resolves the latest published stable release, validates tag ancestry on `main` and the authoritative `release.yml` run attempt, reconstructs and verifies the exact OCI archive, then promotes it to Docker Hub via Skopeo (`--all --preserve-digests`) under the `Production` environment without rebuilding. -- Engine-qualified tags (`2-v1.1.0`, `2.81-v1.1.0`, `2.81.0-v1.1.0`) are promoted and verified before floating convenience tags (`latest`, `2`, `2.81`, `2.81.0`). Conflicting engine-qualified tags fail closed; identical index digests allow idempotent recovery; superseded releases are blocked from rolling back floating convenience tags. +- Engine-qualified tags (`2-v1.1.0`, `2.81-v1.1.0`, `2.81.0-v1.1.0`) are promoted and verified before floating versioned convenience tags (`2`, `2.81`, `2.81.0`); `:latest` is not generated or published. Conflicting engine-qualified tags fail closed; identical index digests allow idempotent recovery; superseded releases are blocked from rolling back floating convenience tags. - Direct `BuildAndPushDocfxImage.ps1 -Publish` targeting `codebeltnet/docfx` or `docker.io/codebeltnet/docfx` is intentionally disabled so official production releases cannot bypass the build-once promotion lifecycle. - Distinguish repository-implemented workflow automation from manual GitHub administration (the `Production` environment, required reviewers, `DOCKERHUB_USERNAME`/`DOCKERHUB_TOKEN` environment secrets, `main` ruleset required check `Required quality gate`, and Docker Hub selective immutable-tag rules). Never claim administrative settings are configured unless verified. diff --git a/README.md b/README.md index a6c8988..610b1e2 100644 --- a/README.md +++ b/README.md @@ -98,11 +98,10 @@ Neither version is inferred from the other. The examples below use DocFX CLI `2. ### Convenience and engine-qualified tags -For a standard stable release containing one upstream DocFX CLI version, a single multi-platform build associates all seven tags with the same published image index: +For a standard stable release containing one upstream DocFX CLI version, a single multi-platform build associates all six versioned tags with the same published image index: | Tag family | Image tag | Meaning | | --- | --- | --- | -| Convenience | `codebeltnet/docfx:latest` | Latest published distribution | | Convenience | `codebeltnet/docfx:2` | Latest published distribution within DocFX CLI major version `2` | | Convenience | `codebeltnet/docfx:2.81` | Latest published distribution within DocFX CLI minor version `2.81` | | Convenience | `codebeltnet/docfx:2.81.0` | Distribution using exact DocFX CLI version `2.81.0` | @@ -110,6 +109,8 @@ For a standard stable release containing one upstream DocFX CLI version, a singl | Engine-qualified | `codebeltnet/docfx:2.81-v1.1.0` | DocFX CLI minor version `2.81` with Codebelt engine `1.1.0` | | Engine-qualified | `codebeltnet/docfx:2.81.0-v1.1.0` | Exact DocFX CLI `2.81.0` with Codebelt engine `1.1.0` | +**Versioned tagging policy:** `codebeltnet/docfx` does not generate, publish, or support a `:latest` Docker image tag. Consumers should always select an explicit versioned convenience tag (`2`, `2.81`, or `2.81.0`), a Codebelt engine-qualified tag (`2-v1.1.0`, `2.81-v1.1.0`, or `2.81.0-v1.1.0`), or a digest-pinned reference. + Prerelease versions never update floating stable convenience tags: - A prerelease Codebelt engine version (for example, `1.2.0-rc.1` with DocFX CLI `2.81.0`) generates only the engine-qualified tags (`2.81.0-v1.2.0-rc.1`, `2.81-v1.2.0-rc.1`, `2-v1.2.0-rc.1`). @@ -117,7 +118,7 @@ Prerelease versions never update floating stable convenience tags: ### Consumer control levels -Existing consumers do not need to migrate; unqualified convenience tags remain supported with their established behavior. Choose the reference level that matches your reproducibility needs: +Versioned convenience tags (`2`, `2.81`, `2.81.0`) remain supported, while `:latest` is intentionally not published or supported. Choose the reference level that matches your reproducibility needs: - **Convenience** (for example, `codebeltnet/docfx:2` or `codebeltnet/docfx:2.81.0`): automatically receives updated Codebelt engine releases for that DocFX CLI scope. Convenient for low-maintenance builds, but pulling a newer image can introduce breaking Codebelt engine changes independently of the upstream DocFX CLI. - **Explicit version selection** (for example, `codebeltnet/docfx:2-v1.1.0` or `codebeltnet/docfx:2.81.0-v1.1.0`): selects a specific Codebelt engine release. Published engine-qualified release tags are never intentionally reassigned to different image content during ordinary release operations, and `BuildAndPushDocfxImage.ps1 -Publish` refuses to overwrite existing engine-qualified tags. Because these tags stay fixed to one release, they do not automatically receive future patches or security updates; adopt a newer `-v` release explicitly. @@ -147,7 +148,7 @@ From the repository root, use PowerShell 7 and Docker Buildx in Linux-container pwsh -NoProfile -File ./BuildAndPushDocfxImage.ps1 -Tag docfx-local ``` -Without `-EngineVersion`, the default loads one platform into Docker and tags it with the existing convenience tags (`docfx-local:2.81.0`, `docfx-local:2.81`, `docfx-local:2`, and `docfx-local:latest`). Pass `-EngineVersion` to also generate the engine-qualified tags and set `org.opencontainers.image.version` locally: +Without `-EngineVersion`, the default loads one platform into Docker and tags it with the versioned convenience tags (`docfx-local:2.81.0`, `docfx-local:2.81`, and `docfx-local:2`). Pass `-EngineVersion` to also generate the engine-qualified tags and set `org.opencontainers.image.version` locally: ```powershell pwsh -NoProfile -File ./BuildAndPushDocfxImage.ps1 -Tag docfx-local -EngineVersion 1.1.0 @@ -192,7 +193,7 @@ Pull request (.github/workflows/pr.yml) -> Create draft GitHub Release with durable split OCI assets & checksums, then clean transient CI artifacts -> Human approves and publishes the GitHub Release (.github/workflows/deploy.yml) -> Reconstruct & re-verify durable OCI assets, then promote to Docker Hub via Skopeo (--all --preserve-digests) - -> Verify all seven tags resolve to the exact multi-platform OCI index digest & re-verify downloaded registry content + -> Verify all six tags resolve to the exact multi-platform OCI index digest & re-verify downloaded registry content ``` ### Workflow segregation @@ -209,7 +210,7 @@ Pull request (.github/workflows/pr.yml) - **Release tag convention:** Git tags use `vMAJOR.MINOR.PATCH` (for example, `v1.1.0`), which defines Codebelt engine version `1.1.0`. The upstream DocFX CLI version (`2.81.0`) is maintained independently in `Dockerfile` (`ARG DOCFX_VERSION`). - **Single implementation:** Local builds (`BuildAndPushDocfxImage.ps1`), CI container validation, release assembly, and deployment promotion all share [`tools/DocfxImage.psm1`](tools/DocfxImage.psm1) and [`tools/OciArtifact.cs`](tools/OciArtifact.cs) (a `.NET 10` file-based C# application). - **Direct-publish safeguard:** `BuildAndPushDocfxImage.ps1 -Publish` intentionally refuses direct `docker buildx build --push` against the official `codebeltnet/docfx` (or `docker.io/codebeltnet/docfx`) repository so production releases cannot bypass build-once native verification and release approval. Custom or fork registries (for example, `-ContainerRegistry localhost:5000/team/`) remain supported for local/fork workflows. -- **Two-phase promotion & conflict protection:** `deploy.yml` preflights all engine-qualified tags (`2.81.0-v1.1.0`, `2.81-v1.1.0`, `2-v1.1.0`) before any registry write. Missing tags are uploaded; tags already pointing to the exact expected OCI index digest are accepted for idempotent retry; any tag pointing to different content fails closed without overwriting. Floating convenience tags (`2.81.0`, `2.81`, `2`, `latest`) are updated only after all engine-qualified tags exist in the registry with the exact expected digest and after re-confirming the release is still the latest published stable release. +- **Two-phase promotion & conflict protection:** `deploy.yml` preflights all engine-qualified tags (`2.81.0-v1.1.0`, `2.81-v1.1.0`, `2-v1.1.0`) before any registry write. Missing tags are uploaded; tags already pointing to the exact expected OCI index digest are accepted for idempotent retry; any tag pointing to different content fails closed without overwriting. Floating convenience tags (`2.81.0`, `2.81`, `2`) are updated only after all engine-qualified tags exist in the registry with the exact expected digest and after re-confirming the release is still the latest published stable release. - **Post-publish verification:** After promotion, `deploy.yml` inspects every promoted tag's raw manifest digest to prove no manifest rewriting occurred, then downloads the image by immutable digest (`codebeltnet/docfx@sha256:`) and re-verifies all blobs, both platforms, OCI labels, SPDX SBOM, and SLSA provenance. ### Deployment recovery procedure @@ -219,7 +220,7 @@ To resume or recover a partially completed production deployment of the latest p 1. Never rebuild the image or re-tag a release for recovery. 2. In GitHub Actions, manually dispatch **Deploy Docker Hub images** (`.github/workflows/deploy.yml`) from branch `main` with `tag` set to the already-published latest release tag (for example, `v1.1.0`). 3. `deploy.yml` loads deployment tooling from `main` (pinned to a single `deployment-sha`), downloads the original durable OCI assets from the GitHub Release, re-verifies checksums, the authoritative `release.yml` run, native results, and OCI attestations, skips any engine-qualified tag already matching the exact expected index digest, and completes the remaining promotions idempotently. -4. Attempting to dispatch recovery from a non-`main` branch, for a draft/prerelease, or for an older superseded release is automatically rejected to prevent rolling back floating convenience tags (`latest`, `2`, `2.81`, `2.81.0`). +4. Attempting to dispatch recovery from a non-`main` branch, for a draft/prerelease, or for an older superseded release is automatically rejected to prevent rolling back floating convenience tags (`2`, `2.81`, `2.81.0`). ### Manual GitHub & Docker Hub administrative configuration diff --git a/framework-views/README.md b/framework-views/README.md index 5ce3330..5df38cb 100644 --- a/framework-views/README.md +++ b/framework-views/README.md @@ -55,7 +55,7 @@ Include `templates/ms-style` in the DocFX `build.template` list. The generator u The shared builder image distributes the same script and packaging assets at `/opt/docfx/framework-views/` and matching templates at `/opt/docfx/templates/`. It includes PowerShell 7, the .NET 10 and .NET 11 SDKs, and DocFX 2.81.0. The consumer's `global.json` can select an installed project SDK independently of the resolver. For other SDK pins, run from the source distribution with the required SDKs on the host or supply them in a derived builder. -Use the approved image index digest from the [CI/CD release and deployment lifecycle](../README.md#cicd-release-and-deployment-lifecycle). See [Docker image versioning](../README.md#docker-image-versioning) for the trade-offs between convenience tags (`codebeltnet/docfx:2`, `:2.81`, `:2.81.0`, `:latest`), engine-qualified tags (`:2-v1.1.0`, `:2.81-v1.1.0`, `:2.81.0-v1.1.0`), and digest-pinned references; existing convenience-tag references remain supported and migration is optional. The `1.1.0` example below illustrates the naming contract and is not publicly available until release publication occurs. For branch testing, [build the image locally](../README.md#build-the-builder-image-locally) with `-Tag docfx-local -EngineVersion 1.1.0` and substitute `docfx-local:2.81.0-v1.1.0` (or `docfx-local:2.81.0`) below. +Use the approved image index digest from the [CI/CD release and deployment lifecycle](../README.md#cicd-release-and-deployment-lifecycle). See [Docker image versioning](../README.md#docker-image-versioning) for the trade-offs between versioned convenience tags (`codebeltnet/docfx:2`, `:2.81`, `:2.81.0`), engine-qualified tags (`:2-v1.1.0`, `:2.81-v1.1.0`, `:2.81.0-v1.1.0`), and digest-pinned references; `:latest` is not published or supported, while versioned convenience-tag references remain supported. The `1.1.0` example below illustrates the naming contract and is not publicly available until release publication occurs. For branch testing, [build the image locally](../README.md#build-the-builder-image-locally) with `-Tag docfx-local -EngineVersion 1.1.0` and substitute `docfx-local:2.81.0-v1.1.0` (or `docfx-local:2.81.0`) below. Run the entire generator in the selected image. Mount the consumer checkout writable for restore and build outputs. From 8669d0bd0126f1f5fe322339699b7141c17159a1 Mon Sep 17 00:00:00 2001 From: aicia-bot Date: Thu, 26 Nov 2026 00:12:09 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=92=AC=20update=20changelog=20for=20s?= =?UTF-8?q?ix-tag=20image=20policy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an Unreleased section to CHANGELOG.md recording the removal of :latest tag generation and the corresponding documentation and delivery test updates. --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5b6dbb..d5a0355 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Updated repository documentation (`README.md`, `framework-views/README.md`, `AGENTS.md`) and delivery tests (`tests/BuildAndPushDocfxImage.Tests.ps1`, `tests/ReleaseDelivery.Tests.ps1`) to document and enforce the six-tag versioned Docker image policy (three floating versioned convenience tags and three Codebelt engine-qualified tags). + +### Removed + +- Removed `:latest` Docker image tag generation and publication support from `Resolve-DocfxImageTagPlan` (`tools/DocfxImage.psm1`) so local builds, build-only OCI exports, release metadata, and Docker Hub promotions emit only versioned convenience tags (`MAJOR`, `MAJOR.MINOR`, `MAJOR.MINOR.PATCH`) and engine-qualified `-v{EngineVersion}` tags. + ## [1.1.0] - 2026-11-25 This is a minor release that refactors native framework views onto convention-based discovery and modular metadata helpers, introduces engine-aware Docker image versioning with OCI metadata labels, establishes an automated build-once GitHub Actions CI/CD release and deployment lifecycle, and adds shared PowerShell 7 and .NET 10 delivery tooling with comprehensive unit and OCI verification suites. @@ -94,6 +104,7 @@ This is the initial release of the DocFX builder Docker image. - Added a DocFX builder Docker image that includes the default and modern templates, - Added support for running the DocFX build process in a container. +[Unreleased]: https://github.com/codebeltnet/docfx/compare/v1.1.0..HEAD [1.1.0]: https://github.com/codebeltnet/docfx/compare/v1.0.1..v1.1.0 [1.0.1]: https://github.com/codebeltnet/docfx/compare/v1.0.0..v1.0.1 [1.0.0]: https://github.com/codebeltnet/docfx/compare/v0.1.4..v1.0.0