Skip to content

Phase 1: Admin command restructuring (s3, repo, ci subgroups) - #69

Merged
neuromechanist merged 3 commits into
devfrom
feature/admin-restructure
Jan 24, 2026
Merged

neuromechanist merged 3 commits into
devfrom
feature/admin-restructure

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

  • Restructure admin command into nested subgroups: s3, repo, ci
  • Add backend endpoints for repository visibility (PATCH /admin/datasets/:id/visibility) and CI workflow management (GET/POST /admin/datasets/:id/ci)
  • Add GitHub service functions: setRepoVisibility, checkWorkflowExists, getWorkflowRuns
  • Maintain backward compatibility with hidden regenerate-iam alias at top level
  • Add 15 tests covering help output, auth requirements, backward compat, and admin operations

New command structure

nemar admin s3 regenerate-iam <user>
nemar admin repo public <dataset-id>
nemar admin repo private <dataset-id>
nemar admin ci check <dataset-id>
nemar admin ci add <dataset-id>

Test plan

  • All 136 tests pass (15 new + 121 existing)
  • Biome lint clean
  • TypeScript type check clean
  • Backward compat: nemar admin regenerate-iam still works
  • Auth required for all new commands
  • Non-admin users rejected

Partial work toward #68

Add backend endpoints for visibility management and CI
workflow operations. Restructure CLI admin command into
nested subgroups with backward-compatible hidden alias
for regenerate-iam.
@github-actions

github-actions Bot commented Jan 24, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR69

Version: 0.3.7-PR69.333e03a
Commit: 333e03a


🤖 Updated on each push.

- GitHub service functions now throw on API errors instead of
  returning bare booleans/empty arrays
- checkWorkflowExists distinguishes 404 from other failures
- CLI catch blocks show error details for non-ApiError exceptions
- Audit log writes wrapped in try-catch (non-blocking)
- Fix hardcoded workflow count in deploy response
@neuromechanist

Copy link
Copy Markdown
Contributor Author

PR Review Findings

Critical Issues (Fixed)

  1. GitHub service functions discarded error context - setRepoVisibility, checkWorkflowExists, getWorkflowRuns returned bare booleans/empty arrays on any failure. Now: setRepoVisibility returns {ok, status, error}, the others throw on non-404 API errors.
  2. No network error handling - fetch calls had no try-catch for DNS/connection failures. Now wrapped with descriptive error messages.
  3. getWorkflowRuns returned [] on API errors - Admin would see "no_runs" when the real problem was auth/connectivity. Now throws on non-200.

Important Issues (Fixed)

  1. CLI catch blocks swallowed non-ApiError exceptions - repo public/private, ci check/add showed generic failure with no diagnostics. Now shows error.message.
  2. Audit log failures crashed routes - Visibility and CI deploy routes would 500 if audit log write failed despite the primary operation succeeding. Now wrapped in try-catch.
  3. Hardcoded workflow count - deployed: 3 - result.errors.length was brittle. Now uses WORKFLOW_FILES.length.

Pre-existing Issues (Not in scope)

  • IAM regeneration credential ordering (old key deleted before new key verified in DB)
  • noImplicitAnyLet on versionDeposition variable (line 942)
  • DOI sandbox flag not validated against dataset is_sandbox

All issues in scope have been addressed in commit 5b40204.

@neuromechanist
neuromechanist merged commit 7d164c1 into dev Jan 24, 2026
@neuromechanist
neuromechanist deleted the feature/admin-restructure branch January 24, 2026 00:25

This branch was previously deployed

1 inactive deployment
npm — 333e03ae Deployed Jan 24, 2026 by neuromechanist
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