Skip to content

Lock in compatibility with FlexMeasures API v3.0-32 job responses (202/422)#219

Merged
Flix6x merged 1 commit into
mainfrom
feat/accept-202-trigger-responses
Jul 13, 2026
Merged

Lock in compatibility with FlexMeasures API v3.0-32 job responses (202/422)#219
Flix6x merged 1 commit into
mainfrom
feat/accept-202-trigger-responses

Conversation

@Flix6x

@Flix6x Flix6x commented Jul 12, 2026

Copy link
Copy Markdown
Member

What

Adds regression tests pinning the client's compatibility with the upcoming FlexMeasures API v3.0-32 async-job semantics (FlexMeasures/flexmeasures#2171):

  • Trigger endpoints respond 202 (Accepted) with job_id and job_monitor_url (previously 200 PROCESSED) — covered by test_trigger_schedule_accepts_202_accepted.
  • Schedule retrieval reports unfinished jobs with 202 (pending, polled) and failed jobs with 422 + failure message (previously 400 UNKNOWN_SCHEDULE for both) — covered by test_get_schedule_failed_job_raises (the 202-pending polling case was already covered by test_get_schedule_polling_accepted).

Why no production changes?

The client is already forward-compatible: check_for_status() accepts any 2xx, and check_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

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>
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 29180012604

Coverage remained the same at 96.359%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 714
Covered Lines: 688
Line Coverage: 96.36%
Coverage Strength: 2.89 hits per line

💛 - Coveralls

@Flix6x
Flix6x merged commit ccda2e2 into main Jul 13, 2026
12 checks passed
@Flix6x
Flix6x deleted the feat/accept-202-trigger-responses branch July 13, 2026 06:28
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