Skip to content

refactor(deprecate): complete removal of legacy subcommands#30

Merged
cybersiddhu merged 3 commits into
developfrom
chore/deprecate-legacy-commands
Mar 18, 2026
Merged

refactor(deprecate): complete removal of legacy subcommands#30
cybersiddhu merged 3 commits into
developfrom
chore/deprecate-legacy-commands

Conversation

@cybersiddhu
Copy link
Copy Markdown
Member

Complete the deprecation of legacy ArangoDB CLI subcommands (create-user, update-user, create-database) that are now superseded by ensure-user, ensure-database, and ensure-grant.

Changes

Phase 1-4: Completed in previous commits

  • Removed legacy command handlers and type definitions
  • Deleted legacy test functions
  • Cleaned initial unused imports

Phase 5: Final cleanup of orphaned types and imports

  • types.go: Removed WithClient and UserParams structs (unused after legacy command removal), removed log/slog import
  • user.go: Removed UserForUpdate struct, added back accidental cli/v3 import removal
  • user_test.go: Removed unused imports (log/slog, os, github.com/IBM/fp-go/v2/either), migrated TestConnectionFailure to use ensureUserCommand()
  • database_test.go: Removed unused imports (fmt, log/slog, os, github.com/IBM/fp-go/v2/either, require), deleted mockClient struct

Verification

✅ All 21 tests pass
✅ Zero linting issues
✅ Build succeeds
✅ All legacy command references removed

cybersiddhu and others added 3 commits March 17, 2026 16:41
Remove type definitions that are only used by deprecated create-database,
create-user, and update-user commands. These include DatabaseParams,
SingleDBParams, GrantDBParams, CreateUserParams, CreateUserRouteParams,
CreateSingleDBResult, CreateGrantResult, and CreateDatabaseResult.

Also remove unused imports (Either, IO, Array, Option) after deletion of
their dependent code.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Delete test functions for deprecated create-user, update-user, and
create-database commands from user_test.go, database_test.go, and
logger_test.go. These tests are no longer relevant as the legacy
handlers and functions have been removed.

Removed tests:
- user_test.go: TestCreateUser, TestUpdateUser, TestCreateUserPipelineNewUser,
  TestCreateUserPipelineIdempotent, TestUpdateUserPipelineSuccess, TestUpdateUserPipelineNonExistent
- database_test.go: TestCreateDatabase, TestCreateDatabaseWithUser,
  TestCreateSingleDatabaseNew, TestCreateSingleDatabaseIdempotent,
  TestGrantSingleDatabase, TestGrantSingleDatabaseFailure,
  TestCreateDatabasePipelineWithUser, TestCreateUserAndGrantErrors
- logger_test.go: TestLogCreateUserOutcomeIncludesStatus, TestLogUserUpdatedIncludesStatus,
  TestLogCreateDatabaseOutcomeIncludesStatuses

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Delete WithClient, UserParams, and UserForUpdate structs that were only
used by the removed legacy commands. Remove the mockClient test helper
that was only used by the deleted TestCreateUserAndGrantErrors test.

Clean up unused imports across database_test.go, user_test.go, and
types.go introduced by the legacy code deletions.

Migrate TestConnectionFailure from create-user to ensure-user command
to preserve the connection error coverage without the legacy command.
Remove TestCreateUserAuthFailure which tested the deleted create-user command.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@cybersiddhu cybersiddhu merged commit d369218 into develop Mar 18, 2026
3 of 4 checks passed
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.

1 participant