tinybird-cli 3.4.1.dev6__tar.gz → 3.4.1.dev8__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 (48) hide show
  1. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/PKG-INFO +12 -2
  2. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/__cli__.py +2 -2
  3. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/context.py +1 -0
  4. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/feedback_manager.py +1 -1
  5. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/git_settings.py +10 -1
  6. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/cicd.py +36 -20
  7. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird_cli.egg-info/PKG-INFO +12 -2
  8. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/setup.cfg +0 -0
  9. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/ch_utils/constants.py +0 -0
  10. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/ch_utils/engine.py +0 -0
  11. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/check_pypi.py +0 -0
  12. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/client.py +0 -0
  13. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/config.py +0 -0
  14. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/connector_settings.py +0 -0
  15. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/connectors.py +0 -0
  16. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/data_connectors/credentials.py +0 -0
  17. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/datafile.py +0 -0
  18. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/datatypes.py +0 -0
  19. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/sql.py +0 -0
  20. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/sql_template.py +0 -0
  21. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/sql_template_fmt.py +0 -0
  22. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/sql_toolset.py +0 -0
  23. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/syncasync.py +0 -0
  24. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli.py +0 -0
  25. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/auth.py +0 -0
  26. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/branch.py +0 -0
  27. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/cli.py +0 -0
  28. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/common.py +0 -0
  29. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/config.py +0 -0
  30. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/connection.py +0 -0
  31. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/datasource.py +0 -0
  32. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/exceptions.py +0 -0
  33. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/job.py +0 -0
  34. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/pipe.py +0 -0
  35. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/regions.py +0 -0
  36. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/telemetry.py +0 -0
  37. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/test.py +0 -0
  38. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  39. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  40. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/token.py +0 -0
  41. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/workspace.py +0 -0
  42. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  43. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird/tornado_template.py +0 -0
  44. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird_cli.egg-info/SOURCES.txt +0 -0
  45. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird_cli.egg-info/dependency_links.txt +0 -0
  46. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird_cli.egg-info/entry_points.txt +0 -0
  47. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/tinybird_cli.egg-info/requires.txt +0 -0
  48. {tinybird-cli-3.4.1.dev6 → tinybird-cli-3.4.1.dev8}/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.4.1.dev6
3
+ Version: 3.4.1.dev8
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -19,6 +19,16 @@ Changelog
19
19
 
20
20
  ---------
21
21
 
22
+ 3.4.1.dev7
23
+ ************
24
+
25
+ - `Changed` error message when trying to modify a datasource without bumping the major semver version to add a link to the documentation.
26
+
27
+ 3.4.1.dev7
28
+ ************
29
+
30
+ - `Changed` GH workflow files and secret includes the workspace name when generated from the UI and CLI
31
+
22
32
  3.4.1.dev6
23
33
  ************
24
34
 
@@ -27,7 +37,7 @@ Changelog
27
37
  3.4.1.dev5
28
38
  ************
29
39
 
30
- - `Added` Better error report on `tb push` when try to push a pipe with bad templating
40
+ - `Added` Better error report on `tb push` when trying to push a pipe with bad templating
31
41
 
32
42
  3.4.1.dev4
33
43
  ************
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
4
4
  __url__ = 'https://www.tinybird.co/docs/cli/introduction.html'
5
5
  __author__ = 'Tinybird'
6
6
  __author_email__ = 'support@tinybird.co'
7
- __version__ = '3.4.1.dev6'
8
- __revision__ = '8321773'
7
+ __version__ = '3.4.1.dev8'
8
+ __revision__ = '861be8e'
@@ -6,6 +6,7 @@ table_id: ContextVar[str] = ContextVar("table_id")
6
6
  hfi_frequency: ContextVar[float] = ContextVar("hfi_frequency")
7
7
  hfi_frequency_gatherer: ContextVar[float] = ContextVar("hfi_frequency_gatherer")
8
8
  hfi_use_gatherer: ContextVar[bool] = ContextVar("hfi_use_gatherer")
9
+ use_gatherer: ContextVar[bool] = ContextVar("use_gatherer")
9
10
  disable_template_security_validation: ContextVar[bool] = ContextVar("disable_template_security_validation")
10
11
  origin: ContextVar[str] = ContextVar("origin")
11
12
  request_id: ContextVar[str] = ContextVar("request_id")
@@ -334,7 +334,7 @@ class FeedbackManager:
334
334
  "Materialized view {pipe} has the datasource definition in the same file as the SQL transformation. This is no longer supported while using Versions. Please, split the datasource definition into a separate file."
335
335
  )
336
336
  error_check_backfill_required = error_message(
337
- "Not safe to deploy to live resource '{resource_name}', backfill might be required. Consider to deploy to preview bumping semver to major or disable 'TB_AUTO_PROMOTE'. In case you want to disable this check use 'TB_CHECK_BACKFILL_REQUIRED=0'"
337
+ "Not safe to deploy to live resource '{resource_name}', backfill might be required. Consider deploying to preview bumping SemVer to major or disabling 'TB_AUTO_PROMOTE'. In case you want to disable this check use 'TB_CHECK_BACKFILL_REQUIRED=0'. For more information about the deployment process, please visit https://www.tinybird.co/docs/version-control/deployment-strategies"
338
338
  )
339
339
 
340
340
  info_ignoring_incl_file = info_message(
@@ -1,6 +1,6 @@
1
1
  from dataclasses import dataclass
2
2
  from enum import Enum
3
- from typing import NamedTuple, Optional
3
+ from typing import Dict, NamedTuple, Optional
4
4
 
5
5
  from tinybird.tb_cli_modules.cicd import (
6
6
  APPEND_FIXTURES_SH,
@@ -147,3 +147,12 @@ def bump_version(version: str, next_version: Optional[str]) -> str:
147
147
  return f"{major}.{minor}.{patch}"
148
148
  # TODO validate next version
149
149
  return next_version
150
+
151
+
152
+ def get_default_init_files_deploy(workspace_name: str) -> Dict[str, str]:
153
+ modified_files = {
154
+ path.replace("tinybird_", f"tinybird_{workspace_name.lower()}_"): content
155
+ for path, content in DEFAULT_INIT_FILES_DEPLOY.items()
156
+ }
157
+
158
+ return modified_files
@@ -1,4 +1,3 @@
1
- from dataclasses import dataclass
2
1
  from enum import Enum
3
2
  from os import getcwd
4
3
  from pathlib import Path
@@ -26,7 +25,7 @@ GITHUB_CI_YML = """
26
25
  ### for more details or custom CI/CD ###
27
26
  ##################################################
28
27
 
29
- name: Tinybird - CI Workflow
28
+ name: Tinybird {{ workspace_name }} - CI Workflow
30
29
 
31
30
  on:
32
31
  workflow_dispatch:
@@ -47,7 +46,7 @@ GITHUB_CI_YML = """
47
46
  data_project_dir: {{ data_project_dir }}
48
47
  tb_format: false
49
48
  secrets:
50
- tb_admin_token: ${{! secrets.TB_ADMIN_TOKEN }} # set the Workspace admin token in GitHub secrets
49
+ tb_admin_token: ${{! secrets.{{ tb_admin_token_name }} }} # set the Workspace admin token in GitHub secrets
51
50
  tb_host: {{ tb_host }}
52
51
  """
53
52
 
@@ -57,7 +56,7 @@ GITHUB_CD_YML = """
57
56
  ### for more details or custom CI/CD ###
58
57
  ##################################################
59
58
 
60
- name: Tinybird - CD Workflow
59
+ name: Tinybird {{ workspace_name }} - CD Workflow
61
60
 
62
61
  on:
63
62
  workflow_dispatch:
@@ -73,7 +72,7 @@ GITHUB_CD_YML = """
73
72
  with:
74
73
  data_project_dir: {{ data_project_dir }}
75
74
  secrets:
76
- tb_admin_token: ${{! secrets.TB_ADMIN_TOKEN }} # set the Workspace admin token in GitHub secrets
75
+ tb_admin_token: ${{! secrets.{{ tb_admin_token_name }} }} # set the Workspace admin token in GitHub secrets
77
76
  tb_host: {{ tb_host }}
78
77
  """
79
78
 
@@ -83,7 +82,7 @@ GITHUB_RELEASES_YML = """
83
82
  ### for more details or custom CI/CD ###
84
83
  ##################################################
85
84
 
86
- name: Tinybird - Releases Workflow
85
+ name: Tinybird {{ workspace_name }} - Releases Workflow
87
86
 
88
87
  on:
89
88
  workflow_dispatch:
@@ -100,7 +99,7 @@ GITHUB_RELEASES_YML = """
100
99
  job_to_run: ${{! inputs.job_to_run }}
101
100
  data_project_dir: {{ data_project_dir }}
102
101
  secrets:
103
- tb_admin_token: ${{! secrets.TB_ADMIN_TOKEN }} # set the Workspace admin token in GitHub secrets
102
+ tb_admin_token: ${{! secrets.{{ tb_admin_token_name }} }} # set the Workspace admin token in GitHub secrets
104
103
  tb_host: {{ tb_host }}
105
104
  """
106
105
 
@@ -141,7 +140,7 @@ GITLAB_YML = """
141
140
  .cicd_variables:
142
141
  variables: &cicd_variables
143
142
  TB_HOST: "{{ tb_host }}"
144
- TB_ADMIN_TOKEN: $TB_ADMIN_TOKEN # set the Workspace admin token in GitLab CI/CD Variables
143
+ TB_ADMIN_TOKEN: ${{ tb_admin_token_name }} # set the Workspace admin token in GitLab CI/CD Variables
145
144
  DATA_PROJECT_DIR: "{{ data_project_dir }}"
146
145
 
147
146
  deploy_ci: # ci using branches from workspace '{{ workspace_name }}'
@@ -296,12 +295,23 @@ done
296
295
  """
297
296
 
298
297
 
299
- @dataclass
300
298
  class CICDFile:
301
- template: str
302
- file_name: str
303
- dir_path: Optional[str] = None
304
- warning_message: Optional[str] = None
299
+ def __init__(
300
+ self,
301
+ template: str,
302
+ file_name_template: str,
303
+ dir_path: Optional[str] = None,
304
+ warning_message: Optional[str] = None,
305
+ ):
306
+ self.template = template
307
+ self.file_name_template = file_name_template
308
+ self.dir_path = dir_path
309
+ self.warning_message = warning_message
310
+ self.file_name = ""
311
+
312
+ def generate_file_name(self, params: Dict[str, Any]):
313
+ file_name_template = Template(self.file_name_template)
314
+ self.file_name = str(file_name_template.generate(**params).decode()).lower()
305
315
 
306
316
  @property
307
317
  def full_path(self) -> str:
@@ -313,6 +323,7 @@ class CICDGeneratorBase:
313
323
 
314
324
  def __call__(self, path: str, params: Dict[str, Any]):
315
325
  for cicd_file in self.cicd_files:
326
+ cicd_file.generate_file_name(params)
316
327
  if cicd_file.dir_path:
317
328
  Path(f"{path}/{cicd_file.dir_path}").mkdir(parents=True, exist_ok=True)
318
329
  content = Template(cicd_file.template).generate(**params)
@@ -326,7 +337,7 @@ class CICDGeneratorBase:
326
337
 
327
338
  def is_already_generated(self, path: str) -> bool:
328
339
  for cicd_file in self.cicd_files:
329
- if Path(f"{path}/{cicd_file.full_path}").exists():
340
+ if cicd_file.file_name and Path(f"{path}/{cicd_file.full_path}").exists():
330
341
  return True
331
342
  return False
332
343
 
@@ -341,17 +352,21 @@ class CICDGeneratorBase:
341
352
 
342
353
  class GitHubCICDGenerator(CICDGeneratorBase):
343
354
  cicd_files = [
344
- CICDFile(template=GITHUB_CI_YML, file_name="tinybird_ci.yml", dir_path=".github/workflows"),
355
+ CICDFile(
356
+ template=GITHUB_CI_YML,
357
+ file_name_template="tinybird_{{workspace_name}}_ci.yml",
358
+ dir_path=".github/workflows",
359
+ ),
345
360
  CICDFile(
346
361
  template=GITHUB_CD_YML,
347
- file_name="tinybird_cd.yml",
362
+ file_name_template="tinybird_{{workspace_name}}_cd.yml",
348
363
  dir_path=".github/workflows",
349
364
  ),
350
365
  CICDFile(
351
366
  template=GITHUB_RELEASES_YML,
352
- file_name="tinybird_release.yml",
367
+ file_name_template="tinybird_{{workspace_name}}_release.yml",
353
368
  dir_path=".github/workflows",
354
- warning_message="Set TB_ADMIN_TOKEN in GitHub secrets. Use the Workspace admin token. Hint: use `tb token copy {token_id}` to copy clipboard",
369
+ warning_message="Set {tb_admin_token_name} in GitHub secrets. Use the Workspace admin token. Hint: use `tb token copy {token_id}` to copy clipboard",
355
370
  ),
356
371
  ]
357
372
 
@@ -360,8 +375,8 @@ class GitLabCICDGenerator(CICDGeneratorBase):
360
375
  cicd_files = [
361
376
  CICDFile(
362
377
  template=GITLAB_YML,
363
- file_name=".gitlab-ci.yml",
364
- warning_message="Set TB_ADMIN_TOKEN in GitLab CI/CD Variables. Use the Workspace admin token. Hint: use `tb token copy {token_id}` to copy clipboard",
378
+ file_name_template=".gitlab-ci.yml",
379
+ warning_message="Set {tb_admin_token_name} in GitLab CI/CD Variables. Use the Workspace admin token. Hint: use `tb token copy {token_id}` to copy clipboard",
365
380
  )
366
381
  ]
367
382
 
@@ -411,6 +426,7 @@ async def init_cicd(
411
426
  "token_id": token["id"],
412
427
  "data_project_dir": data_project_dir,
413
428
  "workflow_version": WORKFLOW_VERSION,
429
+ "tb_admin_token_name": f"TB_{str(workspace_info['name']).upper()}_ADMIN_TOKEN",
414
430
  }
415
431
  warning_message = generator(path, params)
416
432
  if warning_message:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tinybird-cli
3
- Version: 3.4.1.dev6
3
+ Version: 3.4.1.dev8
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/cli/introduction.html
6
6
  Author: Tinybird
@@ -19,6 +19,16 @@ Changelog
19
19
 
20
20
  ---------
21
21
 
22
+ 3.4.1.dev7
23
+ ************
24
+
25
+ - `Changed` error message when trying to modify a datasource without bumping the major semver version to add a link to the documentation.
26
+
27
+ 3.4.1.dev7
28
+ ************
29
+
30
+ - `Changed` GH workflow files and secret includes the workspace name when generated from the UI and CLI
31
+
22
32
  3.4.1.dev6
23
33
  ************
24
34
 
@@ -27,7 +37,7 @@ Changelog
27
37
  3.4.1.dev5
28
38
  ************
29
39
 
30
- - `Added` Better error report on `tb push` when try to push a pipe with bad templating
40
+ - `Added` Better error report on `tb push` when trying to push a pipe with bad templating
31
41
 
32
42
  3.4.1.dev4
33
43
  ************