Skip to content

PLAT-1314/feat: unify version output and add JSON mode - #11

Open
brtkwr wants to merge 1 commit into
mainfrom
bkunwar/plat-1314-version-output
Open

brtkwr wants to merge 1 commit into
mainfrom
bkunwar/plat-1314-version-output

Conversation

@brtkwr

@brtkwr brtkwr commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Context

PLAT-1314 specifies matching version/--version information and machine-readable version --json. Currently the flag prints only the release version, the command adds runtime/platform information, and JSON mode is absent.

Changes

  • Share the existing text format between twoctl version and twoctl --version.
  • Add twoctl version --json with version, go_version, os, and arch fields.
  • Keep version queries offline by bypassing the inherited upgrade hook and rejecting unexpected positional arguments.
  • Add output-contract tests and document the supported forms.

Scope / Non-goals

Version/build metadata injection remains unchanged. This is independent of the open retry/context/keychain PRs and starts from refreshed main including #9. PLAT-1314 remains its pre-existing Bharat-owned In Progress ticket; recent activity and branch/PR checks found no competing version implementation.

Validation

On exact head 33b08836a554b52c0a0ffa7465553a5f73f50b94, CI run 40856683310 passed both jobs:

  • build: go build ./..., embedded-spec drift check, and all tests through make test-cover passed. Total coverage 80.8% exceeds the 80% gate.
  • lint: all repository lints passed.
  • No local tests. Local formatting and git diff --check passed.

Ticket

Refs PLAT-1314.

✨ via Codex session

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T10:21:24.549630Z 33b0883 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Puvendhan Puvendhan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. version and --version share versionText, and --json gives a stable 4-field object. The no-op PersistentPreRunE keeps version offline with no upgrade check. #6, #8 and #11 all touch root.go, so expect small rebases.

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