Skip to content

fix(jobs): accept managed_load as --job-type filter (#160)#195

Merged
anoop-narang merged 1 commit into
mainfrom
fix/160-jobs-list-managed-load-filter
Jun 30, 2026
Merged

fix(jobs): accept managed_load as --job-type filter (#160)#195
anoop-narang merged 1 commit into
mainfrom
fix/160-jobs-list-managed-load-filter

Conversation

@anoop-narang

Copy link
Copy Markdown
Contributor

Closes #160.

TL;DR

The reported crash is already fixed; this PR closes the remaining filter gap.

What #160 actually is, after investigation

The issue was filed against CLI 0.5.0 / SDK 0.3.1. Verifying against current main (not the issue body):

  • Crash already resolved. The CLI now depends on SDK 0.6.0 (commit c803d22, shipped in 0.10.0), whose JobType enum includes ManagedLoad. A managed_load row in jobs list now deserializes cleanly instead of failing the whole response. Proven by a new test (list_response_with_managed_load_deserializes) that passed before this PR's code change.
  • No runtimedb changes needed. runtimedb/openapi.yaml already defines all JobType variants and the SDK (generated in hotdata-dev/sdk-rust) matches it.
  • Remaining gap (this PR). --job-type managed_load was still rejected — both the clap value_parser (command.rs) and parse_job_type (jobs.rs) were stale, last touched when the SDK had only 4 user-facing types.

Why managed_load is correct to surface to customers

runtimedb's is_maintenance() (#740) deliberately hides only the 5 internal maintenance jobs (ducklake_vacuum, ducklake_orphan_cleanup, result_deletion, stale_result_cleanup, result_retention) from listings — and managed_load is intentionally not among them. It's the job created by hotdata databases load. The displayed TYPE stays the raw managed_load token, consistent with the other four job types (no friendly-label layer exists today; introducing one is a separate, all-types decision).

Changes

  • src/command.rs: add managed_load to the --job-type value_parser.
  • src/jobs.rs: map managed_loadJobType::ManagedLoad in parse_job_type; add two regression tests.

Verification

  • cargo test --bin hotdata: 237 passed.
  • cargo clippy: clean on touched files.
  • hotdata jobs list --job-type managed_load is accepted; invalid values list managed_load among possible values.

Follow-ups (out of scope, not done here)

  • The customer-facing docs at www.hotdata.dev/content/docs/cli-reference.md list the same stale --job-type set and should add managed_load.
  • Optional SDK hardening: a #[serde(other)] catch-all in hotdata-dev/sdk-rust's generated JobType so future unknown server job types degrade gracefully instead of crashing jobs list.

The jobs list crash on managed_load rows was already resolved by the
SDK 0.6.0 bump (c803d22), whose JobType enum carries the ManagedLoad
variant the server emits for `databases load`. This closes the
remaining gap: the CLI's --job-type filter still rejected managed_load
because both the clap value_parser and parse_job_type were stale (last
touched when the SDK only had 4 user-facing types).

managed_load is intentionally customer-visible: runtimedb's
is_maintenance() (#740) hides only the 5 internal maintenance jobs from
listings, and managed_load is deliberately not among them. Displayed
TYPE stays the raw token, consistent with the other job types.

Adds regression tests proving a managed_load row deserializes and that
the filter token maps to JobType::ManagedLoad.

@claude claude Bot 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.

Change is correct and well-scoped: managed_load is added to both the clap value_parser and parse_job_type, with regression tests covering deserialization and parsing.

super nit (not blocking): two in-repo docs still list the stale --job-type set and now omit managed_load:

  • README.md:299--job-type accepts: data_refresh_table, data_refresh_connection, create_index.
  • skills/hotdata/SKILL.md:294 — same list.

The PR's Follow-ups section only calls out the external docs site (www.hotdata.dev); these two are in-repo and directly affected, so worth updating here while you're in the area.

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@anoop-narang anoop-narang merged commit 5b3989d into main Jun 30, 2026
14 checks passed
@anoop-narang anoop-narang deleted the fix/160-jobs-list-managed-load-filter branch June 30, 2026 07:16
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.

jobs list crashes on managed_load job type (SDK enum missing variant)

1 participant