Skip to content

Conversation

@Arlodotexe
Copy link
Member

@Arlodotexe Arlodotexe commented Aug 27, 2025

Summary

Add first-class delete commands for the three core entities (user, project, publisher) to allow targeted cleanup and parity with existing create/get/list flows.

Motivation

  • Provide a focused delete operation to remove a problematic entity without deleting the entire repo.
  • Feature parity: create/get/list existed for all three entities; delete was missing.

What’s in this PR

  • New CLI commands:
    • user delete — wacsdk user delete --repo <repo-id> --user-id <ipns-id>
    • project delete — wacsdk project delete --repo <repo-id> --project-id <ipns-id>
    • publisher delete — wacsdk publisher delete --repo <repo-id> --publisher-id <ipns-id>
  • Commands are registered within their respective command groups.
  • Calls through the SDK repositories to resolve a modifiable instance and invoke DeleteAsync, then saves repo settings.
  • XML docs added to satisfy WarningsAsErrors.

Implementation notes

  • Repositories: RepositoryContainer is used to compose interdependent repositories.
  • Delete flow: GetAsync(id) → cast to modifiable type → Repository.DeleteAsync(modifiable, ct)repoSettings.SaveAsync(ct).
  • No manual cleanup fallback logic is included; the commands are intentionally straightforward.

Usage examples

wacsdk user delete --repo default --user-id k51qzi5uqu5dl...
wacsdk project delete --repo default --project-id k51qzi5uqu5ab...
wacsdk publisher delete --repo default --publisher-id k51qzi5uqu5xy...

Testing / Verification

  • Built locally with warnings-as-errors; added XML comments to new public members.
  • Manual smoke tests:
    • Create an entity, then delete it; list no longer shows the entity.
    • Delete logs indicate key removal via the repository base logic and settings save completes.

Breaking changes

  • None. Adds new commands only.

Future work

  • Consider a soft-delete flag (e.g., unlist then purge) if user workflows need it.
  • Add unit/integration coverage for delete flows if a test harness is extended for IPNS key lifecycle.

Checklist

  • Commands added and wired into command groups
  • Build passes locally with warnings-as-errors
  • Minimal logs and help text added

Branch

feat/entity-delete-commands

… in command groups; doc comments for warnings-as-errors
@Arlodotexe Arlodotexe requested a review from yoshiask August 27, 2025 16:12
@Arlodotexe Arlodotexe enabled auto-merge August 27, 2025 16:13
Copy link
Member

@yoshiask yoshiask left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@Arlodotexe Arlodotexe merged commit 10970af into main Aug 27, 2025
1 check 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.

3 participants