Skip to content

Feat: hosts can configure deprecation details - #2362

Merged
Flix6x merged 11 commits into
mainfrom
feat/hosts-can-configure-deprecation-details
Sep 7, 2026
Merged

Feat: hosts can configure deprecation details#2362
Flix6x merged 11 commits into
mainfrom
feat/hosts-can-configure-deprecation-details

Conversation

@nhoening

@nhoening nhoening commented Jul 27, 2026

Copy link
Copy Markdown
Member

Description

We fix the deprecation and sunset dates which are sent in headers to users.
Hosts should be able to communicate the dates (and info URLs) which they will actually use for deployments of new FlexMeasures versions.

  • introduce FLEXMEASURES_DEPRECATION_AND_SUNSET so hosts can customize when they deprecate and sunset
  • docs: re-organize config settings into more fitting sections
  • Added changelog item in documentation/changelog.rst

Read the new tests, and re-generate sphinx docs (or look at the RTD build) and read the configurations.

nhoening added 2 commits July 27, 2026 20:02
…when they deprecate and sunset, as well as links to info pages

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening nhoening self-assigned this Jul 27, 2026
@nhoening nhoening added documentation Improvements or additions to documentation API labels Jul 27, 2026
@nhoening nhoening added this to the 1.0.0 milestone Jul 27, 2026
nhoening added 2 commits July 28, 2026 00:30
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening
nhoening requested a review from Flix6x July 28, 2026 07:03
@Flix6x Flix6x modified the milestones: 1.0.0, 1.1.0 Aug 5, 2026
nhoening and others added 5 commits September 7, 2026 00:43
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Felix Claessen <30658763+Flix6x@users.noreply.github.com>
Signed-off-by: Felix Claessen <30658763+Flix6x@users.noreply.github.com>

@Flix6x Flix6x left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems as if the real feature of this PR is not to let hosts configure deprecation details (they could already), but to let the override tackle multiple versions with different details rather than just one version.

Although I consider it likely that only a single deprecation&sunset campaign would be active for the FM API at any given time, I'd happily accept this as an improvement. I only suggest a simplification in the way API versions are formatted.

Let me follow up on this myself and do one more test.

Comment thread documentation/configuration.rst Outdated
Comment thread documentation/configuration.rst Outdated
Comment thread flexmeasures/api/sunset/tests/test_sunset.py Outdated
Comment thread flexmeasures/api/common/utils/deprecation_utils.py Outdated
Comment thread documentation/api/introduction.rst Outdated
…ON_AND_SUNSET

Config keys are now formatted as api-v<version> directly (e.g. "api-v2.0"),
rather than replacing dots with underscores. Documentation and tests follow suit,
and a test asserts that the built-in SUNSET_INFO details still come through for
the sunset v1, v1.3 and v2.0 blueprints when no host override is configured.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01StoU5pGyVkHx1e46bRK7wi
Signed-off-by: F.N. Claessen <claessen@seita.nl>

@Flix6x Flix6x left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks — I've pushed my own suggestions in 3b1ade0, so approving.

One bug worth flagging, which predates my review: the key list in configuration.rst documented api-v1, but that key never matched anything. The lookup key is derived from api_version_being_sunset, which is "1.0" for the v1 blueprint (that's also what produces the "API version 1.0 has been sunset" message), not from the /api/v1 URL prefix. So under the original formula it should have read api-v1_0, and under the new dotted one api-v1.0. I verified both locally:

OLD code (api-v{version.replace('.','_')}), against /api/v1:
  api-v1   -> miss     api-v1_0 -> HIT     api-v1.0 -> miss

NEW code (api-v{version}), against /api/v1:
  api-v1   -> miss     api-v1_0 -> miss    api-v1.0 -> HIT

The other four entries were fine. Docs now list api-v1.0api-v2.0.

Note this leaves the config keys deliberately keyed on the API version rather than the URL segment (/api/v1, /api/v1_1, /api/v2_0). I think that's the right call, but if you'd rather have them mirror the URLs, the cleanest route is setting the first entry's api_version_being_sunset to "1" — that also changes the 410 message, so I left it alone.

I also added test_sunset_falls_back_to_built_in_info, which asserts that with no host override the sunset v1, v1.3 and v2.0 blueprints still return the SUNSET_INFO dates and links (Deprecation/Sunset headers, both Link headers, and the sunset link in the 410 body).

@Flix6x
Flix6x merged commit 46ad3ae into main Sep 7, 2026
13 checks passed
@Flix6x
Flix6x deleted the feat/hosts-can-configure-deprecation-details branch September 7, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants