Skip to content

feat: add CLI versioning header and update client initialization#29

Merged
egenthon-cmd merged 1 commit into
mainfrom
feat/x-gladia-version
Jul 6, 2026
Merged

feat: add CLI versioning header and update client initialization#29
egenthon-cmd merged 1 commit into
mainfrom
feat/x-gladia-version

Conversation

@karamouche

@karamouche karamouche commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Add missing header to track usage and versions of the CLI

Summary by CodeRabbit

  • Bug Fixes
    • Improved request handling so transcription requests consistently include the correct authentication and version headers.
    • The CLI now sends a version identifier with transcription requests, which may help with API compatibility and diagnostics.
    • Updated transcribe workflows to apply the same header behavior across upload, transcription, and listing operations.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 40951b9d-91f3-49a6-854a-3e0dbac9f1cf

📥 Commits

Reviewing files that changed from the base of the PR and between 91e6682 and 1aeea85.

📒 Files selected for processing (7)
  • cmd/transcribe.go
  • cmd/transcribe_test.go
  • pkg/client/client.go
  • pkg/client/client_test.go
  • pkg/client/transcribe.go
  • pkg/client/transcribe_test.go
  • pkg/client/transcription.go

📝 Walkthrough

Walkthrough

GladiaClient's constructor now accepts a cliVersion parameter, stored as a new CLIVersion field defaulting to "dev". A new setRequestHeaders method sets both x-gladia-key and x-gladia-version headers and is now used by UploadFile, createAndExecuteRequest, and ListTranscriptions. Callers and tests updated accordingly.

Changes

CLI version header propagation

Layer / File(s) Summary
Client struct, constructor, and shared header helper
pkg/client/client.go, pkg/client/client_test.go
GladiaClient gains a CLIVersion field; NewGladiaClient takes a cliVersion parameter defaulting to "dev"; new setRequestHeaders method sets x-gladia-key and x-gladia-version headers.
Wire header helper into transcribe and transcription requests
pkg/client/transcribe.go, pkg/client/transcription.go, pkg/client/transcribe_test.go
UploadFile, createAndExecuteRequest, and ListTranscriptions now call setRequestHeaders instead of setting x-gladia-key directly; tests assert x-gladia-version header and pass the version argument.
CLI command version wiring and end-to-end test
cmd/transcribe.go, cmd/transcribe_test.go
newTranscribeCmd passes version to NewGladiaClient; existing tests updated with the new argument; new test verifies x-gladia-version header equals "cli/dev" end-to-end.

Estimated code review effort: 2 (Simple) | ~12 minutes

Possibly related PRs

Suggested reviewers: jqueguiner

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a CLI versioning header and updating client initialization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/x-gladia-version

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@egenthon-cmd egenthon-cmd merged commit 22ddae7 into main Jul 6, 2026
6 checks passed
@egenthon-cmd egenthon-cmd deleted the feat/x-gladia-version branch July 6, 2026 21:03
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.

2 participants