Skip to content

Write an hourly running jobs status into a separate YAML#886

Merged
LeenFahoum merged 1 commit into
mainfrom
run_report
Jun 11, 2026
Merged

Write an hourly running jobs status into a separate YAML#886
LeenFahoum merged 1 commit into
mainfrom
run_report

Conversation

@alongd

@alongd alongd commented May 7, 2026

Copy link
Copy Markdown
Member

don't spam the ARC.log if the report repeats it self and ARC is idle. outsource the running jobs report into a separate YAML, only update it when needed, and drop a heartbeat line into ARC's log file.

addresses #694

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces repetitive “currently running jobs” log spam by moving periodic status reporting out of ARC.log and into a dedicated YAML file, while logging only short heartbeat lines when the status hasn’t changed.

Changes:

  • Added Scheduler.report_running_jobs_snapshot() and wired it into the hourly scheduler reporting path.
  • Introduced arc.common.append_yaml_document() to append multi-document YAML snapshots.
  • Added unit tests for both the scheduler snapshot reporting and the YAML append helper.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
arc/scheduler.py Writes periodic running-jobs/active-pipes snapshots to running_jobs.yml and logs a heartbeat when unchanged.
arc/scheduler_test.py Adds a test ensuring snapshots append only when the status changes.
arc/common.py Adds append_yaml_document() helper for multi-document YAML snapshot files.
arc/common_test.py Adds tests for append_yaml_document().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread arc/scheduler.py Outdated
Comment on lines +858 to +865
payload = {'running_jobs': dict(self.running_jobs),
'active_pipes': list(self.active_pipes.keys())}
n_species = len(self.running_jobs)
n_jobs = sum(len(v) for v in self.running_jobs.values())
n_pipes = len(self.active_pipes)
summary = f'{n_species} species / {n_jobs} jobs / {n_pipes} active pipes'
if payload == self._last_status_payload:
logger.info(f'Status unchanged: {summary}.')
Comment thread arc/scheduler.py Outdated
Comment on lines +851 to +870
def report_running_jobs_snapshot(self) -> None:
"""
Append a snapshot of the currently running jobs and active pipes to
``<project>/running_jobs.yml`` (each snapshot is a separate YAML
document prefixed with ``---``). If the payload is identical to the
previous snapshot, only a one-line heartbeat is logged to ARC.log.
"""
payload = {'running_jobs': dict(self.running_jobs),
'active_pipes': list(self.active_pipes.keys())}
n_species = len(self.running_jobs)
n_jobs = sum(len(v) for v in self.running_jobs.values())
n_pipes = len(self.active_pipes)
summary = f'{n_species} species / {n_jobs} jobs / {n_pipes} active pipes'
if payload == self._last_status_payload:
logger.info(f'Status unchanged: {summary}.')
return
snapshot = {'timestamp': datetime.datetime.now().isoformat(timespec='seconds'),
**payload}
append_yaml_document(self.running_jobs_snapshot_path, snapshot)
logger.info(f'Status changed: {summary}; snapshot appended to running_jobs.yml.')
@codecov

codecov Bot commented May 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.05%. Comparing base (6f07ac3) to head (c801163).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #886      +/-   ##
==========================================
+ Coverage   63.00%   63.05%   +0.05%     
==========================================
  Files         113      113              
  Lines       37958    37970      +12     
  Branches     9956     9955       -1     
==========================================
+ Hits        23914    23943      +29     
+ Misses      11163    11147      -16     
+ Partials     2881     2880       -1     
Flag Coverage Δ
functionaltests 63.05% <ø> (+0.05%) ⬆️
unittests 63.05% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Overwrite a single timestamped snapshot only when the status changed;
otherwise just log a one-line heartbeat to ARC.log.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@LeenFahoum LeenFahoum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@LeenFahoum LeenFahoum merged commit 38b496f into main Jun 11, 2026
8 checks passed
@LeenFahoum LeenFahoum deleted the run_report branch June 11, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants