datasecops-cli 0.7.0b9__tar.gz → 0.7.0b10__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 (91) hide show
  1. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/CHANGELOG.md +6 -0
  2. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/PKG-INFO +5 -1
  3. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/README.md +4 -0
  4. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/pyproject.toml +1 -1
  5. datasecops_cli-0.7.0b10/src/datasecops_cli/__init__.py +1 -0
  6. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/download_service.py +21 -11
  7. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_download_service.py +18 -0
  8. datasecops_cli-0.7.0b9/src/datasecops_cli/__init__.py +0 -1
  9. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/.github/workflows/auto-tag.yml +0 -0
  10. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/.github/workflows/publish-cli.yml +0 -0
  11. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/.github/workflows/test.yml +0 -0
  12. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/.gitignore +0 -0
  13. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/AGENTS.md +0 -0
  14. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/DEVELOPMENT.md +0 -0
  15. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/LICENSE +0 -0
  16. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/docs/dcm.md +0 -0
  17. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/docs/getting-started.md +0 -0
  18. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/docs/git-operations.md +0 -0
  19. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/docs/legacy.md +0 -0
  20. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/docs/legacy_plan_of_action.md +0 -0
  21. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/docs/mcp-server.md +0 -0
  22. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/mcp-servers.json +0 -0
  23. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/scripts/vendor_model.py +0 -0
  24. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/setup.ps1 +0 -0
  25. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/setup.sh +0 -0
  26. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/config.py +0 -0
  27. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/main.py +0 -0
  28. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/menus/__init__.py +0 -0
  29. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/menus/configuration.py +0 -0
  30. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/menus/dcm_operations.py +0 -0
  31. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/menus/development.py +0 -0
  32. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/menus/downloads.py +0 -0
  33. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/menus/git_operations.py +0 -0
  34. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/models/__init__.py +0 -0
  35. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/models/git_helpers.py +0 -0
  36. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/models/project_config.py +0 -0
  37. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/__init__.py +0 -0
  38. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/bootstrap_service.py +0 -0
  39. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/dbt_project_generator.py +0 -0
  40. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/dbt_runner.py +0 -0
  41. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/dcm_orchestrator.py +0 -0
  42. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/dcm_pipelines.py +0 -0
  43. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/dcm_registry.py +0 -0
  44. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/dcm_service.py +0 -0
  45. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/directory_scaffolder.py +0 -0
  46. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/git_service.py +0 -0
  47. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/linting_service.py +0 -0
  48. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/model_commands.py +0 -0
  49. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/pipeline_env.py +0 -0
  50. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/skill_service.py +0 -0
  51. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/snowflake_service.py +0 -0
  52. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/services/upstream_service.py +0 -0
  53. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/utilities/__init__.py +0 -0
  54. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/utilities/display.py +0 -0
  55. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/utilities/file_utils.py +0 -0
  56. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/utilities/mcp.py +0 -0
  57. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_cli/utilities/yaml_utils.py +0 -0
  58. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_mcp/__init__.py +0 -0
  59. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_mcp/__main__.py +0 -0
  60. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_mcp/connection.py +0 -0
  61. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_mcp/server.py +0 -0
  62. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/__init__.py +0 -0
  63. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/convert.py +0 -0
  64. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/diagram.py +0 -0
  65. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/expand.py +0 -0
  66. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/extract.py +0 -0
  67. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/render.py +0 -0
  68. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/schema.py +0 -0
  69. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/scope.py +0 -0
  70. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/scripts.py +0 -0
  71. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/starter.py +0 -0
  72. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/templates/macros/role.sql +0 -0
  73. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/templates/macros/role_guard.sql +0 -0
  74. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/templates/macros/warehouse.sql +0 -0
  75. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/src/datasecops_model/validate.py +0 -0
  76. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/__init__.py +0 -0
  77. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_config.py +0 -0
  78. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_dbt_project_generator_profiles.py +0 -0
  79. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_dbt_runner.py +0 -0
  80. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_dcm_model.py +0 -0
  81. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_dcm_orchestrator.py +0 -0
  82. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_dcm_service.py +0 -0
  83. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_file_utils.py +0 -0
  84. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_linting_service.py +0 -0
  85. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_main.py +0 -0
  86. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_mcp_lint_tools.py +0 -0
  87. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_model_commands.py +0 -0
  88. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_models.py +0 -0
  89. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_pipeline_env.py +0 -0
  90. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_version.py +0 -0
  91. {datasecops_cli-0.7.0b9 → datasecops_cli-0.7.0b10}/tests/test_yaml_utils.py +0 -0
@@ -4,9 +4,12 @@ All notable changes to the DataSecOps CLI are documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.7.0b10] - 2026-10-28
8
+
7
9
  ### Fixed
8
10
 
9
11
  - **CLI connections emitted a `FutureWarning` about `enable_server_session_keep_alive_auto_detection` on every launch** — `SnowflakeService.connect()` and the MCP server's `MCPSnowflakeService.conn` called `snowflake.connector.connect()` without this parameter; `snowflake-connector-python` now warns because its default will change in a future release. Both now pass `enable_server_session_keep_alive_auto_detection=True` explicitly, preserving current behavior and silencing the warning.
12
+ - **`install-dbt` / `install-sqlfluff` failed when no version was marked active** — the CLI only used a `DBT_VERSIONS` entry with `active: true`, while the app falls back to the first enabled version, so a pipeline could fail to install dbt that the app considered configured. The CLI now uses the same fallback, and strips the `v` prefix the app stores (`v2.0.9` → `dbt==2.0.9`). Orbit pipelines now install dbt 2.0 through `datasecops download install-dbt` too (instead of a version pinned in the YAML), so they follow the version active in the app without re-rendering.
10
13
 
11
14
  ## [0.7.0b9] - 2026-10-28
12
15
 
@@ -20,6 +23,9 @@ All notable changes to the DataSecOps CLI are documented in this file.
20
23
  ### Fixed
21
24
 
22
25
  - **`dbt build` was missing from the Development menu entirely** — `DbtRunner.build()` already existed and the README already advertised "dbt run, build, test, lint", but no menu option called it. It's now a top-level menu entry with full/modified/specific run options, mirroring `run`.
26
+ =======
27
+ - **`install-dbt` / `install-sqlfluff` failed when no version was marked active** — the CLI only used a `DBT_VERSIONS` entry with `active: true`, while the app falls back to the first enabled version, so a pipeline could fail to install dbt that the app considered configured. The CLI now uses the same fallback, and strips the `v` prefix the app stores (`v2.0.9` → `dbt==2.0.9`). Orbit pipelines now install dbt 2.0 through `datasecops download install-dbt` too (instead of a version pinned in the YAML), so they follow the version active in the app without re-rendering.
28
+ >>>>>>> b0b3c02 (Fall back to the first enabled version when none is active)
23
29
 
24
30
  ## [0.7.0b8] - 2026-10-27
25
31
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: datasecops-cli
3
- Version: 0.7.0b9
3
+ Version: 0.7.0b10
4
4
  Summary: DataSecOps Framework CLI for Snowflake Native App
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
@@ -131,6 +131,10 @@ datasecops download sqlfluff install-sqlfluff
131
131
  datasecops download all
132
132
  ```
133
133
 
134
+ `install-sqlfluff`/`install-dbt` pin to the version marked `active` in the native app's
135
+ `DBT_VERSIONS` config for the engine in use, falling back to the first `enabled` version if
136
+ none is marked active (matching how the app itself resolves a version to install).
137
+
134
138
  Available items: `sqlfluff`, `pipelines`, `packages`, `macros`, `scripts`, `install-sqlfluff`, `install-dbt`, `all`
135
139
 
136
140
  The pipeline platform (GitHub / Azure DevOps) is auto-detected from the native app's source control configuration.
@@ -111,6 +111,10 @@ datasecops download sqlfluff install-sqlfluff
111
111
  datasecops download all
112
112
  ```
113
113
 
114
+ `install-sqlfluff`/`install-dbt` pin to the version marked `active` in the native app's
115
+ `DBT_VERSIONS` config for the engine in use, falling back to the first `enabled` version if
116
+ none is marked active (matching how the app itself resolves a version to install).
117
+
114
118
  Available items: `sqlfluff`, `pipelines`, `packages`, `macros`, `scripts`, `install-sqlfluff`, `install-dbt`, `all`
115
119
 
116
120
  The pipeline platform (GitHub / Azure DevOps) is auto-detected from the native app's source control configuration.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "datasecops-cli"
7
- version = "0.7.0b9"
7
+ version = "0.7.0b10"
8
8
  description = "DataSecOps Framework CLI for Snowflake Native App"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -0,0 +1 @@
1
+ __version__ = "0.7.0b10"
@@ -73,8 +73,12 @@ class DownloadService:
73
73
  return True
74
74
 
75
75
  def _fetch_framework_versions(self) -> dict[str, str]:
76
- """Fetch all active package versions from the framework's DBT_VERSIONS config.
77
-
76
+ """Fetch pinned package versions from the framework's DBT_VERSIONS config.
77
+
78
+ For each package, prefers the entry marked `active`; if none is active, falls
79
+ back to the first `enabled` entry (matching how the native app resolves the
80
+ version to install when nothing is explicitly marked active).
81
+
78
82
  Returns a dict mapping pip package name to pinned spec, e.g. {"dbt-core": "dbt-core==1.9.0", ...}.
79
83
  """
80
84
  raw = self.sf.get_framework_config("DBT_VERSIONS")
@@ -92,18 +96,23 @@ class DownloadService:
92
96
 
93
97
  result: dict[str, str] = {}
94
98
  for config_key, pkg_name in version_keys.items():
95
- for entry in raw.get(config_key, []):
96
- if entry.get("active"):
97
- result[pkg_name] = f"{pkg_name}=={entry['version']}"
98
- break
99
+ entries = raw.get(config_key, [])
100
+ # The active version, else the first enabled one (as the app picks it), else none.
101
+ entry = (next((e for e in entries if e.get("active")), None)
102
+ or next((e for e in entries if e.get("enabled", True)), None))
103
+ if entry and entry.get("version"):
104
+ # The app stores versions as "v2.0.4"
105
+ result[pkg_name] = f"{pkg_name}=={str(entry['version']).lstrip('v')}"
99
106
 
100
107
  if not result:
101
- error_line("No active versions found in framework configuration")
108
+ error_line("No usable (active or enabled) versions found in framework configuration")
102
109
 
103
110
  return result
104
111
 
105
112
  def get_sqlfluff_requirements(self) -> list[str]:
106
- """Fetch active sqlfluff and sqlfluff-templater-dbt versions from the framework.
113
+ """Fetch pinned sqlfluff and sqlfluff-templater-dbt versions from the framework
114
+ (the active version, falling back to the first enabled one — see
115
+ `_fetch_framework_versions`).
107
116
 
108
117
  Not applicable to the dbt2 engine: dbt 2.0's built-in `dbt lint` command reads the
109
118
  same .sqlfluff config natively, so no separate SQLFluff package is required.
@@ -115,11 +124,12 @@ class DownloadService:
115
124
  versions = self._fetch_framework_versions()
116
125
  sqlfluff_packages = [versions[k] for k in ("sqlfluff", "sqlfluff-templater-dbt") if k in versions]
117
126
  if not sqlfluff_packages:
118
- error_line("No active SQLFluff versions found in framework configuration")
127
+ error_line("No usable SQLFluff versions found in framework configuration")
119
128
  return sqlfluff_packages
120
129
 
121
130
  def get_dbt_requirements(self) -> list[str]:
122
- """Fetch active dbt package version(s) from the framework.
131
+ """Fetch pinned dbt package version(s) from the framework (the active version,
132
+ falling back to the first enabled one — see `_fetch_framework_versions`).
123
133
 
124
134
  For the dbt2 engine, returns the single bundled `dbt` package. For dbt_core,
125
135
  returns `dbt-core` and `dbt-snowflake`.
@@ -131,7 +141,7 @@ class DownloadService:
131
141
  else:
132
142
  dbt_packages = [versions[k] for k in ("dbt-core", "dbt-snowflake") if k in versions]
133
143
  if not dbt_packages:
134
- error_line("No active dbt versions found in framework configuration")
144
+ error_line("No usable dbt versions found in framework configuration")
135
145
  return dbt_packages
136
146
 
137
147
  def download_pipelines(self, platform: str = "github", profile_name: str = "") -> bool:
@@ -33,6 +33,24 @@ class TestGetDbtRequirements:
33
33
 
34
34
  assert result == ["dbt==2.0.4"]
35
35
 
36
+ def test_version_prefix_is_stripped(self, tmp_path):
37
+ mock_sf = MagicMock()
38
+ mock_sf.get_framework_config.return_value = {"dbt2_versions": [{"version": "v2.0.9", "active": True}]}
39
+ service = DownloadService(mock_sf, tmp_path, dbt_engine="dbt2")
40
+
41
+ assert service.get_dbt_requirements() == ["dbt==2.0.9"]
42
+
43
+ def test_without_an_active_version_the_first_enabled_is_used(self, tmp_path):
44
+ mock_sf = MagicMock()
45
+ mock_sf.get_framework_config.return_value = {"dbt2_versions": [
46
+ {"version": "v2.0.9", "enabled": False},
47
+ {"version": "v2.0.4", "enabled": True},
48
+ {"version": "v2.0.0", "enabled": True},
49
+ ]}
50
+ service = DownloadService(mock_sf, tmp_path, dbt_engine="dbt2")
51
+
52
+ assert service.get_dbt_requirements() == ["dbt==2.0.4"]
53
+
36
54
 
37
55
  class TestGetSqlfluffRequirements:
38
56
  def test_dbt_core_engine_returns_sqlfluff_packages(self, tmp_path):
@@ -1 +0,0 @@
1
- __version__ = "0.7.0b9"