Skip to content

Reject negative retry durations#3885

Open
pragnyanramtha wants to merge 1 commit into
dstackai:masterfrom
pragnyanramtha:codex/reject-negative-retry-duration
Open

Reject negative retry durations#3885
pragnyanramtha wants to merge 1 commit into
dstackai:masterfrom
pragnyanramtha:codex/reject-negative-retry-duration

Conversation

@pragnyanramtha
Copy link
Copy Markdown

Summary

  • Reject negative ProfileRetry.duration values during configuration parsing.
  • Reuse the same validation for the --retry-duration CLI override.
  • Add regression coverage for model parsing and CLI argument handling.

Why

retry.duration represents the maximum retry window. Previously, values like -1 and "-1" parsed successfully, creating nonsensical retry specs instead of a configuration error.

Validation

  • uv run pytest src/tests/_internal/core/models/test_profiles.py src/tests/_internal/cli/services/configurators/test_profile.py — 14 passed
  • uv run pytest src/tests/_internal/core/models/test_profiles.py src/tests/_internal/core/models/test_runs.py src/tests/_internal/core/models/test_fleets.py — 29 passed
  • uv run ruff check . — All checks passed
  • uv run ruff format --check src/dstack/_internal/core/models/profiles.py src/dstack/_internal/cli/services/profile.py src/tests/_internal/core/models/test_profiles.py src/tests/_internal/cli/services/configurators/test_profile.py — 4 files already formatted

AI Assistance

This PR was written with AI assistance from OpenAI Codex.

@pragnyanramtha pragnyanramtha marked this pull request as ready for review May 17, 2026 03:29
Copilot AI review requested due to automatic review settings May 17, 2026 03:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

2 participants