Skip to content

refactor: split env.go handlers into domain files#188

Merged
xaaha merged 2 commits intomainfrom
refactor-env-func
May 1, 2026
Merged

refactor: split env.go handlers into domain files#188
xaaha merged 2 commits intomainfrom
refactor-env-func

Conversation

@xaaha
Copy link
Copy Markdown
Owner

@xaaha xaaha commented May 1, 2026

Summary

  • Split pkg/userFlags/env.go (918 lines) into 6 focused handler files, each with co-located command factory and handler functions
  • Created env_crud.go, env_list.go, env_edit.go, env_keys.go, env_recipients.go, env_sync.go
  • Split env_test.go (924 lines) into matching test files: env_crud_test.go, env_list_test.go, env_edit_test.go
  • Added newEnv*Cmd() factories to env_rotate_key.go and env_migrate.go
  • Shrunk subcommands.go from 784 to 450 lines — newEnvCmd() is now a clean assembly list
  • Moved StdoutHeaders to pkg/utils/table.go (exported, reusable next to PrintTable)
  • Deleted env.go entirely — shared constants moved to their respective consumer files

Zero behavior changes. 88/88 tests pass. mise check all green.

Part of epic #125.

Test plan

  • mise check passes (lint, vet, tests)
  • 88/88 existing tests still pass — no test logic changed
  • hulak env set/get/delete/list/keys/edit all work as before
  • hulak env import-key/export-key work as before
  • hulak env add-recipient/remove-recipient/list-recipients work as before
  • hulak env rotate/rotate-key/migrate work as before

@xaaha xaaha requested a review from pthapa1 May 1, 2026 18:59
@xaaha xaaha merged commit aa1d320 into main May 1, 2026
2 checks passed
@xaaha xaaha deleted the refactor-env-func branch May 1, 2026 19:39
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