Skip to content

feat(a4h): add breq a4h commands and a live session screen - #48

Merged
devops-bda merged 1 commit into
mainfrom
feat/a4h-session
Oct 27, 2026
Merged

devops-bda merged 1 commit into
mainfrom
feat/a4h-session

Conversation

@phanikumarps

Copy link
Copy Markdown
Contributor

Summary

breq a4h status | start [--wait] | extend | terminate [-y] | watch to manage your own on-demand SAP ABAP trial (A4H) system from the terminal, over the new gRPC methods in trm-bff (bluefunda/trm-bff#51). Fixes #47.

  • Commands follow the repo's pattern (bffConn(), Printer, table / json / quiet, stdout data-only). Session RPCs sign in again once if the token was rejected.
  • start --wait follows startup on stderr (reports each state change once) until SAP is ready; fails if the session ends instead, or after --timeout (15 m).
  • terminate deletes the system, so it asks first, refuses without --yes when stdin isn't a terminal, and treats end-of-input as "no answer" (not consent).
  • watch is a standalone Bubble Tea screen using the existing theme: the four startup steps, host / SAP GUI / ADT details, time remaining, keys s start · e extend · x end (confirmed) · r refresh · q. Polls every 5 s while in flight and 30 s when ready; a failed poll doesn't stop polling and keypresses can't stack timers. It is separate from the change-request dashboard; folding it into the dashboard is a possible follow-up.
  • Shared internal/a4h (states, steps, poll cadence, formatting) is used by both.

Proto

bff.proto is synced with trm-bff's (they differ only in go_package and one comment) and regenerated. make proto was already broken on main: go_package still named the old module github.com/bluefunda/trm-cli/... while scripts/generate-proto.sh expects github.com/bluefunda/bluerequests, so protoc failed with "generated file does not match prefix". Fixed. With only that fix, regenerating reproduced the committed code byte for byte, so the generated diff is just the new messages and methods (protoc 3.21.12, protoc-gen-go v1.36.11, protoc-gen-go-grpc 1.6.2, the versions in the existing headers).

Also

  • The stale run 'trm login' hints (7 places) now say breq login; my commands print them when logged out.
  • README and AGENTS.md: command docs, RPC table, structure. AGENTS.md also records that the CLI's x-user-id is not an identity the server may trust (trm-bff's gRPC sits behind plain nginx, so its A4H methods verify the token with Keycloak; see trm-bff#51).

Tests

make vet and make test pass (first tests in this repo): internal/a4h (states, steps, poll cadence, remaining time, connection details), internal/cmd (rows, all three output formats, error text, confirmation, waiting: follows startup / session ends / timeout / poll error), internal/tui (each screen state, only valid actions per state, confirmation gate, stale-poll and failed-poll handling, auth-expired message). The JSON-format test parses the output because protojson randomizes whitespace on purpose. Smoke-tested the built binary: help, completion, terminate refusing without --yes on non-terminal stdin, logged-out hint.

Not done: not run against a live trm-bff (the gRPC methods aren't deployed yet; this depends on bluefunda/trm-bff#51 being merged and released), and the TUI screen hasn't been looked at in a real terminal. Please try breq a4h watch once trm-bff is deployed.

Type

  • feature
  • fix
  • performance
  • security
  • infrastructure

Customer Impact

People who live in the terminal can start, watch, extend and end their own temporary SAP ABAP trial system with breq a4h, including a live status screen.

Metrics

  • Cost reduction: systems only exist (and bill) while a session is active; terminate ends it immediately.

Marketing Notes

On-demand SAP ABAP trial (A4H) sessions from the BlueRequests CLI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01F7rygZSCZuuTLw9LriyiHN

breq a4h status | start [--wait] | extend | terminate [-y] | watch, over the
new A4H session RPCs in trm-bff (GetA4HSession, StartA4HSession,
ExtendA4HSession, TerminateA4HSession). Table, json and quiet output like the
other commands, stdout stays data-only. start --wait follows startup until
SAP is ready and fails if the session ends instead or after --timeout.
terminate asks first, refuses without --yes when stdin is not a terminal, and
treats end of input as no answer. watch is a Bubble Tea screen with the
four startup steps, host / SAP GUI / ADT details, time remaining and keys to
start, extend and end (end is confirmed), polling every 5s while in flight
and 30s when ready, continuing after a failed poll.

Proto: bff.proto synced with trm-bff and regenerated. Its go_package still
named the old module (github.com/bluefunda/trm-cli/...), so make proto failed
on main with "generated file does not match prefix"; fixed. Regenerating the
unchanged proto reproduces the committed code byte for byte.

Also: the "run 'trm login'" hints now say 'breq login'; README and AGENTS.md
document the commands and that the CLI's x-user-id is not an identity the
server may trust.

Fixes #47

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F7rygZSCZuuTLw9LriyiHN
@devops-bda
devops-bda merged commit 808245e into main Oct 27, 2026
4 checks passed
@phanikumarps
phanikumarps deleted the feat/a4h-session branch October 27, 2026 00:15
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.

feat: breq a4h commands and live TUI screen for on-demand SAP trial sessions

2 participants