Skip to content

feat: simplify result queries and add smart reruns#38

Merged
JSChronicles merged 6 commits into
mainfrom
feature/result_rerun
May 4, 2026
Merged

feat: simplify result queries and add smart reruns#38
JSChronicles merged 6 commits into
mainfrom
feature/result_rerun

Conversation

@JSChronicles
Copy link
Copy Markdown
Owner

@JSChronicles JSChronicles commented May 4, 2026

Description

  • Normalizes serialized config_file and config_file_resolved values in result JSONL records to use forward slashes.
  • Updates the result-query test expectation so it passes consistently on Linux GitHub Actions and Windows.
  • Adjusts the CLI parallel-target test stub to return the minimal result metadata _run_single_config_file expects after writing results.

Checklist

  • Python format, lint, and tests (ruff and pytest) were successful.
  • Pre-commit hooks passed locally.
  • Documentation updated if needed.
  • Unit tests added or updated.

Unify the results subcommands into a single `results` command and add `--rerun` support to rerun failed targets. Key changes:

- CLI: replaced results subcommands with a single parser and added flags `--type`, `--target`, `--rerun`, `--dry-run`, and `--benchmark`; validate that report-only flags are not used with `--rerun`.

- Rerun flow: implement `_cmd_results_rerun` to group failures by originating config file, reconstruct the original config, build narrowed targets and re-run them; write results and print follow-up guidance when failures remain.
- Result records: include `config_file` and `config_file_resolved` in JSONL records; write_jsonl_records now accepts an optional config_file and _write_run_results returns a WrittenRunResults dataclass with metadata.

- Filtering and semantics: add `record_type` and `target` to ResultFilters; normalize failed-status matching to treat any non-success as failure; add helpers for status matching and record filtering.

- Rerun target construction: add config_file_for_failure_records and build_rerun_targets which group failures and narrow TargetDescriptor instances to only failed accounts, regions and tasks (including dependent tasks).

- Utilities: add helpers to format display paths and print failure follow-ups; add tests covering new behavior and update docs/README usage examples.

Tests and docs updated accordingly.
Add an optional parser parameter to _validate_results_rerun_args so it can call parser.error for friendly CLI errors (falls back to raising ValueError when no parser is provided). Invoke this validation early in main when command == "results" and --rerun.

Update README to note which report-shaping flags are not supported with --rerun. Adjust tests to compare resolved Path objects for config_file_resolved instead of string endswith checks.
Apply minor formatting changes to CLI and result query function signatures for readability.

Update tests to better mock run results: tests/cli/test_cli_parallel_targets.py now stubs _write_run_results to return a SimpleNamespace with summary and jsonl_path (so _run_single_config_file can proceed), and tests/cli/test_cli_smoke.py fixes a broken string/whitespace assertion and compresses a test args SimpleNamespace to a single line.
Normalize recorded config file paths to POSIX format
@JSChronicles JSChronicles merged commit 567ee81 into main May 4, 2026
7 checks passed
@JSChronicles JSChronicles deleted the feature/result_rerun branch May 4, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant