Skip to content

Add progress reporting for publication approval workflow #284

Closed

Description

@neuromechanist

Problem

The nemar admin publish approve command shows a static spinner ("Running publication workflow...") with no progress updates during the S3 lock step. For datasets with thousands of S3 objects, this step processes 40 objects per batch (due to Cloudflare Workers subrequest limits), requiring dozens or hundreds of sequential API calls with no visibility.

Recent examples:

  • nm000110: 2,374 objects = 60 batches, appeared stuck for days
  • on005515: 4,963 objects = ~124 batches
  • on005516: 6,572 objects = ~164 batches

Users and admins cannot tell if the process is progressing, stuck, or failed.

Proposed solution

  1. CLI progress bar for S3 lock batching: The approvePublication() function in src/lib/api.ts already loops over batches. Add a callback that updates a progress bar showing Locking S3 objects: 120/4963 (2.4%).

  2. Step-level progress in CLI: Show which orchestration step is currently running (e.g., Step 5/15: s3_lock) instead of a generic spinner.

  3. Backend: return total count in every batch response: The API already returns s3_lock_offset and total count. Ensure this is consistently available for the CLI to calculate progress.

  4. Consider single-object locking: Instead of batching 40 objects per Workers request, process one object per request. This trades throughput for reliability and finer-grained progress reporting. The current batching was designed around Workers subrequest limits, but sequential single calls would be more resilient to timeouts.

Context

  • S3 lock uses PutObjectRetention with GOVERNANCE mode, 100-year retention
  • Cloudflare Workers limit: ~50 subrequests per invocation (current batch size: 40)
  • Publication orchestrator: 15 steps total, s3_lock is step 13
  • applyObjectLock() in backend/src/services/s3.ts handles the batching
  • approvePublication() in src/lib/api.ts handles the CLI loop

Activity

  1. added
    enhancement
    on Mar 14, 2026
  2. neuromechanist commented on May 14, 2026

    @neuromechanist
    ContributorAuthor

    Merged via PR #464.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions