Repository navigation
v1: translate model names in metadata, fix the docs redirect scheme - #392
Merged
Merged
Conversation
devsjc
approved these changes
Sep 16, 2026
suvanbanerjee
approved these changes
Sep 16, 2026
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.
Pull Request
Description
Two small ones that missed #391.
Model names in
detail=fullmetadata. Zak spotted that the metadata we now parse into an object shows the DP's forecaster names instead of the public API "pretty" ones, soapp_versioncame back keyed by things likepvnet_day_aheadthat a user won't recognise and can't use in the API. They're now translated to the latest API names (ecmwf_moand friends), keys and string values alike, on exact matches only so anything not in that list passes straight through. The mapping is built fromcountry_config, so a new model is covered without a second list to keep in step.N.B. – a DP name sometimes does work as input:
pvnet_day_aheadandpvnet_ecmwfare accepted, but only because they're retired public slugs we kept as aliases that happen to match the DP names.pvnet_v2was never public so it 400s, and the NL ones all 400. And since aliases pin the adjuster off, a user copyingpvnet_day_aheadout of the metadata and passing it back gets the unadjusted forecast whereecmwf_mogives them the adjusted one – same model, quietly different numbers. This is down to user behaviour though, and there are loads of ways one can confuse themself with/without the adjuster and other params set, so I think this is fine.One extra note: a model and its
_adjustvariant share one API name, so if both ever happen to be in the same object one would overwrite the other. In that case they keep the DP names rather than lose a version number, but I can't see when this would ever happen as it is atm.OAuth redirect URL on deployed environments. #391 started sending the redirect explicitly so Scalar couldn't lose it, but took the scheme from
request.url, which ishttpbehind the load balancer since TLS is terminated upstream. No proxy locally so it looked fine, but on dev it wasn't which was odd.. turns out the docs page was returning Auth0 anhttp://callback. Now usesX-Forwarded-Protowhere it's set.The general version is still open, if we want it:
gunicorn'sUvicornWorkeronly trusts that header fromforwarded_allow_ips, which defaults to loopback, so anything else building a URL fromrequest.urlhas the same problem. SettingFORWARDED_ALLOW_IPSon the container fixes it everywhere, but that's a deployment change rather than a code one so #393 has it and we can revisit later.Checklist: