feat(cli): add autosubmit scheduling for submit#351
feat(cli): add autosubmit scheduling for submit#351dmego wants to merge 12 commits intojunhoyeo:mainfrom
Conversation
|
@dmego is attempting to deploy a commit to the Inevitable Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
5 issues found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="crates/tokscale-cli/src/tui/settings.rs">
<violation number="1" location="crates/tokscale-cli/src/tui/settings.rs:33">
P2: Using command-layer `AutosubmitConfig` directly in settings creates brittle serialization that can silently reset all user settings on schema changes. The type lacks serde defaults, and `load()` uses `unwrap_or_default()` which discards all settings (not just autosubmit) if any field fails to deserialize. Consider adding serde defaults to `AutosubmitConfig` fields or using a separate settings-layer DTO with explicit migration/validation logic.</violation>
</file>
<file name="crates/tokscale-cli/src/main.rs">
<violation number="1" location="crates/tokscale-cli/src/main.rs:898">
P1: Add #[serde(default)] to all boolean fields in SubmitFilterArgs to prevent deserialization failures when config fields are missing</violation>
</file>
<file name="crates/tokscale-cli/src/commands/autosubmit.rs">
<violation number="1" location="crates/tokscale-cli/src/commands/autosubmit.rs:134">
P2: Unbounded interval values may cause chrono timestamp overflow/panic. The `parse_interval_spec` function accepts any u32 value without upper bound validation. Values like u32::MAX days (~4.3 billion days, ~11.7 million years) exceed chrono's DateTime representable range and will cause a panic when added to a timestamp in `is_due()`. Consider enforcing a reasonable maximum interval (e.g., 365 days or 10 years) during parsing.</violation>
<violation number="2" location="crates/tokscale-cli/src/commands/autosubmit.rs:704">
P2: Duplicate manual flag mappings in submit_args_to_cli_args and format_submit_args can diverge from SubmitFilterArgs definitions, causing autosubmit behavior mismatches</violation>
</file>
<file name="README.ja.md">
<violation number="1" location="README.ja.md:433">
P2: Missing `autosubmit run` command in Japanese README documentation. The autosubmit feature supports commands `enable|disable|status|run` but the Japanese documentation only lists `enable`, `status`, and `disable`, making the `run` command undiscoverable for Japanese users who rely on localized documentation.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
4 issues found across 7 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="README.ko.md">
<violation number="1" location="README.ko.md:440">
P3: Autosubmit docs are internally inconsistent: the synopsis omits `tokscale autosubmit run` while the added bullet claims it exists.</violation>
</file>
<file name="README.md">
<violation number="1" location="README.md:443">
P2: README autosubmit synopsis is internally inconsistent: it omits the documented `autosubmit run` subcommand, which can mislead users about available CLI commands.</violation>
</file>
<file name="README.ja.md">
<violation number="1" location="README.ja.md:441">
P2: Autosubmit docs are internally inconsistent: `run` is documented in bullets but missing from the command synopsis block.</violation>
</file>
<file name="crates/tokscale-cli/src/tui/settings.rs">
<violation number="1" location="crates/tokscale-cli/src/tui/settings.rs:76">
P1: `Settings::load()` now drops `autosubmit` on any strict-load failure, which can silently disable and later persistently erase autosubmit config.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Agent-Logs-Url: https://github.com/dmego/tokscale/sessions/14f77845-0d2c-4740-a718-4c41fa9dde28 Co-authored-by: dmego <22118976+dmego@users.noreply.github.com>
Co-authored-by: dmego <22118976+dmego@users.noreply.github.com>
Resolve `main` merge conflicts for autosubmit scheduling branch
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
There was a problem hiding this comment.
Pull request overview
Adds an autosubmit feature to the tokscale CLI to schedule and run automatic submit operations cross‑platform, persisting configuration in settings.json and reporting scheduler state via status.
Changes:
- Introduces
tokscale autosubmit enable|disable|status|run, including scheduler integration (launchd/systemd-user+cron/Task Scheduler). - Refactors submit flags into serializable argument structs and adds machine-readable submit error extraction for autosubmit failure reasons.
- Updates settings loading/saving to be lenient around invalid autosubmit configs and expands CLI/docs/test coverage for the new commands.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/tokscale-cli/tests/cli_tests.rs | Adds integration tests covering autosubmit help/contracts/status/disable/run minimal logging. |
| crates/tokscale-cli/src/tui/settings.rs | Adds persisted autosubmit config support with lenient parsing and invalid-config preservation. |
| crates/tokscale-cli/src/main.rs | Refactors submit args for serialization; adds autosubmit command wiring + machine-readable submit error prefix. |
| crates/tokscale-cli/src/commands/mod.rs | Exposes the new autosubmit command module. |
| crates/tokscale-cli/src/commands/autosubmit.rs | Implements autosubmit config, scheduler install/probe/uninstall, run locking, and status/degraded logic. |
| README.md | Documents autosubmit usage and CLI flag expectations. |
| README.zh-cn.md | Documents autosubmit usage (ZH-CN). |
| README.ko.md | Documents autosubmit usage (KO). |
| README.ja.md | Documents autosubmit usage (JA). |
| Cargo.lock | Bumps crate versions for the release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: dmego <22118976+dmego@users.noreply.github.com>
chore(merge): resolve autosubmit PR conflicts with latest main
Closes #123
Summary
tokscale autosubmit enable|disable|status|runsubmitfilters while keeping--dry-rununavailable in autosubmitsettings.jsonand report both saved state and live scheduler statelaunchdsystemd --user, withcronfallbacksubmitNotes
autosubmit runperforms a manual one-shot due check using the saved config--no-spinnerexample copy-paste safemainhas been merged into this branch to keep the PR conflict-free against the current baseValidation
cargo test -p tokscale-clicargo run -p tokscale-cli -- submit --helpcargo run -p tokscale-cli -- autosubmit enable --helpcargo run -p tokscale-cli -- autosubmit statuscargo run -p tokscale-cli -- autosubmit disablecargo run -p tokscale-cli -- autosubmit enable --interval 2h --dry-runlaunchctl/systemctl --user/schtasks)