Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Send wk/<version> User-Agent so telemetry can attribute releases The backend telemetry pipeline attributes CLI requests by their User-Agent header (the old workato-platform-cli sends "workato-platform-cli/<version>"). Here the header was a hardcoded const userAgent = "wk/dev", so every release reported "wk/dev" and its traffic was indistinguishable across versions. The MCP client sent no User-Agent at all. Build-time version info is already injected via goreleaser ldflags into main.version/commit/date, but only flowed to the `version` command, not the HTTP clients. This wires it through: - Add internal/version: single source of truth for build version, exposing UserAgent() -> "wk/<version>" (keeps the existing "wk" product token; mirrors the old CLI's product/version convention). - main.go records the ldflags values via version.Set (var names kept as main.version/commit/date so existing -X flags keep working). - Remove the duplicated version state from internal/commands; the version command now reads from the shared package. - Replace the hardcoded `const userAgent = "wk/dev"` and its three call sites (api do/doRaw and package upload) with version.UserAgent(). - Add the User-Agent header to the MCP client (it had none) and wire the real version into its clientInfo. Verified: go build/vet/test all pass; a release build (-X main.version=1.0.6-beta) reports the injected version, and a wire test confirms the header reaches the network. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Use distinctive workato-cli/<version> User-Agent token; add tests Two changes from review feedback: - Change the User-Agent product token from "wk" to "workato-cli". The nginx access-log field telemetry lands in is analyzed/tokenized, so the short "wk" token collides with stray "wk" tokens in unrelated user-agents (e.g. Customer.io), forcing fragile exclusion filters in the dashboards. "workato-cli" matches cleanly as a phrase and mirrors the old Python CLI's distinctive "workato-platform-cli" convention. The command stays `wk`; only the telemetry token changes. - Normalize a leading "v" in Set() via strings.TrimPrefix. Git tags are "v1.0.6-beta"; goreleaser strips the "v" but the Makefile's `git describe` does not, so without this the User-Agent differed by build path. Now it's consistently "workato-cli/1.0.6-beta". - Add internal/version/version_test.go covering Set/accessors, the User-Agent format, the v-prefix stripping, and the dev fallback. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Clarify in comments that ldflags are declared in the Makefile + goreleaser Spell out, where the version vars are defined, that the values come from the linker's -X flags declared in both the Makefile (via `git describe`) and .goreleaser.yaml, and that plain `go run`/`go build` leaves the defaults. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Use wk-cli/<version> User-Agent token Switch the telemetry token from workato-cli to wk-cli. wk-cli filters cleanly as a phrase (avoiding the bare "wk" collision) and matches the token the original beta builds already sent, so it reconnects with existing telemetry history instead of starting a new naming era. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge develop into main for v1.0.1 release.
Changes: