Browse Source

feat(devservices): Only display deprecation warning message if `USE_NEW_DEVSERVICES` is not set (#82487)

If people are setting `USE_NEW_DEVSERVICES`, they already know that
`sentry devservices` will be deprecated soon.
Hubert Deng 2 months ago
parent
commit
48164d4c97
1 changed files with 11 additions and 9 deletions
  1. 11 9
      src/sentry/runner/commands/devservices.py

+ 11 - 9
src/sentry/runner/commands/devservices.py

@@ -303,8 +303,9 @@ def up(
     """
     from sentry.runner import configure
 
-    click.secho(
-        """
+    if os.environ.get("USE_NEW_DEVSERVICES", "0") != "1":
+        click.secho(
+            """
 WARNING: We're transitioning from `sentry devservices` to the new and improved `devservices` in January 2025.
 To give the new devservices a try, set the `USE_NEW_DEVSERVICES` environment variable to `1`. For a full list of commands, see
 https://github.com/getsentry/devservices?tab=readme-ov-file#commands
@@ -314,8 +315,8 @@ For Sentry employees - if you hit any bumps or have feedback, we'd love to hear
 Thanks for helping the Dev Infra team improve this experience!
 
     """,
-        fg="yellow",
-    )
+            fg="yellow",
+        )
 
     configure()
 
@@ -534,8 +535,9 @@ def down(project: str, service: list[str]) -> None:
     an explicit list of services to bring down.
     """
 
-    click.secho(
-        """
+    if os.environ.get("USE_NEW_DEVSERVICES", "0") != "1":
+        click.secho(
+            """
 WARNING: We're transitioning from `sentry devservices` to the new and improved `devservices` in January 2025.
 To give the new devservices a try, set the `USE_NEW_DEVSERVICES` environment variable to `1`. For a full list of commands, see
 https://github.com/getsentry/devservices?tab=readme-ov-file#commands
@@ -544,9 +546,9 @@ Instead of running `sentry devservices down`, consider using `devservices down`.
 For Sentry employees - if you hit any bumps or have feedback, we'd love to hear from you in #discuss-dev-infra.
 Thanks for helping the Dev Infra team improve this experience!
 
-    """,
-        fg="yellow",
-    )
+        """,
+            fg="yellow",
+        )
 
     def _down(container: docker.models.containers.Container) -> None:
         click.secho(f"> Stopping '{container.name}' container", fg="red")