Skip to content

fix: AE-2316: field validator for serverless idleTimeout#287

Open
jhcipar wants to merge 1 commit intomainfrom
jhcipar/AE-2316/idletimeout-validation
Open

fix: AE-2316: field validator for serverless idleTimeout#287
jhcipar wants to merge 1 commit intomainfrom
jhcipar/AE-2316/idletimeout-validation

Conversation

@jhcipar
Copy link
Contributor

@jhcipar jhcipar commented Mar 25, 2026

adds a field validator to idleTimeout so errors happen at construction time rather than deploy time; backend currently restricts idleTimeout to between 1 and 3600s.

@jhcipar jhcipar changed the title fix: AE-2316: idletimeout must be in valid range fix: AE-2316: field validator for serverless idleTimeout Mar 25, 2026
@promptless
Copy link

promptless bot commented Mar 25, 2026

📝 Documentation updates detected!

New suggestion: Document valid range for idle_timeout parameter


Tip: Filter the Dashboard by labels or assignees to focus on what matters to you 🔎

Copy link
Contributor

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.

Pull request overview

This PR adds construction-time validation for the idleTimeout field on serverless endpoints to match backend constraints (1–3600 seconds), preventing invalid configs from failing later at deploy time.

Changes:

  • Add a Pydantic field_validator for idleTimeout in ServerlessResource.
  • Add unit tests covering invalid and boundary-valid idleTimeout values for ServerlessResource.
  • Add a unit test confirming LiveServerless rejects an invalid idleTimeout.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/runpod_flash/core/resources/serverless.py Enforces idleTimeout range (1–3600) during model construction via field_validator.
tests/unit/resources/test_serverless.py Adds parametrized tests for invalid values and valid boundary values.
tests/unit/resources/test_live_serverless.py Adds a regression test ensuring LiveServerless inherits/enforces the idleTimeout validation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@deanq deanq requested review from KAJdev and deanq March 25, 2026 23:44
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