Repository navigation
Add dataset deletion system (Epic #128) - #132
Merged
Merged
Conversation
Phase 1 of deletion epic (#128). Adds deleteObjects, deleteDatasetObjects, and deleteStagingObjects to backend/src/services/s3.ts. - S3 Multi-Object Delete API with 1000-key batching - bypassGovernance flag for Object Lock GOVERNANCE mode - Dataset ID and PR number validation - Robust XML response parsing with batch count validation - Try-catch around fetch for partial progress preservation - Refactored applyObjectLock to reuse computeMd5Base64 helper - Integration tests in test/s3-deletion.test.ts (skip when no AWS creds) Closes #123
Phase 2 of deletion epic (#128). Adds deleteRepository to backend/src/services/github.ts. - Idempotent: returns true for 204 (deleted) and 404 (already gone) - Repo name validation (rejects /, .., empty strings) - Tight status check (204/404 only, not all 2xx) - Integration tests in test/github-deletion.test.ts Closes #124
Phase 3 of epic #128: wires S3 and GitHub deletion into a full cascade. - Add shared deleteDatasetCascade service (GitHub, S3, D1 batch delete) - Add DELETE /admin/datasets/:id with DOI/owner permission checks - Add admin delete-dataset CLI command with confirmation prompt - Add scheduled cron cleanup (sandbox 14d, stale nm 90d) - Add last_activity_at migration with backfill - Harden error handling: all steps reflected in deleted field, independent try-catch for cron queries and audit log writes
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR132Version: 🤖 Updated on each push. |
- Fix CLAUDE.md: document deletion system (was still saying "not implemented") - Fix 'completed' -> 'published' status in pub-request blocking query - Return HTTP 207 on partial deletion failure (was always 200) - Handle no-body DELETE requests (don't require JSON body) - Add pub-request guard to cron stale dataset query - Include warnings in cron audit log results - Add explicit dataset_collaborators delete for FK defense-in-depth - CLI: check result.deleted, show spinner.fail on incomplete deletion - Merge duplicate DOI check blocks, simplify S3 summary output
Contributor
Author
PR Review Summary (6 agents, all parallel)Critical Issues Fixed
Important Issues Fixed
Known Gaps (deferred)
Not Fixed (false positives or acceptable)
|
- deleteRepository: reject slash, .., empty repo names (path traversal guard) - hasRole, isDemotion, isValidRole, parseRole: full unit test coverage
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete dataset deletion system: role-based access control, S3 object deletion, GitHub repo deletion, cascade deletion with admin route, CLI command, and scheduled cron cleanup.
Phases (all squash-merged):
Key changes:
DELETE /admin/datasets/:idwith DOI/owner permission checks, active pub-request blockingnemar admin delete-dataset <id>CLI command with confirmation promptdeleteDatasetCascadeshared service: GitHub repo + S3 objects + D1 batch deleteTest plan
bunx biome checkclean in both backend/ and rootbunx tsc --noEmitclean in backend/bun testpasses (existing + new tests)