Garden-AI / garden

https://garden-ai.readthedocs.io
MIT License
19 stars 4 forks source link

target prod by default #409

Closed OwenPriceSkelly closed 7 months ago

OwenPriceSkelly commented 7 months ago

fixes #284

Overview

The default values in garden_ai.constants now point at prod instead of dev. This can be controlled with the environment variable GARDEN_ENV=dev or GARDEN_ENV=prod.

So that we don't need to worry about accidentally hitting prod ourselves if that env var is left unset, I also added a .env.shared file at the project root which sets GARDEN_ENV=dev. Because this file isn't distributed to pypi, this only applies if the garden-ai executable was installed from source (which is always the case in e.g. a poetry shell).

The .env.shared won't override existing values, so this works like you'd expect:

$ (plain install) garden-ai do something                # hits prod default 

$ (poetry shell) garden-ai do something                 # hits dev default 
$ (poetry shell) GARDEN_ENV=prod garden-ai do something # hits prod explicitly 

For quick sanity checking I also added a bit to garden-ai --version so that it'll print GARDEN_ENV if it's been set:

$ (poetry shell) garden-ai --version
garden-ai 0.0.0 (dev)

Testing

sanity checked DOI minting but haven't done the full end-to-end prod sanity check

Documentation

No docs changes, but I could be persuaded to add something to the contributor guide


📚 Documentation preview 📚: https://garden-ai--409.org.readthedocs.build/en/409/

codecov-commenter commented 7 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (442932c) 75.59% compared to head (0b9731d) 75.58%.

Files Patch % Lines
garden_ai/app/main.py 40.00% 3 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #409 +/- ## ========================================== - Coverage 75.59% 75.58% -0.01% ========================================== Files 45 45 Lines 2749 2757 +8 ========================================== + Hits 2078 2084 +6 - Misses 671 673 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.