Skip to content

feat: Pack CLI as .NET tool in NuGet packages#263

Draft
Flash0ver wants to merge 18 commits intomainfrom
feat/dotnet-nuget
Draft

feat: Pack CLI as .NET tool in NuGet packages#263
Flash0ver wants to merge 18 commits intomainfrom
feat/dotnet-nuget

Conversation

@Flash0ver
Copy link
Member

Requires .NET SDK 10.0+.

See #255.

Flash0ver and others added 8 commits February 17, 2026 15:36
Set up .NET 10 project with console application and test framework.
Includes Native AOT compilation support for improved performance and
central package management with TUnit for testing.

Co-Authored-By: Claude <noreply@anthropic.com>
Configure Sentry.Cli as a .NET global tool with all required and
recommended NuGet package metadata. The package will be published as
"dotnet-sentry" and installed via "dotnet tool install -g dotnet-sentry".

Changes include:
- Set IsPackable to false by default in Directory.Build.props
- Override IsPackable to true for Sentry.Cli project
- Configure PackAsTool with command name "sentry"
- Add package metadata (ID, version, authors, description, etc.)
- Include LICENSE.md, README.md, and package icon in NuGet package

Fixes GH-255

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add ToolPackageRuntimeIdentifiers to support platform-specific .NET tool
packages for osx-arm64, osx-x64, linux-arm64, linux-x64, win-x64, and any.
This enables Native AOT compilation for each supported platform using .NET
10's DotNetCliTool Version 2.

Also add Deterministic and CI build properties to Directory.Build.props for
reproducible builds in GitHub Actions.

Refs #255

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Program.cs now dispatches to the correct native Sentry CLI binary based
on the target platform/architecture using compile-time constants. The
.csproj is updated to define per-RID constants and pack the native binary
alongside the .NET tool for each supported RID.

Also adds a pack.ts script for building NuGet packages and updates
.gitignore and package.json accordingly.

Co-Authored-By: Claude <noreply@anthropic.com>
Tests cover both the framework-dependent fallback (expects exit code 1
and an unsupported-platform error) and the platform-specific happy path
(publishes with the current RID, copies the native binary, and asserts
the version output).

Includes test helpers: DotnetProject, PathUtilities, PlatformUtilities,
ProcessResult, and JsonUtilities.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Runs dotnet test on all 5 targets after build-binary, downloading the
platform-specific native binary artifact into dist-bin so both TUnit
tests can run: the framework-dependent fallback test and the
platform-specific launcher test.

Also wires test-dotnet into ci-status checks and skipped-detection,
and adds a test:dotnet script to package.json for local use.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Build

  • Add hole-punch tool to reduce compressed binary size by BYK in #245
  • Add gzip-compressed binary downloads by BYK in #244

Other

  • (args) Parse Sentry web URLs as CLI arguments by BYK in #252
  • Pack CLI as .NET tool in NuGet packages by Flash0ver in #263

Bug Fixes 🐛

Telemetry

  • Reduce noise from version-check JSON parse errors by BYK in #253
  • Skip Sentry reporting for 4xx API errors by BYK in #251
  • Handle EPIPE errors from piped stdout gracefully by BYK in #250
  • Upgrade Sentry SDK to 10.39.0 and remove custom patches by BYK in #249

Other

  • (commands) Support org/project/id as single positional arg by BYK in #261
  • (db) Handle readonly database gracefully instead of crashing by betegon in #235
  • (errors) Show meaningful detail instead of [object Object] in API errors by BYK in #259
  • (issue-list) Propagate original errors instead of wrapping in plain Error by BYK in #254
  • (polyfill) Add exited promise and stdin to Bun.spawn Node.js polyfill by BYK in #248
  • (project-list) Add pagination and flexible target parsing by BYK in #221
  • (test) Prevent mock.module() leak from breaking test:isolated by BYK in #260
  • (upgrade) Remove v prefix from release URLs and work around Bun.write streaming bug by BYK in #243

Internal Changes 🔧

  • (build) Replace local hole-punch script with binpunch package by BYK in #246
  • Use @sentry/api client for requests by MathurAditya724 in #226

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2026

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 3693 uncovered lines.
✅ Project coverage is 73.15%. Comparing base (base) to head (head).

Files with missing lines (70)
File Patch % Lines
human.ts 58.29% ⚠️ 395 Missing
resolve-target.ts 27.46% ⚠️ 317 Missing
api-client.ts 70.26% ⚠️ 221 Missing
list.ts 23.47% ⚠️ 212 Missing
oauth.ts 30.94% ⚠️ 183 Missing
plan.ts 19.37% ⚠️ 154 Missing
resolver.ts 3.23% ⚠️ 120 Missing
list.ts 67.32% ⚠️ 116 Missing
help.ts 19.85% ⚠️ 109 Missing
upgrade.ts 61.37% ⚠️ 107 Missing
view.ts 41.90% ⚠️ 104 Missing
interactive-login.ts 9.17% ⚠️ 99 Missing
errors.ts 5.94% ⚠️ 95 Missing
view.ts 25.81% ⚠️ 92 Missing
view.ts 41.50% ⚠️ 86 Missing
clipboard.ts 4.49% ⚠️ 85 Missing
status.ts 24.07% ⚠️ 82 Missing
migration.ts 47.44% ⚠️ 82 Missing
list.ts 27.18% ⚠️ 75 Missing
browser.ts 4.11% ⚠️ 70 Missing
login.ts 33.33% ⚠️ 64 Missing
list.ts 86.12% ⚠️ 64 Missing
span-tree.ts 5.00% ⚠️ 57 Missing
explain.ts 33.33% ⚠️ 56 Missing
api.ts 89.80% ⚠️ 47 Missing
upgrade.ts 66.91% ⚠️ 46 Missing
seer.ts 75.54% ⚠️ 45 Missing
refresh.ts 40.63% ⚠️ 38 Missing
schema.ts 91.06% ⚠️ 37 Missing
seer.ts 79.87% ⚠️ 30 Missing
preload.ts 53.23% ⚠️ 29 Missing
view.ts 87.27% ⚠️ 28 Missing
telemetry.ts 93.01% ⚠️ 27 Missing
utils.ts 88.94% ⚠️ 25 Missing
view.ts 61.54% ⚠️ 25 Missing
fix.ts 89.29% ⚠️ 24 Missing
detector.ts 90.10% ⚠️ 20 Missing
arg-parsing.ts 90.37% ⚠️ 18 Missing
binary.ts 88.67% ⚠️ 17 Missing
list.ts 91.16% ⚠️ 16 Missing
list.ts 90.70% ⚠️ 16 Missing
help.ts 57.14% ⚠️ 15 Missing
sentry-client.ts 92.17% ⚠️ 13 Missing
dsn-cache.ts 94.62% ⚠️ 12 Missing
code-scanner.ts 96.25% ⚠️ 12 Missing
logout.ts 56.00% ⚠️ 11 Missing
token.ts 52.17% ⚠️ 11 Missing
qrcode.ts 33.33% ⚠️ 10 Missing
fs-utils.ts 57.14% ⚠️ 9 Missing
view.ts 94.89% ⚠️ 7 Missing
project-root.ts 97.73% ⚠️ 7 Missing
version-check.ts 92.47% ⚠️ 7 Missing
feedback.ts 84.21% ⚠️ 6 Missing
auth.ts 95.56% ⚠️ 6 Missing
shell.ts 96.23% ⚠️ 6 Missing
app.ts 93.90% ⚠️ 5 Missing
setup.ts 97.84% ⚠️ 4 Missing
list.ts 97.33% ⚠️ 4 Missing
project-aliases.ts 97.40% ⚠️ 2 Missing
project-root-cache.ts 96.92% ⚠️ 2 Missing
output.ts 89.47% ⚠️ 2 Missing
alias.ts 99.42% ⚠️ 1 Missing
completions.ts 99.37% ⚠️ 1 Missing
index.ts 98.99% ⚠️ 1 Missing
env-file.ts 99.19% ⚠️ 1 Missing
parser.ts 98.63% ⚠️ 1 Missing
colors.ts 98.21% ⚠️ 1 Missing
trace.ts 99.16% ⚠️ 1 Missing
region.ts 97.30% ⚠️ 1 Missing
helpers.ts 94.74% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    73.15%    73.15%        —%
==========================================
  Files          111       111         —
  Lines        13756     13756         —
  Branches         0         0         —
==========================================
+ Hits         10063     10063         —
- Misses        3693      3693         —
- Partials         0         0         —

Generated by Codecov Action

Flash0ver and others added 2 commits February 19, 2026 04:34
Extract resolveTargets() and verifyBinaries() helpers from pack() to
bring its complexity score below the linter's max of 15.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Flash0ver Flash0ver self-assigned this Feb 19, 2026
Flash0ver and others added 8 commits February 19, 2026 05:21
Adds script/dotnet-lint.ts wrapping `dotnet format` with a --check flag
that passes --verify-no-changes (non-zero exit if any file would change).
Wires up lint:dotnet / lint:dotnet:fix npm scripts and a lint-dotnet CI
job that gates test-dotnet.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Redesigns pack.ts mode semantics so CI can assemble all 7 packages
across three runners without duplicating the root/any packages:

- `--agnostic`: packs only root (pointer) + any packages; no binary needed
- `--single`: packs current platform only (no root/any)
- `--target <t>`: packs one specific target only (no root/any)
- no args: packs current platform + root + any (replaces "all platforms")
- `--no-clean`: skips dist-pkg cleanup, allowing accumulation across calls

Adds a new `build-nuget` CI job (linux/macos/windows matrix) that
downloads the pre-built native binaries, calls pack.ts with --no-clean
for each target + agnostic (linux only), and uploads a per-runner
nuget-* artifact. Together the three runners produce all 7 packages.

Updates package.json: `pack` drops --single, `pack:all` → `pack:agnostic`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ntries

Replaces the 3-runner matrix (linux/macos/windows) with 5 entries, one
per binary target, so each runner packs and uploads exactly one package.

- Downloads a single named artifact instead of a wildcard pattern
- Replaces the pack loop with a direct --target call per entry
- Moves the agnostic condition from a bash if to a step-level if

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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

Comments