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

CLI improvements #2026

Merged
merged 4 commits into from
Oct 24, 2023
Merged

CLI improvements #2026

merged 4 commits into from
Oct 24, 2023

Conversation

martinxu9
Copy link
Contributor

@martinxu9 martinxu9 commented Oct 24, 2023

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

After these steps, you're ready to open a pull request.

  • Implements REF-996, REF-997.
  • Do not show on --help the options not meant for public users for all hosting related commands.
>>>>> reflex deploy --help                                                                                                                                                                                                                                              
Usage: reflex deploy [OPTIONS]

  Deploy the app to the Reflex hosting service.

Options:
  -k, --deployment-key TEXT       The name of the deployment.
  -r, --region TEXT               The regions to deploy to.
  --env TEXT                      The environment variables to set:
                                  <key>=<value>. For multiple envs, repeat
                                  this option, e.g. --env k1=v2 --env k2=v2.
  --interactive / --no-interactive
                                  Whether to list configuration options and
                                  ask for confirmation.  [default:
                                  interactive]
  --loglevel [debug|info|warning|error|critical]
                                  The log level to use.  [default:
                                  LogLevel.INFO]
  --help                          Show this message and exit.
  • Bug fix: the deploy command cleans up in a finally clause right after zip, causing the actual post to upload code to fail.
  • Keep only reflex deployments logs command to show user logs.
  • For file related errors, currently it resulted in internal errors for deploy command. Now changed to reraise OSError back to the user.

@@ -71,7 +71,7 @@ def _zip(
target: The target zip file.
root_dir: The root directory to zip.
exclude_venv_dirs: Whether to exclude venv directories.
exclude_sqlite_db_files: Whether to exclude sqlite db files.
upload_db_file: Whether to include local sqlite db files.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jackie-pc I'm renaming and flipping the use of its value (before exclude, now include) since we expose this option to use. It's a more friendly name I think.

jackie-pc
jackie-pc previously approved these changes Oct 24, 2023
@@ -448,14 +449,18 @@ def deploy(
)
# If the server explicitly states bad request,
# display a different error
if response.status_code == HTTPStatus.BAD_REQUEST:
raise ValueError(response.json()["detail"])
assert (
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Use of assert in production code is generally not recommended. https://snyk.io/blog/the-dangers-of-assert-in-python/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohhhh, I did not know that. I've replaced all my assertions with manual if/elses.

@picklelo picklelo merged commit f404205 into main Oct 24, 2023
37 checks passed
@picklelo picklelo deleted the martinxu9/hide-options-for-alpha-user branch November 1, 2023 19:11
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