Skip to content

WIP: Add --wait flag to babs status#354

Draft
asmacdo wants to merge 1 commit intoPennLINC:mainfrom
asmacdo:status-wait
Draft

WIP: Add --wait flag to babs status#354
asmacdo wants to merge 1 commit intoPennLINC:mainfrom
asmacdo:status-wait

Conversation

@asmacdo
Copy link
Copy Markdown
Collaborator

@asmacdo asmacdo commented Mar 25, 2026

Add --wait flag to babs status

Problem

babs status is a snapshot — it prints the current state and exits.
Automation needs to wait for jobs to finish before running babs merge, so end to end users must write wrapper scripts that poll squeue.
My current workaround (while squeue -u $USER -h | grep -q .; do sleep 60; done) catches ALL user jobs, not just the ones for the current BABS project.

Changes

Add --wait and --wait-interval flags to babs status:

# Poll until all submitted jobs complete or fail (default: check every 5 min)
babs status --wait

# Custom interval
babs status --wait --wait-interval 30

Behavior:

  • Prints job status summary each iteration (same as babs status)
  • Exits 0 when all submitted jobs have results
  • Exits 1 if any jobs failed, or if no jobs have been submitted
  • Exits 130 on Ctrl-C (clean handling)
  • Project-scoped: only watches jobs from this BABS project, not all user jobs

🤖 Generated with Claude Code

Polls until all submitted jobs complete or fail, then exits.
Exit code 0 if all succeeded, 1 if any failed or none submitted,
130 on Ctrl-C.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.57%. Comparing base (3c4c54b) to head (591e262).

Files with missing lines Patch % Lines
babs/cli.py 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #354      +/-   ##
==========================================
+ Coverage   79.36%   79.57%   +0.21%     
==========================================
  Files          16       16              
  Lines        1846     1875      +29     
  Branches      311      315       +4     
==========================================
+ Hits         1465     1492      +27     
- Misses        267      268       +1     
- Partials      114      115       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants