Skip to content

Add --make-commit to cluv submit to auto-commit tracked changes before job submission#47

Draft
Copilot wants to merge 9 commits into
masterfrom
copilot/add-flag-to-cluv-submit
Draft

Add --make-commit to cluv submit to auto-commit tracked changes before job submission#47
Copilot wants to merge 9 commits into
masterfrom
copilot/add-flag-to-cluv-submit

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

cluv submit currently exits on dirty tracked changes. This PR adds an opt-in --make-commit path that creates a local commit before submission, and records the launched submit command in the commit body.

  • CLI surface

    • Adds --make-commit to cluv submit.
  • Submit flow changes

    • Extends submit(...) with make_commit: bool = False.
    • Keeps existing behavior unchanged when the flag is not used (dirty tracked repo still exits).
    • When --make-commit is enabled and tracked files are dirty:
      • stages tracked changes only via git add -u
      • creates a commit with:
        • subject: cluv submit: auto-commit tracked changes
        • body containing the launched submit command
    • Adds explicit error reporting for failures during auto-staging/auto-commit.
  • Command capture semantics

    • Introduces a submit-command builder used for commit body content.
    • Stored command omits --make-commit to avoid recursive reuse behavior.
  • Tests

    • Adds focused coverage for:
      • dirty repo exit behavior without --make-commit
      • auto-commit path with tracked-only staging
      • commit body command content
      • command reconstruction helper behavior
      • validation that make-commit path requires a command builder
# New opt-in behavior:
await submit(
    cluster="mila",
    job_script=Path("scripts/job.sh"),
    sbatch_args=["--time=00:10:00"],
    program_args=["python", "train.py"],
    make_commit=True,
)

Copilot AI and others added 8 commits May 12, 2026 17:02
Copilot AI changed the title [WIP] Add flag to cluv submit for creating commit before job launch Add --make-commit to cluv submit to auto-commit tracked changes before job submission May 12, 2026
Copilot AI requested a review from lebrice May 12, 2026 17:09
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.

Idea: Add a flag to cluv submit to create a commit for the user before launching a job

2 participants