Lock in compatibility with FlexMeasures API v3.0-32 job responses (202/422)#219
Merged
Conversation
FlexMeasures is moving to consistent 202 (Accepted) responses for asynchronous job handling (FlexMeasures/flexmeasures#2171): - trigger endpoints respond 202 ACCEPTED with job_id and job_monitor_url (previously 200 PROCESSED) - GET /sensors/<id>/schedules/<uuid> responds 202 while the job is pending and 422 with a failure message when the job failed (previously 400 UNKNOWN_SCHEDULE for both) The client already handles all of this - check_for_status() accepts any 2xx and check_response() polls on 202 GET responses - so these tests just pin that behavior against regressions, while the existing tests keep covering older servers (200 triggers, 400-while-pending polling). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0199yMJvFFPK5HyQRJAMpHpU Signed-off-by: F.N. Claessen <felix@seita.nl>
Coverage Report for CI Build 29180012604Coverage remained the same at 96.359%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds regression tests pinning the client's compatibility with the upcoming FlexMeasures API v3.0-32 async-job semantics (FlexMeasures/flexmeasures#2171):
job_idandjob_monitor_url(previously 200 PROCESSED) — covered bytest_trigger_schedule_accepts_202_accepted.test_get_schedule_failed_job_raises(the 202-pending polling case was already covered bytest_get_schedule_polling_accepted).Why no production changes?
The client is already forward-compatible:
check_for_status()accepts any 2xx, andcheck_response()polls on 202 GET responses. These tests just make sure that stays true. Compatibility with older servers (200 triggers, 400-while-pending polling) is retained and still covered by the existing tests.🤖 Generated with Claude Code
https://claude.ai/code/session_0199yMJvFFPK5HyQRJAMpHpU