Repository navigation
Conversation
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.
Summary
run_and_evaluate,async_run_and_evaluate, and the other run helpers returned a staging app link whenever the API base URL didn't exactly match one of the built-in environments, for example a proxy in front of production or a local backend on another port. Run links now match the production, staging, and local environments after normalizing the URL, fall back to the production app for unrecognized hosts, and honor a newSCORECARD_APP_URLoverride for dedicated deployments.Changes
src/scorecard_ai/lib/_helpers.py: resolve the app URL from the threeENVIRONMENTSentries (trailing slashes and scheme/host case ignored); unknown hosts usehttps://app.scorecard.io;SCORECARD_APP_URLoverrides it, minus trailing slashes.tests/lib/test_run_url.py: offline tests for each environment, normalization, unknown hosts, the override, and every run helper.base_app_urlproperty is unchanged; it still falls back to staging for unknown hosts and lives in Stainless-managed code.The TypeScript SDK gets the same rules in scorecard-ai/scorecard-node#51.
Testing
.venv/bin/python -m pytest -q tests/lib/test_run_url.py: 55 passed.ruff check,ruff format --check, andpyrighton the touched files: passed.