Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(website): replace confusing utils.is_prod() function #2898

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

michaelkedar
Copy link
Member

utils.is_prod() was actually checking if we were running on Cloud Run (returning True if running on 'oss-vdb-test').
Renamed it to is_cloud_run() to be less confusing.
Also created utils.api_url() to use where is_prod was being used incorrectly.

except DefaultCredentialsError:
project = '<unknown>'

# TODO(michaelkedar): Is there a way to avoid hard-coding this?
Copy link
Contributor

Choose a reason for hiding this comment

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

Might it be easier (and potentially safer) to hard-code the production project ID (which is somewhat inescapable, and also more durable) and fail open to the non-production hostname for everything else?

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed it to fall back to api.test.osv.dev.

@michaelkedar michaelkedar merged commit 5d8c55b into google:master Nov 26, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants