Backward-compatibilty for forecasting/ingestion endpoints, QA workflow works with older clients - #2432
Backward-compatibilty for forecasting/ingestion endpoints, QA workflow works with older clients#2432nhoening wants to merge 26 commits into
Conversation
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Documentation build overview
10 files changed ·
|
…rsion as ENV variable (for HEMS script to pick up) and in the new backward-compatibility config setting Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…e, which the ingestion tutorial uses; add a config setting to assume a client version which the HEMS script uses Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…h we do by not having an ingestion queue Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…o do not understand the FLEXMEASURES_CLI_CMD setting yet Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Context: - Release QA skipped the ingestion tutorial for clients older than v0.9.4 even though earlier clients expose compatible ingestion methods. Change: - Install pinned releases from PyPI, adapt v0.7 post_measurements calls, skip only its unsupported file upload, and configure legacy responses before ingestion.
Context: - Client v0.7.0 exposes post_measurements while later clients expose post_sensor_data. Change: - Verify current methods remain untouched and legacy clients receive a working alias.
Move the v0.8.0 HEMS fixtures to the next calendar year so uploaded prices remain visible at the simulation prior, and permit its play-mode loop to replace overlapping measurements. Fail QA when older HEMS scripts catch scheduling errors or do not confirm that power and SoC schedules were retrieved.
Use standard find and grep commands to locate v0.8.0 HEMS fixture dates because ripgrep is not available on every Actions runner.
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
The file-upload example moved into a conditional branch, which indented it by four more spaces. Sphinx strips exactly as many characters as `dedent` names, so the rendered snippet kept a stray indent. Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
FLEXMEASURES_LEGACY_SCHEDULEACCEPTED_STATUS_MAX_INCOMPATIBLE_CLIENT_VERSION shipped in v1.0.0rc5. Renaming it to FLEXMEASURES_LEGACY_JOB_RESPONSES_MAX_INCOMPATIBLE_CLIENT_VERSION left hosts that configured it without any signal, since unknown settings are not reported. Those hosts would have started answering 202 to exactly the old clients the setting protects. The former name is now read as a fallback, and logs a deprecation warning once per process asking for the rename. Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
The cutoff was 0.9.1, which is the v2g-liberty version from the setting's documented example, not a flexmeasures-client version. Client 0.9.4 is the first which accepts any 2xx from a data upload, so 0.9.2 and 0.9.3 reject the 202 that a connected ingestion worker produces. QA pointed at those two versions therefore ran without the compatibility config it was meant to exercise, and their ingestion failed. This also brings the cutoff in line with the CLI wrapper gate a few lines below, which already keys off 0.9.4. Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
The failure check listed three exact phrases, and every released HEMS script reports a failed forecast as "Forecast job <id> failed for ...", which matches none of them. Report failures were missed for the same reason. A run could therefore stay green on a forecasting failure, since the only success assertion covered schedule retrieval. Match any reported failure instead of named ones, because the wording differs per client release, and treat a missing CLI as fatal because that silently skips forecasting and reporting. Also require forecasting to confirm itself, accepting both the server-CLI wording used up to 0.8.x and the client-API wording used since 0.9.0. Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
BelhsanHmida
left a comment
There was a problem hiding this comment.
LGTM, @nhoening one question before I sign off.
The PR renames FLEXMEASURES_LEGACY_SCHEDULEACCEPTED_STATUS_MAX_INCOMPATIBLE_CLIENT_VERSION to FLEXMEASURES_LEGACY_JOB_RESPONSES_MAX_INCOMPATIBLE_CLIENT_VERSION. The old name shipped in rc5, tagged 20 Aug six days. FlexMeasures doesn't report unknown settings at startup, so anyone who configured the old name silently drops back to 202 responses on upgrade, for exactly the clients the setting protects.
I pushed 01c899b for that, which reads the old name as a fallback and logs a deprecation warning. I also have a revert ready locally, since six days in one rc may be thin grounds for carrying a deprecated alias into 1.0. Should I push the revert, or leave the fallback in? Comes down to whether any deployment actually set the old name during rc5.
|
Thanks @BelhsanHmida . |
This reverts commit 01c899b. The old setting name landed on main on 2026-08-20 and shipped in v1.0.0rc5, tagged the same day, so it existed under that name for six days in a single release candidate. Carrying a deprecated alias out of that window into 1.0 would imply that configuration names are stable across release candidates, and would leave a removal obligation behind for a setting almost nobody can have configured. It was not an official release, and the weight of the extra code outweighs the narrow protection it offers. Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Context: - flexmeasures-client v0.9.0 passes runner-absolute report config paths to the server-side CLI wrapper Change: - Map absolute HEMS config paths to the existing /hems-configs mount while preserving v0.8.0 relative-path handling
Description
We want to ensure backward-compatibility with older clients also for forecasting and data ingestion endoints which went to the 202 route. Their function would still work as normal, but fm-clients expect not just 2xx but specifically 200 and could break flows on the client side.
This PR dos that, and also improves the ability to signal legancy clients on assets or per QA run, and works on the QA/Release workflow to let us test legacy clients there.
documentation/changelog.rstHere is an overview over the features we are now testing with legacy clients:
mainv0.9.4v0.9.0v0.8.0v0.7.0post_measurements(); file ingestion is unavailable.v0.7.0has no HEMS example, so scheduling is not exercised.The server CLI tutorials run in every workflow, but they are not counted as client backward-compatibility coverage.
How to test
Run the QA/release workflow with this branch, and try various client versions or branches
I ran these fm-clients successfully:
Note: 0.7.0 has no HEMS script yet, as mentioned above.
Here is example output (from the
Determine client QA capabilities):