Skip to content

chore: fix Tech Debt Issues#56

Merged
aru-amedeo merged 7 commits intomainfrom
feat/tech-debt
Apr 15, 2026
Merged

chore: fix Tech Debt Issues#56
aru-amedeo merged 7 commits intomainfrom
feat/tech-debt

Conversation

@aru-amedeo
Copy link
Copy Markdown
Collaborator

@aru-amedeo aru-amedeo commented Apr 12, 2026

Fixes #39
Fixes #40
Fixes #41
Fixes #42
Fixes #46
Fixes #47
Fixes #48
Fixes #50
Fixes #51

@aru-amedeo aru-amedeo added the bug Something isn't working label Apr 12, 2026
…; fix CI

- TD-009: standardize MarkFlagRequired as sole required-flag mechanism;
  remove redundant manual if-empty checks from 19 commands
- TD-011: prompt for client-secret interactively using term.ReadPassword
  instead of requiring it as a visible CLI flag
- TD-012: warn about credential exposure in --debug flag description
- TD-016: add global --output flag; PrintTable emits JSON when --output=json
- TD-017: add --limit/--offset pagination flags to all 25 list commands
- TD-018: encapsulate client cache in clientState struct; add resetClientState()
- Remove vendor/ from git tracking; add to .gitignore
- Fix CI: use go-version-file to match go.mod version instead of hardcoded 1.24.2,
  eliminating the covdata toolchain resolution failure
@aru-amedeo aru-amedeo changed the title chore: fix TD-009 and TD-011 chore: fix TD-009,TD-011, TD-012, TD-016, TD-017, TD-018 Apr 12, 2026
…files

Add 23 new test files (111 passing test cases) covering list/get/create/
delete/update handlers across compute, network, database, container,
schedule, storage, and management command files.

Key changes:
- cmd/mock_test.go: extend mock infrastructure with 16 new sub-client
  mocks, 6 with* builder functions, and resetCmdFlags() to prevent cobra
  flag state leakage between test runs
- cmd/*_test.go: 23 new table-driven test files; create commands that
  pre-fetch resources (storage backup/restore, database backup) use fully
  wired mock trees
- cmd/network.securitygroup.go, network.subnet.go: register missing
  --project-id flags required by GetProjectID
- Fix nil pointer dereference on LocationResponse.Value in 22 locations
  across 18 command files (list formatters and get display code)
- Fix nil pointer dereference on CreationDate.IsZero() in 17 locations
  across 10 command files
- security.kms.go skipped: KMSClient is a concrete SDK type, cannot mock

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aru-amedeo aru-amedeo changed the title chore: fix TD-009,TD-011, TD-012, TD-016, TD-017, TD-018 chore: fix TD-009,TD-010, TD-011, TD-012, TD-016, TD-017, TD-018 Apr 14, 2026
@aru-amedeo aru-amedeo changed the title chore: fix TD-009,TD-010, TD-011, TD-012, TD-016, TD-017, TD-018 chore: fix Tech Debt Issues Apr 14, 2026
…ards

AWK-generated nil guards in 5 cmd files wrapped pre-existing
'if X != nil && X.Value != ""' checks with a redundant inner
'if X != nil' block. Collapsed to the single richer outer guard.

Files: compute.cloudserver.go, network.elasticip.go, network.subnet.go,
       network.vpc.go, network.vpntunnel.go
…helper functions

Add msgCreated, msgCreatedAsync, msgUpdated, msgUpdatedAsync, msgDeleted,
msgAction helpers to root.go. Replace all ~91 success fmt.Print* calls
across 20 cmd files with consistent output. Fix one double-nil-check in
container.containerregistry.go as a side effect.
- Credentials: replace misleading 'enter both when prompted' flow with
  the correct pattern — --client-secret is prompted interactively with
  echo disabled when omitted; --client-id must be passed on the CLI.
  Added shell-history security note and CI/automation alternative.
- Debug mode: add security warning about credentials/tokens visible in
  HTTP headers (TD-012).
- Output format: document global --output/-o flag (table/json, TD-016).
- Pagination: document --limit/--offset flags on all list commands (TD-017).

Files: README.md, docs/README.md, docs/getting-started.md,
       docs/website/docs/installation.md
@aru-amedeo aru-amedeo marked this pull request as ready for review April 15, 2026 10:50
@aru-amedeo aru-amedeo merged commit 387f302 into main Apr 15, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment