tinybird-cli 3.0.2.dev2__tar.gz → 3.0.2.dev3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/PKG-INFO +6 -1
  2. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/__cli__.py +2 -2
  3. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/branch.py +14 -4
  4. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/cli.py +16 -1
  5. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/common.py +5 -3
  6. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird_cli.egg-info/PKG-INFO +6 -1
  7. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/setup.cfg +0 -0
  8. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/ch_utils/constants.py +0 -0
  9. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/ch_utils/engine.py +0 -0
  10. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/check_pypi.py +0 -0
  11. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/client.py +0 -0
  12. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/config.py +0 -0
  13. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/connector_settings.py +0 -0
  14. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/connectors.py +0 -0
  15. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/context.py +0 -0
  16. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/datafile.py +0 -0
  17. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/datatypes.py +0 -0
  18. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/feedback_manager.py +0 -0
  19. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/git_settings.py +0 -0
  20. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/sql.py +0 -0
  21. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/sql_template.py +0 -0
  22. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/sql_template_fmt.py +0 -0
  23. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/sql_toolset.py +0 -0
  24. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/syncasync.py +0 -0
  25. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli.py +0 -0
  26. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/auth.py +0 -0
  27. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/cicd.py +0 -0
  28. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/config.py +0 -0
  29. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/connection.py +0 -0
  30. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/datasource.py +0 -0
  31. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/exceptions.py +0 -0
  32. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/job.py +0 -0
  33. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/pipe.py +0 -0
  34. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/regions.py +0 -0
  35. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/telemetry.py +0 -0
  36. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/test.py +0 -0
  37. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  38. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  39. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/token.py +0 -0
  40. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/workspace.py +0 -0
  41. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  42. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird/tornado_template.py +0 -0
  43. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird_cli.egg-info/SOURCES.txt +0 -0
  44. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird_cli.egg-info/dependency_links.txt +0 -0
  45. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird_cli.egg-info/entry_points.txt +0 -0
  46. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird_cli.egg-info/requires.txt +0 -0
  47. {tinybird-cli-3.0.2.dev2 → tinybird-cli-3.0.2.dev3}/tinybird_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird-cli
3
- Version: 3.0.2.dev2
3
+ Version: 3.0.2.dev3
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://docs.tinybird.co/cli.html
6
6
  Author: Tinybird
@@ -19,6 +19,11 @@ Changelog
19
19
 
20
20
  ---------
21
21
 
22
+ 3.0.2.dev3
23
+ ************
24
+
25
+ - `Changed` `tb release promote` automatically deletes de oldest rollback Release if `export TB_FORCE_REMOVE_OLDEST_ROLLBACK=1`
26
+
22
27
  3.0.2.dev2
23
28
  ************
24
29
 
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
4
4
  __url__ = 'https://docs.tinybird.co/cli.html'
5
5
  __author__ = 'Tinybird'
6
6
  __author_email__ = 'support@tinybird.co'
7
- __version__ = '3.0.2.dev2'
8
- __revision__ = 'bd19d6e'
7
+ __version__ = '3.0.2.dev3'
8
+ __revision__ = 'd9cea87'
@@ -21,6 +21,7 @@ from tinybird.tb_cli_modules.common import (
21
21
  echo_safe_humanfriendly_tables_format_smart_table,
22
22
  get_current_main_workspace_temp,
23
23
  get_current_workspace_branches,
24
+ getenv_bool,
24
25
  print_branch_regression_tests_summary,
25
26
  print_current_branch,
26
27
  print_current_workspace,
@@ -148,12 +149,21 @@ async def release_create(semver: str) -> None:
148
149
  )
149
150
  @coro
150
151
  async def release_promote(semver: str) -> None:
152
+ """
153
+ The oldest rollback Release will be automatically removed if no usage, otherwise export TB_FORCE_REMOVE_OLDEST_ROLLBACK="1" to force deletion
154
+ """
151
155
  config = CLIConfig.get_project_config()
152
156
  _ = await try_update_config_with_remote(config, only_if_needed=True)
153
157
 
154
158
  client = config.get_client()
155
159
 
156
160
  try:
161
+ force_remove = getenv_bool("TB_FORCE_REMOVE_OLDEST_ROLLBACK", False)
162
+ click.echo(FeedbackManager.warning_remove_oldest_rollback(semver=semver))
163
+ try:
164
+ await remove_release(False, config, OLDEST_ROLLBACK, client, force=force_remove)
165
+ except Exception as e:
166
+ click.echo(FeedbackManager.error_remove_oldest_rollback(error=str(e), semver=semver))
157
167
  release = await client.release_promote(config["id"], semver)
158
168
  click.echo(FeedbackManager.success_release_promote(semver=semver))
159
169
  click.echo(FeedbackManager.success_git_release(release_commit=release["commit"]))
@@ -233,12 +243,12 @@ async def release_rm(semver: str, oldest_rollback: bool, force: bool, yes: bool,
233
243
  client = config.get_client()
234
244
  _ = await try_update_config_with_remote(config)
235
245
 
246
+ if oldest_rollback:
247
+ semver = OLDEST_ROLLBACK
248
+ await print_release_summary(config, semver, info=True, dry_run=dry_run)
236
249
  if dry_run or yes or click.confirm(FeedbackManager.warning_confirm_delete_release(semver=semver)):
237
250
  try:
238
- if oldest_rollback:
239
- semver = OLDEST_ROLLBACK
240
-
241
- await remove_release(dry_run, config, semver, client, force)
251
+ await remove_release(dry_run, config, semver, client, force, show_print=False)
242
252
  except Exception as e:
243
253
  raise CLIReleaseException(FeedbackManager.simple_error_exception(error=str(e)))
244
254
 
@@ -1427,7 +1427,22 @@ async def deploy(
1427
1427
  fork_downstream: bool,
1428
1428
  fork: bool,
1429
1429
  ) -> None:
1430
- """Deploy in tinybird pushing resources changed from previous release using git"""
1430
+ """Deploy in Tinybird pushing resources changed from previous Release using git.
1431
+
1432
+ Usage: tb --semver <semver> deploy
1433
+
1434
+ Semantic versioning logic is as follows:
1435
+
1436
+ --semver <semver> format is major.minor.patch-post where major, minor, patch and post are integer numbers
1437
+
1438
+ - bump post to deploy to the current live Release, rollback to previous post version is not available
1439
+
1440
+ - bump patch or minor to deploy a new Release and auto-promote it to live. Add TB_AUTO_PROMOTE=0 to create the Release in preview status
1441
+
1442
+ - bump major to deploy a new Release in preview status
1443
+
1444
+ When auto-promote the oldest rollback Release will be automatically removed if no usage, otherwise export TB_FORCE_REMOVE_OLDEST_ROLLBACK="1" to force deletion
1445
+ """
1431
1446
  try:
1432
1447
  ignore_sql_errors = FeatureFlags.ignore_sql_errors()
1433
1448
  context.disable_template_security_validation.set(True)
@@ -2029,10 +2029,11 @@ async def print_release_summary(config: CLIConfig, semver: str, info: bool = Fal
2029
2029
  else:
2030
2030
  columns = ["name", "id", "notes"]
2031
2031
  if not response:
2032
- click.echo(FeedbackManager.info_release_no_rollback(semver=semver))
2032
+ click.echo(FeedbackManager.info_release_no_rollback())
2033
2033
  return
2034
2034
 
2035
2035
  if len(response["datasources"]) or len(response["pipes"]):
2036
+ semver = response.get("semver", semver)
2036
2037
  if info:
2037
2038
  if dry_run:
2038
2039
  click.echo(FeedbackManager.info_release_rm_resources_dry_run(semver=semver))
@@ -2058,8 +2059,9 @@ async def print_release_summary(config: CLIConfig, semver: str, info: bool = Fal
2058
2059
  echo_safe_humanfriendly_tables_format_smart_table(rows, column_names=columns)
2059
2060
 
2060
2061
 
2061
- async def remove_release(dry_run: bool, config: CLIConfig, semver: str, client: TinyB, force: bool):
2062
- await print_release_summary(config, semver, info=True, dry_run=True)
2062
+ async def remove_release(dry_run: bool, config: CLIConfig, semver: str, client: TinyB, force: bool, show_print=True):
2063
+ if show_print:
2064
+ await print_release_summary(config, semver, info=True, dry_run=True)
2063
2065
  if not dry_run:
2064
2066
  response = await client.release_rm(
2065
2067
  config["id"], semver, confirmation=config["name"], dry_run=dry_run, force=force
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird-cli
3
- Version: 3.0.2.dev2
3
+ Version: 3.0.2.dev3
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://docs.tinybird.co/cli.html
6
6
  Author: Tinybird
@@ -19,6 +19,11 @@ Changelog
19
19
 
20
20
  ---------
21
21
 
22
+ 3.0.2.dev3
23
+ ************
24
+
25
+ - `Changed` `tb release promote` automatically deletes de oldest rollback Release if `export TB_FORCE_REMOVE_OLDEST_ROLLBACK=1`
26
+
22
27
  3.0.2.dev2
23
28
  ************
24
29