Skip to content

v0.38.0

Choose a tag to compare

@github-actions github-actions released this 14 Aug 06:42
b10e188

This release makes dtctl embeddable — pkg/engine runs full dtctl command lines in-process with byte-identical output, and v0.38.0 is the first release you can actually go get — and adds API spec discovery plus a governed HTTP passthrough for the platform APIs dtctl doesn't wrap natively.

✨ Highlights

API spec discovery + a governed HTTP passthrough (#420)

dtctl wraps ~20 platform APIs natively; an environment publishes many more. Reaching an unwrapped API used to mean ad-hoc JavaScript through exec function — the least governed path in the tool was also the most convenient one. Now:

dtctl get apis [--uncovered] [--ops-count]        # what the environment actually publishes
dtctl describe api <name> [--operation 'METHOD /path'] [--raw]
dtctl exec api <path> [-X METHOD] [-d BODY|@file|@-] [-H 'Name: value'] [--dry-run]
  • The listing mirrors the environment's own API index. The DTCTL column names the native command that already covers an API, so --uncovered turns the platform-vs-dtctl gap into a contribution backlog.
  • describe api projects rather than dumps: published specifications run to tens of thousands of tokens, so the default view is the operation index — every operation as METHOD /path with its summary and declared scope. --operation drills into one operation in full (parameters, body schema, responses, scopes, a ready-to-run invocation).
  • The exec api safety verdict is resolved from the API's own specification, never from the HTTP method: a sweep of one production index found 15 POST operations that declare only a read scope (verification and search endpoints that are POSTs purely because they take a body), while a POST elsewhere deletes stored records. The verdict is the stricter of two independent floors — what the method guarantees and what the specification declares — an unresolvable request is gated as a delete, and there is deliberately no flag to assert otherwise.
  • The passthrough is built to stay an escape hatch: unadvertised (visible only in dtctl commands --full), granted by no command profile, and it names the native command whenever one covers the path.

Also fixed along the way: every exec subcommand now gates on the safety level — a readonly context previously did not block dtctl exec function --code '…'.

dtctl is now embeddable (#417, #419)

cmd.Run and pkg/engine run one dtctl command line per request in-process — multi-tenant sessions, per-request virtual files, zero host capabilities — with a guard test asserting byte-identical stdout/stderr/exit code between the engine and the CLI. dtctl serve http ships as an experimental reference server on top, registered only when DTCTL_EXPERIMENTAL_SERVE is set.

And it is actually consumable (#419): the root module's sdk require had named a placeholder pseudo-version since the module's first day, so go get github.com/dynatrace-oss/dtctl@<any tag> failed with unknown revision — in-repo builds resolved the sdk through a local replace that Go ignores downstream, so nothing ever validated the require. It now pins a real, release-please-managed version, every release mirrors its tag into sdk/vX.Y.Z, and a verify-consumable release job proves the import from a module outside the repo. v0.38.0 is the first importable release, and SDK versions are now aligned with the CLI's (the sdk tag jumps 0.2.0 → 0.38.0).

Two intended CLI-visible behavior changes ride along:

  • apply --write-id now actually rewrites the source file. It was a silent no-op unless apply hooks happened to be configured — which is not what the flag documented.
  • apply prints a new stderr hint on every create-via-apply without --write-id, suggesting how to make future runs update instead of create.

🔒 Security

Release binaries are now built with Go 1.26.6 (#421), clearing seven govulncheck findings in standard-library code paths dtctl actually calls (net/http, encoding/xml, encoding/asn1, x/net idna).

🐛 Fixes

  • create extension always failed with HTTP 415 (#348) — the upload was sent as multipart/form-data, but the Extensions v2 API requires the raw ZIP bytes with Content-Type: application/octet-stream. Extension uploads work now.
  • DQL quotes silently lost on Windows PowerShell (#418) — Windows PowerShell 5.1 strips embedded double quotes from arguments to native programs, turning filter loglevel == "INFO" into a field-to-field comparison that is valid DQL and quietly returns zero rows (reproduced: 0 records, no warning, 13 GB scanned). dtctl now re-reads its raw command line on Windows, detects the mangling, and warns with the forms that work; --file - with stdin on a terminal fails fast instead of hanging; and the docs no longer recommend a here-string form that went through the same mangling. PowerShell 7.3+ was never affected.

Full Changelog: v0.37.0...v0.38.0