Skip to content

Fix Dashboard re-run commands for boolean and optional parameters - #3470

Open
rioyu123 wants to merge 1 commit into
spotify:masterfrom
rioyu123:codex/rerun-boolean-parameters
Open

rioyu123 wants to merge 1 commit into
spotify:masterfrom
rioyu123:codex/rerun-boolean-parameters

Conversation

@rioyu123

@rioyu123 rioyu123 commented Oct 9, 2026

Copy link
Copy Markdown

Description

Build the Dashboard's "Command to re-run" from the task's parameter definitions, so boolean and optional values are formatted the way the command-line parser expects.

The worker sends the formatted parameters to the scheduler alongside the existing task metadata:

  • Implicit booleans use a bare --flag when true and are omitted when false.
  • Explicit booleans use --flag=true or --flag=false.
  • Optional parameters set to None are omitted.
  • Other values use --name=value, with POSIX-shell quoting via shlex.join. This also preserves values that start with -.

Omission is only allowed when the effective default restores the same value. If it would change the task, or the default cannot be read, the Dashboard shows that a re-run command is unavailable. For example, omitting an implicit boolean set to False would be wrong if its configured default is True.

The command assumes the same Luigi configuration as the worker. Task IDs, parameter serialization and the command-line parser are unchanged. The new metadata is optional; older workers, schedulers and saved scheduler state retain the existing display. Private parameters remain excluded.

Motivation and Context

Fixes #3363. The current Dashboard JSON-quotes every serialized value, producing commands such as --rerun "False". An implicit BoolParameter is a flag rather than a flag/value pair, so copying that command fails. Optional values also need their parameter definitions to determine whether omission preserves the original task.

#3456 was an earlier attempt at this issue and was closed by its author. This is a separate implementation.

Have you tested this? If so, how?

  • Added 12 tests covering parser round trips and task identity, boolean modes, optional values, ordinary empty strings, shell quoting, leading - values, private parameters and defaults that cannot be reproduced by omission.
  • Verified that an invalid configured boolean default does not prevent scheduling a task with an explicit value.
  • Covered worker-to-scheduler metadata, JSON serialization, persisted scheduler state and older-worker requests.
  • Linux, Python 3.12 with locked dependencies: core suite 1,521 passed, 55 skipped; Ruff check/format and Mypy passed. Contrib and external-service tests were excluded, as in the core test configuration.
  • The new tests also passed on Windows.
  • A Node component check ran the actual showErrorTrace function and Mustache template for current, empty, unavailable and legacy responses. Full-browser testing has not been performed.

Implemented with Codex and independently reviewed with Claude.

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.

Incorrect serialization for "Command to rerun" for BoolParameter and OptionalParameter

1 participant