Skip to content

Publish framework-dependent CosmosDBShell NuGet tool; self-contained as zips - #191

Merged
Mike Krüger (mkrueger) merged 1 commit into
mainfrom
ci/nuget-release-pipeline
Aug 19, 2026
Merged

Mike Krüger (mkrueger) merged 1 commit into
mainfrom
ci/nuget-release-pipeline

Conversation

@mkrueger

@mkrueger Mike Krüger (mkrueger) commented Aug 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Reworks the Official build (.pipelines/CosmosDB-Shell-Official.yml) so the two distribution channels have a single, clear purpose each:

  • NuGet = framework-dependent. Publishes exactly one RID-agnostic .NET tool package under the primary PackageId CosmosDBShell (tools/net10.0/any). It resolves the runtime from the machine's installed .NET 10, so it's much smaller than a self-contained build.
  • Self-contained = zips only. Standalone, per-RID single-file executables continue to ship as cosmosdbshell_<rid>_<version>.zip for users who don't have .NET installed.

What changed

  • Removed the self-contained RID NuGet packages (CosmosDBShell.<rid>) and the non-RID pointer package from publishing.
  • Removed the separate CosmosDBShell.FrameworkDependent package — the framework-dependent build is now the primary CosmosDBShell package.
  • Removed the framework-dependent zips (cosmosdbshell_fdd_<rid>_...); zips are self-contained only.
  • Pack: a single dotnet pack with ToolPackageRuntimeIdentifiers/RuntimeIdentifiers cleared and SelfContained=false/PublishSingleFile=false, emitting one tools/net10.0/any package.
  • Payload signing / validation / push updated to the single package (validation now asserts exactly one CosmosDBShell package and rejects any RID/variant package).
  • csproj defaults are unchanged; the framework-dependent behavior is driven entirely by command-line MSBuild overrides, so the self-contained zip publishes and local/GitHub Actions builds are unaffected.

Result

Channel Runtime included Intended user
dotnet tool install CosmosDBShell No (needs .NET 10) Has the .NET 10 SDK/runtime
cosmosdbshell_<rid>_<version>.zip Yes Wants a standalone binary

Testing

  • YAML validated (no schema/lint errors).
  • dotnet pack with the pipeline overrides verified locally: produces exactly one CosmosDBShell.<version>.nupkg (~36 MB) laid out as tools/net10.0/any/ with DotnetToolSettings.xml.

Follow-ups (not in this PR)

  • The nuget.org release pipeline (Add Azure DevOps NuGet release pipeline for nuget.org publishing #192) still validates the old 8-package set; it needs to be updated to the single CosmosDBShell framework-dependent package.
  • The GitHub Actions validate-and-package workflow and README install docs still describe the per-RID packages; they can be aligned separately if we want the local/validation path to match.
Copilot AI lite review requested due to automatic review settings August 5, 2026 09:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new manual-only Azure DevOps (OneBranch) release pipeline to publish already-signed CosmosDBShell NuGet packages (produced by the Official build) to nuget.org, gated by an environment approval and supporting a default dry-run validation mode.

Changes:

  • Introduces .pipelines/CosmosDB-Shell-Release-NuGet.yml to consume CosmosDB-Shell-Official artifacts and locate out/nupkg packages.
  • Adds a PowerShell validation step to enforce the expected package set (6 RID packages + exactly one pointer package) before any push.
  • Adds a deployment-gated publish path (with dryRun defaulting to validation-only).
@github-code-quality

github-code-quality Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall coverage in commit bcb8e4f in the ci/nuget-release-pip... branch remains at 61%, unchanged from commit 50dea94 in the main branch.


Updated August 18, 2026 11:17 UTC

Copilot AI review requested due to automatic review settings August 5, 2026 09:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (3)

.pipelines/CosmosDB-Shell-Release-NuGet.yml:109

  • The deployment job sets ob_outputDirectory, but the pipeline never creates that folder. If the OneBranch template expects the output directory to exist when it publishes artifacts / runs injected SDL steps, the job can fail before (or after) the NuGet push. Create the directory explicitly early in the job.
                    - task: UseDotNet@2
                      displayName: "Install .NET SDK"
                      inputs:
                        packageType: "sdk"
                        useGlobalJson: true
                        performMultiLevelLookup: true

.pipelines/CosmosDB-Shell-Official.yml:516

  • The framework-dependent pack step currently allows an implicit restore/build, which can make the Official pipeline slower and less deterministic (and may bypass the governed nuget.config if it restores again). Since the pipeline already restored/built earlier, align this pack with the other pack step by disabling restore/build explicitly.
                    dotnet pack "$(ReleaseProject)" `
                      --configuration "$(BuildConfiguration)" `
                      --output $pkgDir `

.pipelines/CosmosDB-Shell-Release-NuGet.yml:157

  • PR description says the release pipeline validates “6 RID-specific packages + exactly one pointer package”, but the pipeline also requires a CosmosDBShell.FrameworkDependent package (in addition to the RID set and pointer). Please update the PR description (and any related docs) to reflect the actual validation/publish contract (8 packages total).
                          # The framework-dependent tool package (requires .NET 10
                          # on the target machine) ships alongside the RID set.
                          $fdd = $packages | Where-Object { $_.Name -match '^CosmosDBShell\.FrameworkDependent\..+\.nupkg$' }
                          if (-not $fdd -or $fdd.Count -ne 1) {
                            $names = @($fdd | ForEach-Object { $_.Name })
                            throw "Expected exactly one framework-dependent package (CosmosDBShell.FrameworkDependent.*). Found: $($names -join ', ')"
                          }
Mike Krüger (mkrueger) added a commit that referenced this pull request Aug 5, 2026
- Release pipeline: create ob_outputDirectory early to satisfy the OneBranch/1ES template contract.- Release pipeline: surface NuGetOrgSource in validation and dry-run output for auditing.- Official pipeline: route the framework-dependent pack restore through the governed nuget.config (--configfile).
Copilot AI review requested due to automatic review settings August 5, 2026 10:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (2)

.pipelines/CosmosDB-Shell-Official.yml:556

  • The variable name $ridPackages is now misleading because the filter includes FrameworkDependent packages in addition to RID-specific packages. Renaming it avoids confusion when reading logs and maintaining the signing pipeline.
                    # Include the framework-dependent tool package so its loose
                    # tools/net10.0/any/*.dll payload is Authenticode-signed too.
                    $ridPackages = Get-ChildItem -Path $pkgDir -Filter "CosmosDBShell.*.nupkg" -File -ErrorAction SilentlyContinue | Where-Object {
                      $_.Name -match '^CosmosDBShell\.(win-x64|win-arm64|linux-x64|linux-arm64|osx-x64|osx-arm64|FrameworkDependent)\..+\.nupkg$'
                    }

.pipelines/CosmosDB-Shell-Release-NuGet.yml:206

  • Publishing all packages via a single wildcard push can result in non-deterministic publish order and partial releases if the task fails mid-way (e.g., pointer package published before RID packages). The Official pipeline avoids this by pushing each RID package explicitly and pushing the pointer package separately/last (see tasks around the internal feed pushes). Consider mirroring that pattern here (separate push steps per package group) to make failures safer and logs clearer.
                        - task: NuGetCommand@2
                          displayName: "Push packages to nuget.org"
                          inputs:
                            command: "push"
                            packagesToPush: '$(ResolvedPackageDir)\*.nupkg'
                            nuGetFeedType: "external"
                            publishFeedCredentials: "$(NuGetServiceConnection)"
@mkrueger

Copy link
Copy Markdown
Collaborator Author

Addressed the remaining (suppressed) Copilot review items in 2b141d1:

  • FDD pack restore/build governance (CosmosDB-Shell-Official.yml): added --configfile .pipelines/nuget.config to the framework-dependent dotnet pack so its restore stays on the governed feed. It intentionally does not use --no-build/--no-restore (unlike the self-contained pack) because it targets a different configuration — framework-dependent, no RID — than the earlier build, so a fresh restore/build is required. Added a comment explaining this.
  • PR description accuracy: updated the description to reflect the real publish contract of 8 packages (6 RID + 1 pointer + 1 CosmosDBShell.FrameworkDependent).

The two inline review threads have been fixed and resolved. All CI checks are green.

Copilot AI review requested due to automatic review settings August 5, 2026 10:34
@mkrueger Mike Krüger (mkrueger) changed the title Add Azure DevOps NuGet release pipeline for nuget.org publishing Aug 5, 2026
@mkrueger

Copy link
Copy Markdown
Collaborator Author

Split this PR: the nuget.org release pipeline was moved to #192. This PR now contains only the framework-dependent (FDD) packaging changes to the Official build.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (2)

.pipelines/CosmosDB-Shell-Official.yml:333

  • The FDD Windows binaries (e.g., out\fdd\win-x64\CosmosDBShell.exe) are new shipping artifacts, but later the "Clean non-shipping build outputs before SDL" step whitelists only 'win-x64' and 'win-arm64' (self-contained) for BinSkim, and will trim the entire 'fdd' directory (BinSkim doesn’t scan inside zip files). This means the FDD Windows PE files likely won’t be scanned by BinSkim/SDL. Consider keeping out\fdd\win-x64 and out\fdd\win-arm64 (or copying those PEs to a kept folder) until after SDL scanning completes.
              - task: PowerShell@2
                displayName: "Zip and validate framework-dependent RID publish folders"
                condition: succeeded()

.pipelines/CosmosDB-Shell-Official.yml:233

  • The comment implies the FDD publish output is fully picked up by the "Sign publish output" task, but that task only signs "/*.exe;/*.dll". For linux/osx the app host is the extensionless "CosmosDBShell" file, so it will not be Authenticode-signed; the comment should clarify this is Windows-only signing.

This issue also appears on line 331 of the same file.

              # These land in out\fdd\<rid>\ and are picked up by the recursive
              # "Sign publish output" task below.
Copilot AI review requested due to automatic review settings August 5, 2026 12:23
@mkrueger Mike Krüger (mkrueger) changed the title Build framework-dependent (FDD) NuGet packages and zips in Official pipeline Aug 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

.pipelines/CosmosDB-Shell-Official.yml:403

  • The inline comment says the pack step targets a different configuration than the RID publishes, but both use $(BuildConfiguration) (the RID publishes pass --configuration $(BuildConfiguration) too). This can mislead future maintainers when troubleshooting pack vs publish differences; it’s really about different publish/runtime settings rather than configuration.
                    # This restores/builds fresh (no --no-build/--no-restore) because
                    # it targets a different configuration than the RID publishes;
                    # --configfile keeps that restore on the governed feed.
@mkrueger
Mike Krüger (mkrueger) force-pushed the ci/nuget-release-pipeline branch 3 times, most recently from 1a16464 to e3c0e39 Compare August 11, 2026 08:55
…as zips

The Official build publishes framework-dependent, per-RID .NET tool packages: a tiny RID-agnostic pointer package (CosmosDBShell) plus one package per RID (CosmosDBShell.<rid>), each carrying only that platform's native dependencies (~12-24 MB instead of ~35 MB for a single package bundling every platform's natives, and far smaller than a self-contained build). dotnet tool install resolves the right RID package by convention when both are present in the same feed/local source, matching README's existing install instructions. Self-contained builds ship as per-RID single-file zip archives, and framework-dependent single-file zips ship alongside them for users who already have .NET 10 and want a smaller download than the self-contained zip.

Packaging: RuntimeIdentifiers/ToolPackageRuntimeIdentifiers are intentionally left at the csproj defaults for the FDD pack (only SelfContained/PublishSingleFile/EnableCompressionInSingleFile/PackAsTool are overridden), which is what drives dotnet pack's per-RID tool split. The pack step asserts the evaluated properties before packing and asserts the exact package set after (one pointer + one per RID, no stray any/FrameworkDependent variant). Payload signing now expands all packages (pointer + 6 RID) since the RID packages carry the binaries. Final validation spot-checks that the pointer has no RID tools/ paths and each RID package contains only its own platform's tools/, never another RID's. The NuGet push now pushes the pointer and all RID packages.

The self-contained RID publish steps pass --self-contained true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:IncludeAllContentForSelfExtract=true instead of relying on csproj defaults, so native dependencies (msalruntime, Cosmos ServiceInterop, CRT DLLs) are bundled into the single executable on Linux/macOS instead of shipping as loose files alongside it. A per-RID framework-dependent publish stage (out\fdd\<rid>, --self-contained false -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=false -p:IncludeAllContentForSelfExtract=true) runs before signing so the existing out\ signing pass covers it too. The zip step is refactored around a shared New-ValidatedSingleFileZip helper and produces both cosmosdbshell_<rid>_<version>.zip (self-contained) and cosmosdbshell_fdd_<rid>_<version>.zip (framework-dependent), each validated to contain exactly one file with the expected executable name.

csproj defaults are unchanged; all overrides are supplied via pipeline command-line/response-file overrides so local builds, GitHub Actions, and existing artifact shapes are unaffected.
@mkrueger
Mike Krüger (mkrueger) marked this pull request as ready for review August 18, 2026 11:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (2)

.pipelines/CosmosDB-Shell-Official.yml:447

  • The PR description says the Official build should publish a single RID-agnostic, framework-dependent tool package (tools/net10.0/any) under PackageId CosmosDBShell by clearing RuntimeIdentifiers/ToolPackageRuntimeIdentifiers. However, this pipeline explicitly keeps the full RID list and validates/ships a pointer package plus per-RID packages (CosmosDBShell.<rid>). Either the PR description needs updating, or this pack/validation/push logic should be reworked to emit/accept exactly one CosmosDBShell.<version>.nupkg (and reject any per-RID packages).
              # The published NuGet packages are framework-dependent .NET global
              # tool packages, split per RID (tools/net10.0/<rid>) so each download
              # only carries that platform's native deps (~12-24 MB) instead of one
              # RID-agnostic package bundling every platform's natives (~35 MB).
              # dotnet pack emits a tiny RID-agnostic pointer package (CosmosDBShell)

.pipelines/CosmosDB-Shell-Official.yml:356

  • This pipeline now publishes and zips framework-dependent builds per RID (e.g., cosmosdbshell_fdd_<rid>_<version>.zip), but the PR description states that framework-dependent output should be distributed via NuGet only and that the cosmosdbshell_fdd_... zip artifacts were removed. If the intent is “self-contained = zips only”, the FDD zip creation (and likely the preceding FDD publish step) should be removed so only cosmosdbshell_<rid>_<version>.zip is produced.

This issue also appears on line 443 of the same file.

                      New-ValidatedSingleFileZip `
                        -Label 'framework-dependent' `
                        -PublishDir (Join-Path $outDir "fdd\$rid") `
                        -ZipPath (Join-Path $zipDir ("cosmosdbshell_fdd_{0}_{1}.zip" -f $rid, $version)) `
                        -ExpectedExe $expectedExe
@mkrueger
Mike Krüger (mkrueger) merged commit 48b107c into main Aug 19, 2026
15 checks passed
@mkrueger
Mike Krüger (mkrueger) deleted the ci/nuget-release-pipeline branch August 19, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants