Repository navigation
Add comprehensive Zenodo sandbox testing - #82
Conversation
Critical fixes: - Add DELETE /admin/zenodo/deposition/:id endpoint for test cleanup - Fix environment detection to fail closed (no default fallback) - Improve cleanup error handling with failure tracking - Fix rate limit documentation inconsistency - Fix IAM revocation security hole (partial revocation on failure) - Fix incomplete webhook test with proper assertions - Fix DELETE status code expectation (204 only) Security improvements: - IAM revocation now continues on failure (prevents security hole) - Mark users as revoked_iam_pending when S3 cleanup fails - Track IAM revocation failures for follow-up - Provide actionable guidance in error responses - Environment validation prevents production DOI in dev Test improvements: - Cleanup failures now tracked and reported - Webhook test validates token rejection properly - DELETE expects correct 204 status code Documentation: - Clarify rate limit math (60 req/min with 400ms safety margin)
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR82Version: 🤖 Updated on each push. |
Critical Issues Fixed ✅All blocking and critical issues from the PR review have been addressed: 1. ✅ DELETE Endpoint Added (BLOCKING)File:
2. ✅ Environment Detection Fixed (CRITICAL)File:
3. ✅ Cleanup Error Handling Improved (CRITICAL)File:
4. ✅ Rate Limit Documentation Fixed (CRITICAL)Files:
5. ✅ IAM Revocation Security Hole Fixed (CRITICAL)File:
6. ✅ Webhook Test Fixed (IMPORTANT)File:
7. ✅ DELETE Status Code Fixed (IMPORTANT)File:
Security ImpactThe IAM revocation fix is critical for security: Before: If IAM revocation failed (network issue, AWS error), the entire revocation was blocked. User stayed "approved" with active S3 credentials. After: If IAM revocation fails:
This prevents the security hole where revoked users could still access S3 data. TestingAll changes compile and lint successfully: ✅ bun run tsc --noEmit (no errors)
✅ bun run lint (14 files checked)Next StepsRemaining improvements (can be follow-up PR):
|
- Use owner AWS credentials for forced IAM cleanup - List ALL access keys (not just stored one) - Continue on error with detailed step tracking - Return success if ANY access key deleted - Add comprehensive error reporting - Track partial success/failure per step Addresses security hole where S3 credentials remained active when IAM user deletion failed.
- Split 'doi' into 'doi create' and 'doi info' subcommands - Now shows --sandbox flag in admin doi create documentation - Regenerated all command docs from CLI help (single source of truth)
- Move 'already has DOI' check before environment validation - Only check ENVIRONMENT for production DOIs (skip for sandbox) - Webhook returns 401 for missing secret (not 500) Fixes: - Test expecting 'Production DOI blocked' now gets correct error - Sandbox DOI creation skips environment checks - Webhook tests get 401 (unauthorized) instead of 500 (server error)
The ADR is authoritative over other docs, and review found several of its
claims contradicted by the code it describes. Corrected rather than
softened, so the verdict matches what ships:
- "leaves the issue exactly as it was" was false once apply was on. The
invariant is split: a DECIDING failure leaves the issue byte-for-byte
unchanged, an ACTING failure cannot promise that, so the write order is
now part of the decision.
- "a 28-issue backlog drains over two runs" was false; there was no cursor
and no rotation. Replaced with what the code does and why there is no
stored cursor.
- "the admin route stays callable on staging as a dry run" read as a safety
property the route did not have. Both fences are now stated.
- "the rollup is a pressure valve, not the normal mode" could not hold
while nothing closed a rollup: `rollupOpen` is the hysteresis, so with no
writer the cap silently became RESUME. The sweep releasing it is now the
stated rule, with the alternative ("leave it to a human") declined.
- The band is 6-9, not 5-10: the rule latches at CAP and releases at
RESUME, both inclusive.
- Counts, dates and the burst size: 29 open as of 2026-09-09 stated once
with its date rather than restated in eleven comments, and the
2026-07-22 burst was 15 issues (#68-#82), not 14 -- #83 in that range is
a pull request.
Adds the two refusals that were missing: an empty comparison
(`expectedCount === 0`) is not a passing one, and the cause label is
classified from the stored `last_error` rather than the incoming callback.
Implements comprehensive Zenodo sandbox testing strategy.
Changes
Test Coverage Expansion
CI/CD Integration
CLI Improvements
Documentation
Safety Measures
Test Coverage
7 test suites with 22 tests:
Files Modified
Verification
Next Steps
Closes #76