Record code runs with pull, commit and push - #4
Conversation
Implement the recorded code run workflow from issue #2: - dat pull <path>: unidirectional rclone copy from DATA into RUN - dat commit -m <message>: write title/body plus automatic info (status running, start time) to metadata.json in eLabFTW standard and create a database entry with status running - dat push: set status finished, update the database and unidirectionally copy RUN to DATA via rclone Add pytest coverage for pull, commit and push, including message parsing, status transitions and the rclone syncs.
|
Review verdict: Request changes Summary: The workflow is broadly implemented, but the eLabFTW metadata layout and push failure handling contain release-blocking correctness issues. No CI runs were available, and local pytest could not run because pytest is not installed. Findings:
Verdict: Request changes — the core metadata persistence and push consistency guarantees are not currently reliable. |
|
Review verdict: Request changes Summary: The workflow is mostly coherent, but Findings:
Verdict: Request changes — |
|
Review verdict: Request changes Summary: The workflow is implemented and path/metadata fixes are present, but Findings:
Verdict: Request changes — failed pushes can falsely finalize runs and lose synchronization with DATA. |
Mark the run finished only after rclone_copy succeeds, so a failed transfer leaves the run state running and retryable instead of falsely finalizing runs that never reached DATA.
|
Review verdict: Request changes Summary: The PR adds the requested commands and basic tests, but several core acceptance and data-safety requirements remain unmet. GitHub reports no CI checks, and local tests cannot collect without Findings:
Verdict: Request changes — the current implementation can overwrite data and persist incorrect run status, while the eLabFTW dependency is obsolete. |
Closes #2
Problem
A scientist running a recorded code run needs commands to manage their
work across a local working directory (RUN) and long-term storage (DATA).
Issue #2 specifies a workflow where the current directory is RUN:
dat pull <path>— pull required inputs/templates from DATA to RUNslurm <run_code>)dat commit -m <message>— record the started run in the database withstatus
runningdat push— set statusfinished, update the database, and pushresults from RUN to DATA
Changes
dat pull <path>: unidirectional copy ofDATA/<path>into thecurrent directory via
rclone copy.dat commit -m <message>: writes the title (and optional body aftera newline) plus automatically retrieved information (status
running,start time) to
metadata.json, and creates a database entry with statusrunningthrough the eLabFTW API.dat push: sets statusfinished, records the finish time, updatesthe eLabFTW database entry, and unidirectionally copies the current
directory from RUN to DATA via rclone.
metadata.jsonusing the eLabFTW standard(
elabftw.extra_fields). DATA location is configurable viaDAT_DATA(file system path or rclone remote); eLabFTW credentials come from
ELAB_URL/ELAB_KEYenvironment variables.pull,commit, andpush, including messageparsing, the running/finished status transition, and the rclone syncs.
Tests
python -m pytest tests/ -q— 7 tests pass.