feat(pingone): add User-Agent suffix to PingOne SDK client requests#25
Open
samir-gandhi wants to merge 5 commits into
Open
feat(pingone): add User-Agent suffix to PingOne SDK client requests#25samir-gandhi wants to merge 5 commits into
samir-gandhi wants to merge 5 commits into
Conversation
…gent suffix
Add a `version string` parameter to `NewFromCredentials` and call
`cfg.AppendUserAgent(fmt.Sprintf("pingcli-plugin-terraformer/%s", version))`
between `NewConfiguration` and `NewAPIClient`, so every outbound SDK
request carries a `pingcli-plugin-terraformer/<version>` suffix in its
User-Agent header.
Update the test call site in client_test.go to pass "dev" as the new
final argument so the package continues to compile and vet cleanly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wire the `version` string from `package main` into `NewFromCredentials` via a new `version` field on `ExportCommand` and `TfCommand`, an exported `SetVersion` method on `TfCommand`, and updated call sites in `runExport`, `runAsStandalone`, and `runAsPlugin`. Acceptance test helper updated to pass `"dev"` to satisfy the new signature. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
TestTfCommand_SetVersion validates that SetVersion stores the value in the struct field. TestTfCommand_Routing_VersionPropagation exercises the export routing path after SetVersion and confirms the version is wired through TfCommand.Run into ExportCommand construction. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ion injection
Add ldflags to .goreleaser.yaml builds[0] to inject -X main.version={{.Version}}
and -X main.commit={{.Commit}} at release build time, so release binaries report
the real version tag in the pingcli-plugin-terraformer/<version> User-Agent suffix
rather than the "dev" default.
Create .changelog/pr-25.txt with a release-note:enhancement entry describing the
User-Agent suffix feature.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Verify that NewFromCredentials appends the pingcli-plugin-terraformer/<version> suffix via AppendUserAgent without overwriting the SDK base string. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Regression Test Results
✅ No regressions detectedAll export configurations produced compatible output. Generated by regression workflow • View run |
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.
Summary
User-Agentsuffix ofpingcli-plugin-terraformer/<version>on every outbound API request, so requests from Ping CLI are identifiable in PingOne server logspackage mainthroughTfCommand.SetVersion→ExportCommand.version→runExport→NewFromCredentialswithout import cyclesldflagsto inject the real release tag ({{.Version}}) at build time; development builds continue to reportdevTest plan
User-Agentsuffixpingcli-plugin-terraformer/<version>is appended viacfg.AppendUserAgent(SDK base string preserved) — Verified by Polaris QAmain.go→TfCommand.SetVersion→ExportCommand→NewFromCredentials— Verified by Polaris QA.goreleaser.yamlinjects-X main.version={{.Version}} -X main.commit={{.Commit}}at build time — Verified by Polaris QANewFromCredentialssignature — Verified by Polaris QANotes
resource_flow.go(fetchFlowVariableDeps/exportFlowVersion) bypass the SDK client and do not carry this header — explicitly out of scope; tracked separately if neededrunExportnow has 18 parameters; a follow-up to introduce a config struct is recommended but out of scope hereCloses #18
🤖 Generated with Claude Code