Repository navigation
Treat unknown ROBOFLOW_ENVIRONMENT values as prod, accept 'production' - #3093
imbgar-roboflow wants to merge 1 commit into
Conversation
Any value other than 'prod' used to select staging. EU production async-serverless consumers set ROBOFLOW_ENVIRONMENT=production, so on v1.7.2 their RF_API_BASE_URL and BUILDER_ORIGIN defaults resolved to EU staging hosts. Accept 'production' as prod, keep 'staging', and warn and fall back to prod for anything else. An empty value falls through to the legacy PROJECT signal as if unset.
|
👋 Thanks for the pull request! Here is how automated Claude review works here, so you spend credits (and reviewer time) wisely. 🚦 This PR is marked Ready for review, so automated Claude review will run — and every pass spends real credits. Warning 💸 The Claude reviewer bills in credits, not vibesAutomated review spins up a real agent that reads real code and spends real credits on every pass. It is glad to help — but it is not a rubber duck, a linter you poke in a loop, or a substitute for reading the contributing guide. Treat it like an expensive senior reviewer whose time you booked, and show up prepared. Draft when unsure, Ready when you mean it:
However you get there, arrive prepared:
Reviews are not free. A draft costs nothing to review; a Ready PR is a promise that it is worth reviewing.
|
|
🤖 Claude review started at commit New commits are not auto-reviewed. Add the |
Claude review summarySkills: review-core-infra, review-sdk, review-inference-models-pkg, review-topic-backward-compat-and-versioning, review-topic-external-contract-and-silent-fallback, review-topic-secure-gateway-url-wrapping, review-topic-test-hygiene I traced all three resolver copies ( One release item is open (below), so this is not yet a pass. 📋 Changelog required (user-visible behavior change)This changes the user-visible resolution of Maintainers: this requires a release-time version change for inference-models (behavior change to Minor (non-blocking): in Re-review is not automatic: add the Reviewed at HEAD: 3dcf62b |
|
@imbgar-roboflow what we gain by silently fall back to prod on unknown values instead raising error? |
|
Closing: out of scope for this pass. The EU prod values are being fixed directly in roboflow/async-serverless#461. |
What
ROBOFLOW_ENVIRONMENTnow acceptsprod(orproduction) andstaging. Any other value warns and falls back toprod. Before this change, anything other thanprodselected staging.Applied identically to the three copies of the resolver:
inference_sdk/regions.pyinference/core/utils/regions.pyinference_models/inference_models/configuration.pyAn empty
ROBOFLOW_ENVIRONMENTis treated as unset, so the legacyPROJECTsignal still decides.Why
The EU production async-serverless consumers set
ROBOFLOW_ENVIRONMENT=production. On v1.7.2 (which includes #2701), that value selects staging, so the two defaults they don't override resolve to EU staging:RF_API_BASE_URL→https://api.roboflow-eu.one(inference_sdk WebRTC TURN config and model stats)BUILDER_ORIGIN→https://app.roboflow-eu.oneAPI_BASE_URLandROBOFLOW_API_HOSTare set explicitly on those pods, so the main API traffic is unaffected. The values are also being corrected toprodin async-serverless. This change makes the resolver safe regardless.Falling back to prod is also the safer direction for typos. A misspelled production value used to point production traffic at staging without any error. Now a misspelled staging value reaches prod with staging credentials, which fails loudly, and a warning is logged.
Values currently set across the org's deployments:
prod,staging, andproductionin the two EU async-serverless files. None of them changes meaning, exceptproduction, which now resolves correctly.Sibling: roboflow/roboflow-python#513 uses the same rules.
Testing
tests/inference_sdk/unit_tests/test_regions.py: 15 passedtests/inference/unit_tests/core/utils/test_regions.py: 16 passed (run against the module in isolation; the module is identical to the SDK copy)inference_models/tests/unit_tests/test_configuration.py: 23 passedtests/inference_cli/unit_tests/lib/test_env.py: 11 passed