Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @qredwoods, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request improves the development experience for users working within a Docker environment by automatically enabling Uvicorn's hot-reloading feature. By extending the condition for setting the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds the dev_docker environment to the condition for enabling the --reload flag for uvicorn. The change is correct, but as you mentioned in the description, using a case statement would improve maintainability and make it easier to add other environments in the future. I've added a suggestion to refactor the if statement to a case statement.
| if [ "${ENVIRONMENT}" = "development" ] || [ "${ENVIRONMENT}" = "dev_docker" ]; then | ||
| RELOAD_FLAG="--reload" | ||
| fi |
There was a problem hiding this comment.
For better readability and future extensibility, consider using a case statement here. As you noted in the pull request description, this would make it cleaner to add more environments in the future.
| if [ "${ENVIRONMENT}" = "development" ] || [ "${ENVIRONMENT}" = "dev_docker" ]; then | |
| RELOAD_FLAG="--reload" | |
| fi | |
| case "${ENVIRONMENT}" in | |
| development|dev_docker) | |
| RELOAD_FLAG="--reload" | |
| ;; | |
| esac |
There was a problem hiding this comment.
If it makes sense to reviewers I am happy to support the use of case. I just don't personally foresee the addition of more environments at this time, if we go to three then case definitely makes sense at that time, but could be fine now.
Description
add a short description
adds "or if the environment is "dev_docker" also set the uvicorn reload flag. Considered shifting to "case" to future-proof for easily adding other environments in the future, but used 'or' for minimal diff and lack of anticipation of many other cases. In discussion in ChatGPT5 conversation, it suggested use of "$(ENVIRONMENT:-)" in the line as a safe default guard, however I chose to leave it out because it seems in the development context you would want the "ENVIRONMENT: unbound variable" error if for some reason your environment wasn't set. I defer to reviewer judgment as this is new terrain for me.
reference to relevant issue
#679
Type of changes
Testing
How to test
testing description here: i.e. run app, go to x page, see that it does y
make a change that would trigger a uvicorn reload while running app in docker desktop and see if reloads
Clean commits
¹ described here