datasecops-cli 0.6.2__tar.gz → 0.7.0b2__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.
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/.gitignore +2 -1
- datasecops_cli-0.7.0b2/AGENTS.md +79 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/CHANGELOG.md +105 -25
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/DEVELOPMENT.md +5 -5
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/PKG-INFO +29 -11
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/README.md +26 -9
- datasecops_cli-0.7.0b2/docs/dcm.md +224 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/docs/getting-started.md +42 -5
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/docs/git-operations.md +1 -1
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/docs/legacy_plan_of_action.md +15 -15
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/docs/mcp-server.md +4 -4
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/pyproject.toml +4 -3
- datasecops_cli-0.7.0b2/scripts/vendor_model.py +43 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/setup.ps1 +6 -11
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/setup.sh +6 -10
- datasecops_cli-0.7.0b2/src/datasecops_cli/__init__.py +1 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/config.py +19 -4
- datasecops_cli-0.7.0b2/src/datasecops_cli/main.py +1315 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/menus/configuration.py +39 -27
- datasecops_cli-0.7.0b2/src/datasecops_cli/menus/dcm_operations.py +198 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/menus/development.py +10 -5
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/menus/downloads.py +5 -5
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/models/project_config.py +38 -2
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/services/bootstrap_service.py +90 -13
- datasecops_cli-0.7.0b2/src/datasecops_cli/services/dbt_project_generator.py +331 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/services/dbt_runner.py +10 -9
- datasecops_cli-0.7.0b2/src/datasecops_cli/services/dcm_orchestrator.py +351 -0
- datasecops_cli-0.7.0b2/src/datasecops_cli/services/dcm_pipelines.py +74 -0
- datasecops_cli-0.7.0b2/src/datasecops_cli/services/dcm_registry.py +157 -0
- datasecops_cli-0.7.0b2/src/datasecops_cli/services/dcm_service.py +206 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/services/download_service.py +51 -6
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/services/linting_service.py +48 -6
- datasecops_cli-0.7.0b2/src/datasecops_cli/services/model_commands.py +265 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/services/skill_service.py +6 -6
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/services/snowflake_service.py +40 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/utilities/display.py +25 -27
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/utilities/mcp.py +1 -1
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_mcp/connection.py +15 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_mcp/server.py +81 -8
- datasecops_cli-0.7.0b2/src/datasecops_model/__init__.py +37 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/convert.py +233 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/diagram.py +394 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/expand.py +103 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/extract.py +375 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/render.py +356 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/schema.py +405 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/scope.py +149 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/scripts.py +234 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/starter.py +111 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/templates/macros/role.sql +62 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/templates/macros/role_guard.sql +70 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/templates/macros/warehouse.sql +94 -0
- datasecops_cli-0.7.0b2/src/datasecops_model/validate.py +256 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/tests/test_config.py +63 -0
- datasecops_cli-0.7.0b2/tests/test_dbt_runner.py +47 -0
- datasecops_cli-0.7.0b2/tests/test_dcm_model.py +582 -0
- datasecops_cli-0.7.0b2/tests/test_dcm_orchestrator.py +319 -0
- datasecops_cli-0.7.0b2/tests/test_dcm_service.py +93 -0
- datasecops_cli-0.7.0b2/tests/test_download_service.py +63 -0
- datasecops_cli-0.7.0b2/tests/test_linting_service.py +59 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/tests/test_main.py +123 -32
- datasecops_cli-0.7.0b2/tests/test_model_commands.py +76 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/tests/test_models.py +27 -0
- datasecops_cli-0.6.2/src/datasecops_cli/__init__.py +0 -1
- datasecops_cli-0.6.2/src/datasecops_cli/main.py +0 -852
- datasecops_cli-0.6.2/src/datasecops_cli/services/dbt_project_generator.py +0 -230
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/.github/workflows/auto-tag.yml +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/.github/workflows/publish-cli.yml +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/.github/workflows/test.yml +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/LICENSE +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/docs/legacy.md +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/mcp-servers.json +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/menus/__init__.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/menus/git_operations.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/models/__init__.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/models/git_helpers.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/services/__init__.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/services/directory_scaffolder.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/services/git_service.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/services/upstream_service.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/utilities/__init__.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/utilities/file_utils.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_cli/utilities/yaml_utils.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_mcp/__init__.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/src/datasecops_mcp/__main__.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/tests/__init__.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/tests/test_file_utils.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/tests/test_version.py +0 -0
- {datasecops_cli-0.6.2 → datasecops_cli-0.7.0b2}/tests/test_yaml_utils.py +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Instructions for AI agents (and humans) working on the DataSecOps CLI
|
|
2
|
+
|
|
3
|
+
The `datasecops` CLI (Click) is the developer and CI companion to the Orbit (DataSecOps Framework)
|
|
4
|
+
Snowflake Native App (`monitorial-io/monitorial.orbit.nativeapp`). This repository also owns
|
|
5
|
+
`src/datasecops_model`, the DCM model package that the app vendors. See `DEVELOPMENT.md` for setup,
|
|
6
|
+
project structure and publishing.
|
|
7
|
+
|
|
8
|
+
## Git workflow
|
|
9
|
+
|
|
10
|
+
- **Never commit to `main`.** Every change goes on a branch and reaches `main` through a pull request.
|
|
11
|
+
Keep one branch per open PR; ongoing DCM work goes on `feature/dcm-integration` (PR #31) until it
|
|
12
|
+
is merged.
|
|
13
|
+
- Check `git status` and `git branch --show-current` before changing anything.
|
|
14
|
+
- Others push to shared branches too (e.g. version bumps for beta releases). If a push is rejected,
|
|
15
|
+
`git fetch`, look at the new commits, `git rebase origin/<branch>`, re-run the tests, then push.
|
|
16
|
+
Never force-push a shared branch without asking.
|
|
17
|
+
- Version numbers in `pyproject.toml` and releases (`cli-v*` tags) are the maintainers' call - don't
|
|
18
|
+
bump or tag unless asked.
|
|
19
|
+
- Commit only what you changed; never commit `.venv/`, `__pycache__/`, build output or secrets.
|
|
20
|
+
- Commit messages: a short imperative subject, a body that says why, and the CoCo footer:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
Generated with [Snowflake CoCo](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)
|
|
24
|
+
|
|
25
|
+
Co-authored-by: Snowflake CoCo <noreply@snowflake.com>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Tests
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
.venv/bin/python -m pytest -q
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Run them before every commit and report the real results. Add tests next to the existing ones
|
|
35
|
+
(`tests/test_dcm_model.py` for the model package, `tests/test_dcm_orchestrator.py` for `dcm`
|
|
36
|
+
commands, `tests/test_model_commands.py` for `model` commands, `tests/test_main.py` for Click wiring).
|
|
37
|
+
|
|
38
|
+
## `datasecops_model` (shared with the native app)
|
|
39
|
+
|
|
40
|
+
- Keep it dependency-light (pydantic; Jinja only lazily) - it also runs inside Snowflake stored
|
|
41
|
+
procedures from the app's `app.zip`.
|
|
42
|
+
- The schema (`datasecops.dcm/v1`) uses `extra="forbid"`: new fields must be optional with defaults so
|
|
43
|
+
existing model files keep loading. A model without `scope` is a full model; a scoped file is one
|
|
44
|
+
repository's slice (see `scope.py`).
|
|
45
|
+
- After changing it: commit here first, then vendor it into the app on an app branch and run the app's
|
|
46
|
+
tests:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
.venv/bin/python scripts/vendor_model.py <app-repo>/src
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`VENDOR.json` records this repository's commit, so vendor after committing. Never edit the app's copy.
|
|
53
|
+
- Starter model defaults: only `DATAOPS_ADMIN`, `DATA_ENGINEER_ADMIN` and `DEVELOPERS`, no warehouses.
|
|
54
|
+
ORGADMIN / GLOBALORGADMIN are optional Snowflake roles (not extracted; validation warns).
|
|
55
|
+
- `extract.to_warehouses` drops values equal to the `warehouse()` macro defaults, except the grant maps
|
|
56
|
+
(`grants`, `application_grants`), which must stay dictionaries.
|
|
57
|
+
|
|
58
|
+
## CLI conventions
|
|
59
|
+
|
|
60
|
+
- Commands are Click groups in `src/datasecops_cli/main.py`; logic lives in `services/`.
|
|
61
|
+
- Options are consistent across commands: `-p/--project` (repeatable; names, types or `all`),
|
|
62
|
+
`--target`, `--connection/-c`, `--check` for CI checks that must not write files.
|
|
63
|
+
- Commands must work non-interactively in CI (`CI`, `GITHUB_ACTIONS`, `TF_BUILD`, `BUILD_BUILDID`):
|
|
64
|
+
never prompt there; `dcm deploy` stops for manual scripts only at a terminal.
|
|
65
|
+
- Native app procedures are called through `SnowflakeService.call_procedure`, which only allows names
|
|
66
|
+
in `ALLOWED_PROCEDURES`: add new ones there.
|
|
67
|
+
- Say **CoCo**, not "Cortex Code" (the `cortex` command name stays).
|
|
68
|
+
|
|
69
|
+
## Documentation
|
|
70
|
+
|
|
71
|
+
When commands or behaviour change, update in the same change: `docs/dcm.md` (DCM), `README.md`, and
|
|
72
|
+
an entry under `## [Unreleased]` in `CHANGELOG.md`.
|
|
73
|
+
|
|
74
|
+
## Working style
|
|
75
|
+
|
|
76
|
+
- Read the code before changing it, keep changes to what was asked, and flag wider changes.
|
|
77
|
+
- Ask before outward-facing or hard-to-reverse actions that weren't requested (opening or merging PRs,
|
|
78
|
+
tagging releases, publishing, running DDL/DML against an account).
|
|
79
|
+
- At the end, say what changed, what was tested (with the results) and what is still to do.
|
|
@@ -2,6 +2,86 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the DataSecOps CLI are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **Default app database renamed to `MONITORIAL_ORBIT`** — the `datasecops setup` suggested app-database name (and matching docs examples) was `DATA_ENGINEERS_DATASECOPS_FRAMEWORK`; it now matches the native app's actual installed name.
|
|
10
|
+
- **`dbt_project.yml` generator matches the source-based project spec** — added `docs-paths`, fixed `analysis-paths` (was `analyses`), added top-level `seeds:`/`tests:` blocks, `+static_analysis`/`+meta`/`+tags` at the model root, per-object-type `+static_analysis` (stored procedures/UDFs off, tasks baseline), the commented-out post-hook/on-run-start/on-run-end guidance, and the data-governance `vars` block.
|
|
11
|
+
- **`profiles.yml` deploy targets now run as the framework's CI identity** — every target except `local-dev` previously used the local developer's Snowflake user with each target's own role/warehouse. They now use the CI Username/Role/Warehouse from the native app's Deployment settings (new `ProjectSettings.ci_username`/`ci_role`/`ci_warehouse`, falling back to the previous behavior when unset), matching what the CI pipeline actually deploys with.
|
|
12
|
+
- **`datasecops setup` could silently default to GitHub for a non-GitHub platform** — `PROJECT`/`SOURCE_CONTROL`/`WORK_ITEMS` framework config and profile/`profiles.yml` resolution were one single `try/except`; any failure after connecting (including just the `SOURCE_CONTROL` fetch itself) discarded already-fetched config and silently fell back to `SourceControl()`'s default platform (`GitHub`) with no indication why, so the MCP setup step could prompt for the wrong PAT. Each framework config fetch is now independent, so one failing can't blank out another; a missing/failed `SOURCE_CONTROL` config, or one missing `source_control_platform` specifically, now warns explicitly which platform it's defaulting to.
|
|
13
|
+
- **`local-dev` could be overwritten by a same-named framework target, or by the CI identity on a plain `dbt run`** — `generate_profiles_yml` no longer lets a framework target literally named `local-dev` clobber the dedicated external-browser output, and the profile's default target is now always `local-dev` (previously it followed whatever the native app marked as its own default, which could be a deploy-only target running as the CI identity). `_run_interactive` and bootstrap's `dbt deps` step now always run as `local-dev` instead of trusting the framework's default target.
|
|
14
|
+
- **Re-running `datasecops setup` for an already-known profile never refreshed its deployment targets** — a CI identity change in the native app had no effect until `profiles.yml` was deleted. Setup now always refreshes the CI/deployment targets (while preserving an existing `local-dev` target if already customized), and skips writing `profiles.yml` entirely if the `PROJECT` framework config couldn't be loaded (previously it wrote incorrect defaults).
|
|
15
|
+
- **Hardened `dbt_project.yml` generation against unsafe characters and a YAML boolean-coercion bug** — project/profile name, dbt version and warehouse name are now validated against a safe identifier pattern before being substituted into the raw YAML template (closing a potential injection via a newline or quote in native-app-configured values), and `static_analysis: off` is now quoted so YAML doesn't resolve it to the boolean `false`.
|
|
16
|
+
|
|
17
|
+
### Docs
|
|
18
|
+
|
|
19
|
+
- **Documented setting up `~/.dbt/profiles.yml`** — `datasecops bootstrap` writes a generated `profiles.yml` inside the dbt project folder as a reference only; dbt itself reads from `~/.dbt` (per the native app's `profile_dir` setting), which getting-started.md now explains, including the minimal `local-dev` block a developer needs there.
|
|
20
|
+
|
|
21
|
+
## [0.7.0b1] - 2026-10-26
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- **Shared DCM model (`datasecops_model`)** — one versioned JSON document (`config/dcm_model.json`, schema `datasecops.dcm/v1`) describing every DCM project (type, dir, `depends_on`, targets with deploy roles), the security model (role groups with environment fan-out, SCIM/UGE prefixes, diagram layout) and the warehouses (the `warehouse()` macro arguments, grants, application grants, budgets). The same package is vendored into the DataSecOps native app (`scripts/vendor_model.py`), so the app and the CLI validate, render and draw identically.
|
|
26
|
+
- **`datasecops model` commands** — `import` (build the model from existing hand-written DCM projects), `validate` (hierarchy: cycles, orphans, unknown roles, duplicate grants, SCIM typos, bootstrap mode; cross-project: warehouse grantees exist, `depends_on` acyclic, unique DCM identifiers), `render [--check] [--scaffold] [--manifest]` (generates `roles.sql` / `warehouses.sql` / `manifest.yml` that still use the projects' macros, so the rendered SQL is statement-identical), `scripts [--previous REF] [--ado]` (pre/post auto/manual scripts incl. application grants, budgets, account privileges and REVOKEs for removed privileges), `diagram [--check]` (grid / snowflake-only / entra-links / entra-ace-map SVGs + markdown), `extract [--diff|--merge|--replace]` (current roles, role grants and warehouses via SHOW commands, env-suffixed roles folded back into environment groups), `pull` / `push` (native app ↔ local file), `schema`.
|
|
27
|
+
- **Multi-project DCM** — `--project` is repeatable and accepts project names, types (`security` / `platform` / `custom`) or `all`; projects always run in `depends_on` order and a failed project skips its dependants only. Each target's `deploy_role` is passed to `snow` as `--role`.
|
|
28
|
+
- **`datasecops dcm deploy`** — generates `out/scripts` per project, refuses to deploy while a manual ACCOUNTADMIN pre-deploy script is pending (unless `--pre-manual-done`), runs `pre_auto.sql` → `snow dcm deploy --alias <target>-<build>-<sha>` → records the deployment (with the CI identity) → `post_auto.sql`.
|
|
29
|
+
- **`datasecops dcm plan --summary plan.md --fail-on-changes`** — runs `snow dcm plan --save-output`, summarises `out/plan/plan_result.json` (counts per operation, DROP / REVOKE warnings, manual steps) for PR comments.
|
|
30
|
+
- **Shared environments** in the DCM model: `environments` are defined once and every project inherits them (`<database>.<schema_name>.<OBJECT_NAME><object_suffix>`, owned by the project `owner`); per-project `targets` are now overrides only. Older models load unchanged; `convert_to_environments` (app: *Use shared environments*) lifts identical targets.
|
|
31
|
+
- **`datasecops dcm pipelines`** — downloads the DCM pipelines defined in the native app's Pipelines page (multi-project steps `dcm_cli_setup`, `dcm_model_validate`, `dcm_render_check`, `dcm_generate_scripts`, `dcm_plan_all`, `dcm_deploy_all`; defaults *DCM Pull Request* and *DCM Release* = build → manual pre gate → deploy → manual post gate). `datasecops download dcm` writes the same files. Pipelines are no longer generated locally.
|
|
32
|
+
- **Per-project DCM pipelines** — each DCM pipeline deploys a single project (projects usually live in their own repositories); the app's all-projects *DCM Pull Request* / *DCM Release* pipelines are gone. `datasecops dcm pipelines` writes the app's pipelines (*DCM PR validate* / *DCM deploy*, assigned to DCM projects in the app) once per assigned project as `.github/workflows/dcm-<project>-<file>` / `.azuredevops/dcm-<project>-<file>`, the same paths the app pushes; `--project` limits them to some projects. Their unassigned generic rendering is never written.
|
|
33
|
+
- **One model file per repository** — each repository's `config/dcm_model.json` holds only its part of the model, marked by a `scope` block: a security project gets the RBAC model (plus warehouse names), a platform project the warehouses (plus role names, so grants are still validated), a custom project only its project. `datasecops model pull` writes the current repository's slice (`-p NAME` to choose, `--full` for the whole model), `model push` merges a slice back into the app's model, `model extract` only compares the sections the file holds and `model diagram --check` passes when no security project is selected. Files without `scope` are the full model, as before (`datasecops_model.scope`: `scoped_model`, `merge_scoped`).
|
|
34
|
+
- **`dcm deploy --sync-model`** — step 7 updates the native app's model from the deployed model file after a successful deploy of a project's default target (`api.sync_deployed_model`). The app only applies it when its own part (the repository's projects and RBAC or warehouses) is unchanged since it last exchanged it with git; otherwise the deploy warns and the drift is left for someone to reconcile. Never fails the deploy. The *DCM deploy* pipeline passes it.
|
|
35
|
+
- **Step-by-step `dcm deploy`** — each project's deploy prints numbered steps (generate scripts, manual pre-deploy script, `pre_auto.sql`, `snow dcm deploy`, `post_auto.sql`, manual post-deploy script). At a terminal and in the DCM Operations menu it stops at a manual ACCOUNTADMIN script, names the file and waits for `done` (`show` prints it, `stop` ends the deploy); in CI or with `--no-input` it never waits. The menu no longer asks about manual scripts up front.
|
|
36
|
+
- **`datasecops dcm list` / `dcm deployments`**; the DCM menu works on every project in the model and its "download" option pulls the model from the app or extracts it from Snowflake.
|
|
37
|
+
- **DCM predeploy/postdeploy SQL scripts** — `datasecops dcm deploy` now runs numbered `.sql` scripts from `<project>/predeploy/` before `snow dcm deploy` and `<project>/postdeploy/` after it succeeds (sorted by filename, executed via `snow sql -f`). A failing predeploy script aborts the deploy for that project; a failing postdeploy script is reported (and fails the overall exit code) but doesn't block the already-recorded deployment status. Both folders are optional (missing/empty = no-op) and are also runnable independently via new `datasecops dcm predeploy`/`datasecops dcm postdeploy` subcommands and matching `DCM Operations` menu options. `BootstrapService`'s DCM scaffolding now creates empty `predeploy/`/`postdeploy/` folders alongside `definitions/`. (These folders are now the legacy auto layout: `pre_deployment/{auto,manual}` and `post_deployment/{auto,manual}` are preferred.)
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
|
|
41
|
+
- **Starter model holds only the framework's own roles** — DATAOPS_ADMIN, DATA_ENGINEER_ADMIN (the `warehouse()` macro's admin role, so the SYSADMIN admin-role override is gone) and DEVELOPERS, and no warehouses; everything else is imported from Snowflake.
|
|
42
|
+
- **Clearer diagram layout errors** — instead of "grouping 'None' is not listed in diagram_groups", the message names the roles without a diagram box and says to set a Grouping, or names the missing box and the roles that use it. Diagram boxes carry `data-box` so the app can drop dragged roles on them.
|
|
43
|
+
- **ORGADMIN / GLOBALORGADMIN are optional Snowflake roles** — they only exist in some accounts (the organization account), so `model extract` / Import from Snowflake no longer records grants to or from them, and a model that references them validates with a warning ("the deploy fails where it does not exist") instead of an unknown-role or bootstrap error.
|
|
44
|
+
|
|
45
|
+
- **No built-in default DCM target** — `dcm_default_target` (and the app DCM config's `default_target`) no longer default to `DEV`; without one a project uses its `default_target`, else its first target.
|
|
46
|
+
|
|
47
|
+
- **Bootstrap scaffolds real DCM projects** from the native app's DCM model (or a starter model using the app's DCM naming convention): valid `manifest.yml` files, generated definitions, the framework macros and the deployment folders, instead of comment-only manifests.
|
|
48
|
+
- **`SnowflakeService.call_procedure` only calls allow-listed native app procedures.**
|
|
49
|
+
- **MCP setup no longer writes tokens into `mcp.json`** — servers read `SNOWFLAKE_PAT`, `GITHUB_PERSONAL_ACCESS_TOKEN` and `AZURE_DEVOPS_PAT` from the environment.
|
|
50
|
+
- **Azure DevOps DCM pipelines are written to `.azuredevops/`** (was `.azuredevops/workflows/`).
|
|
51
|
+
- Removed the "one security + one platform project per target" assumption from project resolution and the MCP DCM tools; added the `dcm_get_model` MCP tool.
|
|
52
|
+
|
|
53
|
+
- **Migrated the non-interactive command tree from `argparse` to Click** — `setup`, `bootstrap`, `download`, and `dcm` (`init`/`analyze`/`plan`/`deploy`) are now a `click` group/subcommands instead of a hand-rolled `argparse.ArgumentParser`. CLI flags, defaults, and exit codes are unchanged; `--help` output is now Click-formatted. The interactive menu system (`menus/*.py`) is unaffected.
|
|
54
|
+
- **Colored output now uses `click.secho`/`click.style` instead of `colorama`** — fixes ANSI escape codes leaking into non-TTY output (e.g. CI/CD logs for `datasecops download`/`datasecops dcm`), since Click auto-detects when stdout isn't a terminal and strips color codes.
|
|
55
|
+
- **`DcmService` now validates the Snowflake connection name** before using it in any `snow`/`snow sql` subprocess call, closing the one dynamic value that wasn't already covered by `_validate_token` (target/alias/project identifiers already were).
|
|
56
|
+
- **`tests/test_main.py` now exercises the CLI via `click.testing.CliRunner`** instead of calling `_build_parser()` directly, giving more faithful coverage of the actual command-line entry point.
|
|
57
|
+
|
|
58
|
+
### Dependencies
|
|
59
|
+
|
|
60
|
+
- Added `click>=8.1`, `jinja2>=3.1`.
|
|
61
|
+
- Removed `colorama` (no longer used).
|
|
62
|
+
|
|
63
|
+
### Fixed
|
|
64
|
+
|
|
65
|
+
- **Role hierarchy diagrams: built-in admin roles** — the built-in Snowflake hierarchy (ACCOUNTADMIN > SYSADMIN / SECURITYADMIN > USERADMIN) now sets the rows inside a box, so the admin roles draw as a tree instead of one row with dashed arrows running through each other; a built-in edge the model already has is not drawn twice.
|
|
66
|
+
|
|
67
|
+
## [0.7.0] - 2026-09-07
|
|
68
|
+
|
|
69
|
+
### Added
|
|
70
|
+
|
|
71
|
+
- **DCM (Database Change Management) support** — new `DcmService` wraps `snow dcm` commands (analyze, plan, deploy, create, list-deployments) for the security/platform two-project model.
|
|
72
|
+
- **DCM Operations menu** — new interactive menu (init, analyze, plan, deploy, status, download, list projects) accessible from the main menu when `dcm_enabled: true` is set in `.datasecops.yml`.
|
|
73
|
+
- **`datasecops dcm` subcommand** — non-interactive `init`/`analyze`/`plan`/`deploy` commands with `--target`, `--project`, and `--connection` flags for CI/CD pipelines.
|
|
74
|
+
- **DCM MCP tools** — `dcm_list_projects`, `dcm_get_project_status`, and `dcm_get_deployment_targets` exposed to AI coding assistants.
|
|
75
|
+
- **DCM config fields** — `.datasecops.yml` now supports `dcm_enabled`, `dcm_security_dir`, `dcm_platform_dir`, and `dcm_default_target`.
|
|
76
|
+
- **DCM bootstrap scaffolding** — bootstrap can now optionally scaffold a `security/`/`platform/` DCM project structure from the native app's DCM configuration.
|
|
77
|
+
- **`datasecops download dcm`** — downloads DCM configuration and DCM-tagged pipeline templates from the native app for CI/CD use.
|
|
78
|
+
- **`dcm init` now actually registers a project** — requires `--project security|platform` and `--identifier` and calls `snow dcm create`, rather than only printing instructions.
|
|
79
|
+
- **Input validation on `snow dcm` invocations** — project identifiers, targets, and aliases are validated against a safe character set before being passed to `subprocess.run`.
|
|
80
|
+
|
|
81
|
+
### Fixed
|
|
82
|
+
|
|
83
|
+
- fixed `docs serve` command to target folder correctly
|
|
84
|
+
|
|
5
85
|
## [0.6.2] - 2026-09-07
|
|
6
86
|
|
|
7
87
|
### Changed
|
|
@@ -25,8 +105,8 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
25
105
|
|
|
26
106
|
### Changed
|
|
27
107
|
|
|
28
|
-
- **Skill target renamed** — "
|
|
29
|
-
- **Downloads menu label** — "
|
|
108
|
+
- **Skill target renamed** — "CoCo" target label renamed to "CoCo" to match the native app UI naming convention.
|
|
109
|
+
- **Downloads menu label** — "CoCo skills" renamed to "AI coding skills".
|
|
30
110
|
- **Shared conversion helpers** — extracted `_strip_frontmatter()` and `_prepare_body()` to eliminate duplication across format converters.
|
|
31
111
|
- **Robust frontmatter stripping** — uses line-boundary matching (`\n---`) instead of simple `split('---', 2)` to avoid false matches in skill body content.
|
|
32
112
|
- **Cursor description quoting** — `.mdc` description values are now properly quoted and sanitized (newlines removed, quotes escaped).
|
|
@@ -70,7 +150,7 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
70
150
|
|
|
71
151
|
- **AzureDevOps pipelines download to correct folder** — `download_pipelines` now writes AzureDevOps pipeline files to `.azuredevops/workflows/` instead of the project root, matching the platform convention (similar to how GitHub pipelines are written to `.github/workflows/`).
|
|
72
152
|
- **MCP server setup recognises all AzureDevOps platform variants** — the initial setup flow in `main.py` now uses case-insensitive matching for the platform name (`"AzureDevOps"` and `"Azure DevOps"` both work), consistent with the menu paths.
|
|
73
|
-
- **
|
|
153
|
+
- **CoCo MCP server uses absolute venv path** — the `datasecops-framework` MCP server entry in `.snowflake/cortex/mcp.json` now uses the absolute path to the project's `.venv/Scripts/datasecops-mcp` (Windows) or `.venv/bin/datasecops-mcp` (Unix) instead of the bare `datasecops-mcp` command, fixing "Process exited with code 1" errors in CoCo Desktop when the venv isn't on the system PATH.
|
|
74
154
|
|
|
75
155
|
## [0.5.4] - 2026-06-05
|
|
76
156
|
|
|
@@ -96,9 +176,9 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
96
176
|
|
|
97
177
|
### Changed
|
|
98
178
|
|
|
99
|
-
- **
|
|
100
|
-
- **All MCP servers included in
|
|
101
|
-
- **
|
|
179
|
+
- **CoCo MCP config is now project-level** — MCP server registration for CoCo now writes `.snowflake/cortex/mcp.json` in the project root instead of calling `cortex mcp add`. This enables project-scoped MCP servers in CoCo Desktop and removes the dependency on the `cortex` binary being installed.
|
|
180
|
+
- **All MCP servers included in CoCo config** — the datasecops-framework, GitHub, Azure DevOps, and dbt MCP servers are all written to the project-level config file with `"type": "stdio"` field.
|
|
181
|
+
- **CoCo always available as an AI tool option** — removed the `shutil.which("cortex")` check since we no longer need the cortex binary for MCP configuration.
|
|
102
182
|
- **Expanded `_ALLOWED_PROCEDURES`** — added `get_sqlfluff_config_file` and `get_documentation` to the MCP connection allowlist.
|
|
103
183
|
|
|
104
184
|
### Fixed
|
|
@@ -112,7 +192,7 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
112
192
|
|
|
113
193
|
### Added
|
|
114
194
|
|
|
115
|
-
- **MCP server CLI arguments** — `datasecops-mcp` now accepts `--connection-name` and `--app-database` arguments, eliminating the dependency on `.datasecops.yml` being in the working directory. This fixes connection failures when AI tools (
|
|
195
|
+
- **MCP server CLI arguments** — `datasecops-mcp` now accepts `--connection-name` and `--app-database` arguments, eliminating the dependency on `.datasecops.yml` being in the working directory. This fixes connection failures when AI tools (CoCo, Cursor, etc.) launch the MCP server from a different working directory.
|
|
116
196
|
- **`init_snowflake_service()` function** — new public API in `datasecops_mcp.connection` to pre-initialize the Snowflake service singleton with explicit parameters.
|
|
117
197
|
|
|
118
198
|
### Changed
|
|
@@ -212,22 +292,22 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
212
292
|
- **Configuration menu** — new `[4] configure` top-level menu consolidating tool installation and project setup:
|
|
213
293
|
- Install dbt-core & dbt-snowflake from framework-pinned versions
|
|
214
294
|
- Install SQLFluff from framework-pinned versions
|
|
215
|
-
- Configure MCP servers for VS Code, Cursor, Claude Code, or
|
|
295
|
+
- Configure MCP servers for VS Code, Cursor, Claude Code, or CoCo
|
|
216
296
|
- Initialize a new dbt project with framework profiles
|
|
217
|
-
- Update
|
|
218
|
-
- **
|
|
297
|
+
- Update CoCo to the latest version (`cortex update`)
|
|
298
|
+
- **CoCo agent connection** — new `cortex_connection` field in `.datasecops.yml` to configure the CoCo agent connection separately from the SQL connection. Selected during setup, checked on launch with a prompt to update if mismatched.
|
|
219
299
|
- **profiles.yml generation during setup** — setup now connects to Snowflake, fetches framework PROJECT settings and targets, and creates the profile entry in `profiles.yml` at the framework-defined `profile_dir` location. Creates directory and file if missing, preserves existing profiles.
|
|
220
300
|
- **Profile name resolution during setup** — setup reads `profile_name` from `dbt_project.yml` if it exists, otherwise fetches profiles from the native app (auto-selects single profile, prompts for multiple).
|
|
221
|
-
- **MCP server configuration during setup** — setup now offers to configure MCP servers for AI tools (VS Code, Cursor, Claude Code,
|
|
222
|
-
- **
|
|
223
|
-
- **Auto-install prerequisites in setup scripts** — `setup.ps1` and `setup.sh` now offer to install missing tools: uv (auto), dbt Fusion (auto),
|
|
301
|
+
- **MCP server configuration during setup** — setup now offers to configure MCP servers for AI tools (VS Code, Cursor, Claude Code, CoCo) with platform auto-detected from framework SOURCE_CONTROL config.
|
|
302
|
+
- **CoCo and Node.js prerequisite checks** — setup now checks for `cortex` and `node` on PATH alongside existing `dbtf`, `gh`, and `az` checks.
|
|
303
|
+
- **Auto-install prerequisites in setup scripts** — `setup.ps1` and `setup.sh` now offer to install missing tools: uv (auto), dbt Fusion (auto), CoCo, GitHub CLI (`winget`/`brew`/`apt`), Azure CLI (`winget`/`brew`/`curl`).
|
|
224
304
|
|
|
225
305
|
### Changed
|
|
226
306
|
|
|
227
307
|
- **Main menu renumbered** — configure `[4]`, downloads `[5]`, bootstrap `[6]`, update pkgs `[7]`
|
|
228
308
|
- **Install options moved to configuration menu** — removed `[14] install lint` from development menu and `[6] install` from SQLFluff lint submenu; removed `[6] new project` and `[7] mcp servers` from downloads menu
|
|
229
309
|
- **Setup prompt defaults to yes** — `Run setup now?` now defaults to `y` with a branded header
|
|
230
|
-
- **
|
|
310
|
+
- **CoCo launch sets both connections** — runs `cortex connections set` for SQL and `cortex --connection` for agent, with mismatch detection against `settings.json`
|
|
231
311
|
|
|
232
312
|
### Fixed
|
|
233
313
|
|
|
@@ -241,18 +321,18 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
241
321
|
|
|
242
322
|
### Added
|
|
243
323
|
|
|
244
|
-
- **Launch
|
|
245
|
-
- **Automatic skill registration with
|
|
324
|
+
- **Launch CoCo from main menu** — new option `[3] cortex code` launches the CoCo AI coding agent directly from the CLI. Shows an error with install link if `cortex` is not on PATH.
|
|
325
|
+
- **Automatic skill registration with CoCo** — after installing skills to `~/.cortex/skills/`, the CLI now runs `cortex skill add` to register the directory so skills are immediately discoverable as `$skill-name` commands. Previously skills were written to disk but not registered.
|
|
246
326
|
|
|
247
327
|
### Changed
|
|
248
328
|
|
|
249
|
-
- **Main menu renumbered** — downloads moved to `[4]`, bootstrap to `[5]`, update pkgs to `[6]` to accommodate the new
|
|
329
|
+
- **Main menu renumbered** — downloads moved to `[4]`, bootstrap to `[5]`, update pkgs to `[6]` to accommodate the new CoCo option at `[3]`
|
|
250
330
|
|
|
251
331
|
## [0.4.0] - 2026-05-16
|
|
252
332
|
|
|
253
333
|
### Added
|
|
254
334
|
|
|
255
|
-
- **Framework-aligned project scaffolding** — `datasecops bootstrap` now generates `dbt_project.yml` directly from the native app configuration instead of running `dbtf init`. The generated project matches the `setup-dbt-project`
|
|
335
|
+
- **Framework-aligned project scaffolding** — `datasecops bootstrap` now generates `dbt_project.yml` directly from the native app configuration instead of running `dbtf init`. The generated project matches the `setup-dbt-project` CoCo skill specification, including:
|
|
256
336
|
- Model sections based on profile's `MODEL_TYPES` (sources, dimensional_modelling, domains, cortex_models)
|
|
257
337
|
- Object sections with doc node colors (stored_procedures, tasks, UDFs)
|
|
258
338
|
- `dispatch` with framework package search order
|
|
@@ -271,7 +351,7 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
271
351
|
- `get_support_contacts` — team contact details
|
|
272
352
|
- **New native app stored procedures** — `api.get_model_definitions()`, `api.get_object_definitions()`, `api.get_source_definitions()`, `api.get_access_groups()`, `api.get_support_contacts()` for CLI/MCP consumption
|
|
273
353
|
- **New SnowflakeService methods** — both CLI and MCP Snowflake services expose the new stored procedures
|
|
274
|
-
- **Multi-IDE skill installation** — skills now install to Cursor (`.cursor/rules/{id}.mdc` with frontmatter) and Claude Code (`.claude/commands/{id}.md`) in addition to
|
|
354
|
+
- **Multi-IDE skill installation** — skills now install to Cursor (`.cursor/rules/{id}.mdc` with frontmatter) and Claude Code (`.claude/commands/{id}.md`) in addition to CoCo. Bootstrap and downloads menu prompt users to select target IDE(s) via a multi-select prompt (`[1] CoCo`, `[2] Cursor`, `[3] Claude Code`, `[a] All`)
|
|
275
355
|
- **`select_multiple_from_list` display helper** — new utility for comma-separated multi-select input with "all" shortcut
|
|
276
356
|
|
|
277
357
|
### Changed
|
|
@@ -417,7 +497,7 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
417
497
|
|
|
418
498
|
### Added
|
|
419
499
|
|
|
420
|
-
- **MCP Server** — new `datasecops-mcp` server exposes framework governance config to AI coding tools (VS Code, Cursor,
|
|
500
|
+
- **MCP Server** — new `datasecops-mcp` server exposes framework governance config to AI coding tools (VS Code, Cursor, CoCo, Claude Code)
|
|
421
501
|
- `get_branching_rules` — branch types, naming conventions, ticket requirements
|
|
422
502
|
- `get_linting_rules` — SQLFluff rules from the native app
|
|
423
503
|
- `get_dbt_packages` — approved packages with pinned versions
|
|
@@ -426,7 +506,7 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
426
506
|
- `get_project_settings` — project paths, execution mode, targets
|
|
427
507
|
- `get_project_profiles` — all registered dbt projects
|
|
428
508
|
- `get_deployment_targets` — environment targets with roles and warehouses
|
|
429
|
-
- `get_available_skills` —
|
|
509
|
+
- `get_available_skills` — CoCo skills metadata
|
|
430
510
|
- `get_default_macros` — default macros for a project profile
|
|
431
511
|
- `validate_branch_name` — validates branch names against framework conventions
|
|
432
512
|
- `get_deployment_workflow` — environment promotion flow
|
|
@@ -442,7 +522,7 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
442
522
|
5. Downloads `packages.yml` with approved versions
|
|
443
523
|
6. Runs `dbt deps`
|
|
444
524
|
7. Checks SQLFluff version requirements
|
|
445
|
-
8. Installs
|
|
525
|
+
8. Installs CoCo skills
|
|
446
526
|
- Also available from main menu as option [4]
|
|
447
527
|
|
|
448
528
|
- **Macro downloads** — new `api.get_macros_for_profile` integration
|
|
@@ -454,7 +534,7 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
454
534
|
- Check for Node.js (needed for GitHub/Azure DevOps MCP servers)
|
|
455
535
|
- Install with MCP support (`datasecops-cli[mcp]`)
|
|
456
536
|
- Optionally install `dbt-mcp`
|
|
457
|
-
- Interactively configure MCP servers for VS Code, Cursor, or
|
|
537
|
+
- Interactively configure MCP servers for VS Code, Cursor, or CoCo
|
|
458
538
|
- Support GitHub and Azure DevOps PAT configuration
|
|
459
539
|
|
|
460
540
|
- **MCP server integration guide** (`mcp-servers.json`) — example config for running framework, dbt, GitHub, and Azure DevOps MCP servers together
|
|
@@ -468,7 +548,7 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
468
548
|
|
|
469
549
|
### Documentation
|
|
470
550
|
|
|
471
|
-
- `docs/getting-started.md` — full setup guide for CLI + MCP servers with VS Code, Cursor,
|
|
551
|
+
- `docs/getting-started.md` — full setup guide for CLI + MCP servers with VS Code, Cursor, CoCo
|
|
472
552
|
- `docs/mcp-server.md` — MCP server reference with tool documentation, architecture, and usage examples
|
|
473
553
|
- `README.md` — updated with MCP server section, recommended server stack, and new documentation links
|
|
474
554
|
|
|
@@ -480,7 +560,7 @@ All notable changes to the DataSecOps CLI are documented in this file.
|
|
|
480
560
|
- Interactive menu-driven interface for dbt development, git operations, and configuration downloads
|
|
481
561
|
- dbt commands via dbt Fusion subprocess (run, build, test, lint, compile, snapshot, freshness, docs, seed, deps, clean, debug, list, retry)
|
|
482
562
|
- Git operations via GitPython (branching, commit, push, pull, rebase, squash, deploy, cherry-pick)
|
|
483
|
-
- Configuration downloads from native app (SQLFluff rules, CI/CD pipelines, dbt packages,
|
|
563
|
+
- Configuration downloads from native app (SQLFluff rules, CI/CD pipelines, dbt packages, CoCo skills)
|
|
484
564
|
- Framework-enforced branch naming conventions
|
|
485
565
|
- Environment branch deployment (dev/test/prod)
|
|
486
566
|
- SQLFluff linting with framework-managed rules
|
|
@@ -13,7 +13,7 @@ Before running setup, ensure you have:
|
|
|
13
13
|
|
|
14
14
|
Optional but recommended:
|
|
15
15
|
|
|
16
|
-
- **dbt
|
|
16
|
+
- **dbt 2.x** (`pip install dbt`) or **dbt Core 1.x** (`pip install dbt-core dbt-snowflake`) — required for dbt commands
|
|
17
17
|
- **Cortex Code** — required for skill downloads
|
|
18
18
|
|
|
19
19
|
## Quick Start
|
|
@@ -38,7 +38,7 @@ chmod +x setup.sh
|
|
|
38
38
|
The script will prompt you for:
|
|
39
39
|
|
|
40
40
|
- **Connection name** — the name of your Snowflake connection from `~/.snowflake/connections.toml`
|
|
41
|
-
- **Native app database name** — the database where the DataSecOps Framework app is installed (e.g. `
|
|
41
|
+
- **Native app database name** — the database where the DataSecOps Framework app is installed (e.g. `MONITORIAL_ORBIT`)
|
|
42
42
|
|
|
43
43
|
### 2. Activate the virtual environment
|
|
44
44
|
|
|
@@ -75,12 +75,12 @@ This connects to the native app, loads your project configuration, and presents
|
|
|
75
75
|
|
|
76
76
|
### Development Menu
|
|
77
77
|
|
|
78
|
-
Run dbt commands via dbt
|
|
78
|
+
Run dbt commands via dbt 2.x or dbt Core 1.x (configured engine):
|
|
79
79
|
|
|
80
80
|
- **run** — full run, modified only (`state:modified+`), or specific models
|
|
81
81
|
- **build** — run + test in one command
|
|
82
82
|
- **test** — all tests or specific selectors
|
|
83
|
-
- **lint** — SQLFluff lint/fix on modified files or entire project
|
|
83
|
+
- **lint** — SQLFluff lint/fix (dbt Core 1.x) or `dbt lint`/`dbt lint --fix` (dbt 2.x) on modified files or entire project
|
|
84
84
|
- **deps** — install dbt packages
|
|
85
85
|
- **seed** — load seed data
|
|
86
86
|
- **compile** — compile models
|
|
@@ -120,7 +120,7 @@ Created by the setup script in your project root. Contains:
|
|
|
120
120
|
|
|
121
121
|
```yaml
|
|
122
122
|
connection_name: "my_connection" # Snowflake connection name
|
|
123
|
-
app_database: "
|
|
123
|
+
app_database: "MONITORIAL_ORBIT" # Native app database
|
|
124
124
|
profile_name: "" # Auto-detected from dbt_project.yml
|
|
125
125
|
```
|
|
126
126
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: datasecops-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0b2
|
|
4
4
|
Summary: DataSecOps Framework CLI for Snowflake Native App
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
Requires-Python: >=3.10
|
|
8
|
-
Requires-Dist:
|
|
8
|
+
Requires-Dist: click>=8.1
|
|
9
9
|
Requires-Dist: gitpython>=3.1
|
|
10
|
+
Requires-Dist: jinja2>=3.1
|
|
10
11
|
Requires-Dist: pydantic>=2.0
|
|
11
12
|
Requires-Dist: pyyaml>=6.0
|
|
12
13
|
Requires-Dist: snowflake-connector-python>=3.0
|
|
@@ -27,10 +28,11 @@ The DataSecOps CLI is the local developer companion to the **Data Engineers Data
|
|
|
27
28
|
|
|
28
29
|
This CLI connects to the native app and gives developers:
|
|
29
30
|
|
|
30
|
-
- **dbt development commands** — run, build, test, lint, and manage dbt projects via dbt
|
|
31
|
+
- **dbt development commands** — run, build, test, lint, and manage dbt projects via dbt 2.x or dbt Core 1.x
|
|
31
32
|
- **Source control operations** — branching, committing, rebasing, and deploying via GitPython with naming conventions enforced by the framework
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
33
|
+
- **DCM projects** — validate, render, plan and deploy any number of Snowflake DCM projects from the shared DCM model (`config/dcm_model.json`), in dependency order with each project's deploy role
|
|
34
|
+
- **Configuration downloads** — pull SQLFluff rules, CI/CD pipelines, dbt packages, and CoCo skills from the native app to your local project
|
|
35
|
+
- **MCP server** — expose framework governance rules to AI coding assistants (VS Code, Cursor, CoCo, Claude Code)
|
|
34
36
|
|
|
35
37
|
## Installation
|
|
36
38
|
|
|
@@ -54,8 +56,8 @@ Requires Python 3.10 or later.
|
|
|
54
56
|
|
|
55
57
|
Optional:
|
|
56
58
|
|
|
57
|
-
- **dbt
|
|
58
|
-
- **
|
|
59
|
+
- **dbt** — required for dbt commands (`dbt`). Install via `pip install dbt` (dbt 2.x) or `pip install dbt-core dbt-snowflake` (dbt Core 1.x), matching the engine configured in the native app's Project Settings.
|
|
60
|
+
- **CoCo** for skill downloads
|
|
59
61
|
- **Node.js 18+** for GitHub/Azure DevOps MCP servers
|
|
60
62
|
|
|
61
63
|
## Quick Start
|
|
@@ -82,7 +84,8 @@ datasecops
|
|
|
82
84
|
|------|-------------|
|
|
83
85
|
| **Development** | dbt run, build, test, lint (SQLFluff), deps, seed, compile, snapshot, freshness, docs |
|
|
84
86
|
| **Git** | Branch create/checkout/delete, commit & push, rebase, squash, deploy to environment branches, cherry-pick, reset branch from main |
|
|
85
|
-
| **
|
|
87
|
+
| **DCM Operations** | Plan, deploy, status, download and list the DCM projects in the model |
|
|
88
|
+
| **Downloads** | SQLFluff config, CI/CD pipelines (GitHub Actions / Azure DevOps), dbt packages, CoCo skills |
|
|
86
89
|
|
|
87
90
|
## Non-Interactive Mode (CI/CD)
|
|
88
91
|
|
|
@@ -117,7 +120,7 @@ Your pipeline needs two things:
|
|
|
117
120
|
|
|
118
121
|
```yaml
|
|
119
122
|
connection_name: "ci"
|
|
120
|
-
app_database: "
|
|
123
|
+
app_database: "MONITORIAL_ORBIT"
|
|
121
124
|
```
|
|
122
125
|
|
|
123
126
|
2. **A Snowflake connection** in `~/.snowflake/connections.toml` for the CI service account:
|
|
@@ -143,6 +146,21 @@ Your pipeline needs two things:
|
|
|
143
146
|
|
|
144
147
|
The exit code is `0` on success, `1` if any download fails.
|
|
145
148
|
|
|
149
|
+
## DCM projects
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
datasecops model pull # native app -> config/dcm_model.json (this repo's projects; --full = all)
|
|
153
|
+
datasecops model validate
|
|
154
|
+
datasecops model render --check # generated definitions are current
|
|
155
|
+
datasecops dcm plan -p security --target PROD --summary dcm-plan.md
|
|
156
|
+
datasecops dcm deploy -p security --target PROD
|
|
157
|
+
datasecops dcm pipelines # the app-defined pipelines assigned to each project
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Each DCM project usually lives in its own repository, and its pipelines (*DCM PR validate*, *DCM
|
|
161
|
+
deploy*) plan and deploy that single project. See [docs/dcm.md](docs/dcm.md) for the model, every
|
|
162
|
+
command, the deployment scripts and the pipelines.
|
|
163
|
+
|
|
146
164
|
## MCP Server
|
|
147
165
|
|
|
148
166
|
The package includes an MCP (Model Context Protocol) server that exposes your framework's governance configuration to AI coding assistants. Instead of static skill files, the MCP server gives AI tools live access to your native app's current rules.
|
|
@@ -158,7 +176,7 @@ The package includes an MCP (Model Context Protocol) server that exposes your fr
|
|
|
158
176
|
|
|
159
177
|
### Setup for AI Tools
|
|
160
178
|
|
|
161
|
-
**
|
|
179
|
+
**CoCo** — add to `.snowflake/cortex/mcp.json` in your project root:
|
|
162
180
|
|
|
163
181
|
```json
|
|
164
182
|
{
|
|
@@ -246,7 +264,7 @@ The CLI reads from a `.datasecops.yml` file in your project root (created by the
|
|
|
246
264
|
|
|
247
265
|
```yaml
|
|
248
266
|
connection_name: "my_connection"
|
|
249
|
-
app_database: "
|
|
267
|
+
app_database: "MONITORIAL_ORBIT"
|
|
250
268
|
```
|
|
251
269
|
|
|
252
270
|
Project profiles, linting rules, pipeline templates, and deployment targets are all managed centrally in the native app and pulled down by the CLI.
|
|
@@ -8,10 +8,11 @@ The DataSecOps CLI is the local developer companion to the **Data Engineers Data
|
|
|
8
8
|
|
|
9
9
|
This CLI connects to the native app and gives developers:
|
|
10
10
|
|
|
11
|
-
- **dbt development commands** — run, build, test, lint, and manage dbt projects via dbt
|
|
11
|
+
- **dbt development commands** — run, build, test, lint, and manage dbt projects via dbt 2.x or dbt Core 1.x
|
|
12
12
|
- **Source control operations** — branching, committing, rebasing, and deploying via GitPython with naming conventions enforced by the framework
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
13
|
+
- **DCM projects** — validate, render, plan and deploy any number of Snowflake DCM projects from the shared DCM model (`config/dcm_model.json`), in dependency order with each project's deploy role
|
|
14
|
+
- **Configuration downloads** — pull SQLFluff rules, CI/CD pipelines, dbt packages, and CoCo skills from the native app to your local project
|
|
15
|
+
- **MCP server** — expose framework governance rules to AI coding assistants (VS Code, Cursor, CoCo, Claude Code)
|
|
15
16
|
|
|
16
17
|
## Installation
|
|
17
18
|
|
|
@@ -35,8 +36,8 @@ Requires Python 3.10 or later.
|
|
|
35
36
|
|
|
36
37
|
Optional:
|
|
37
38
|
|
|
38
|
-
- **dbt
|
|
39
|
-
- **
|
|
39
|
+
- **dbt** — required for dbt commands (`dbt`). Install via `pip install dbt` (dbt 2.x) or `pip install dbt-core dbt-snowflake` (dbt Core 1.x), matching the engine configured in the native app's Project Settings.
|
|
40
|
+
- **CoCo** for skill downloads
|
|
40
41
|
- **Node.js 18+** for GitHub/Azure DevOps MCP servers
|
|
41
42
|
|
|
42
43
|
## Quick Start
|
|
@@ -63,7 +64,8 @@ datasecops
|
|
|
63
64
|
|------|-------------|
|
|
64
65
|
| **Development** | dbt run, build, test, lint (SQLFluff), deps, seed, compile, snapshot, freshness, docs |
|
|
65
66
|
| **Git** | Branch create/checkout/delete, commit & push, rebase, squash, deploy to environment branches, cherry-pick, reset branch from main |
|
|
66
|
-
| **
|
|
67
|
+
| **DCM Operations** | Plan, deploy, status, download and list the DCM projects in the model |
|
|
68
|
+
| **Downloads** | SQLFluff config, CI/CD pipelines (GitHub Actions / Azure DevOps), dbt packages, CoCo skills |
|
|
67
69
|
|
|
68
70
|
## Non-Interactive Mode (CI/CD)
|
|
69
71
|
|
|
@@ -98,7 +100,7 @@ Your pipeline needs two things:
|
|
|
98
100
|
|
|
99
101
|
```yaml
|
|
100
102
|
connection_name: "ci"
|
|
101
|
-
app_database: "
|
|
103
|
+
app_database: "MONITORIAL_ORBIT"
|
|
102
104
|
```
|
|
103
105
|
|
|
104
106
|
2. **A Snowflake connection** in `~/.snowflake/connections.toml` for the CI service account:
|
|
@@ -124,6 +126,21 @@ Your pipeline needs two things:
|
|
|
124
126
|
|
|
125
127
|
The exit code is `0` on success, `1` if any download fails.
|
|
126
128
|
|
|
129
|
+
## DCM projects
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
datasecops model pull # native app -> config/dcm_model.json (this repo's projects; --full = all)
|
|
133
|
+
datasecops model validate
|
|
134
|
+
datasecops model render --check # generated definitions are current
|
|
135
|
+
datasecops dcm plan -p security --target PROD --summary dcm-plan.md
|
|
136
|
+
datasecops dcm deploy -p security --target PROD
|
|
137
|
+
datasecops dcm pipelines # the app-defined pipelines assigned to each project
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Each DCM project usually lives in its own repository, and its pipelines (*DCM PR validate*, *DCM
|
|
141
|
+
deploy*) plan and deploy that single project. See [docs/dcm.md](docs/dcm.md) for the model, every
|
|
142
|
+
command, the deployment scripts and the pipelines.
|
|
143
|
+
|
|
127
144
|
## MCP Server
|
|
128
145
|
|
|
129
146
|
The package includes an MCP (Model Context Protocol) server that exposes your framework's governance configuration to AI coding assistants. Instead of static skill files, the MCP server gives AI tools live access to your native app's current rules.
|
|
@@ -139,7 +156,7 @@ The package includes an MCP (Model Context Protocol) server that exposes your fr
|
|
|
139
156
|
|
|
140
157
|
### Setup for AI Tools
|
|
141
158
|
|
|
142
|
-
**
|
|
159
|
+
**CoCo** — add to `.snowflake/cortex/mcp.json` in your project root:
|
|
143
160
|
|
|
144
161
|
```json
|
|
145
162
|
{
|
|
@@ -227,7 +244,7 @@ The CLI reads from a `.datasecops.yml` file in your project root (created by the
|
|
|
227
244
|
|
|
228
245
|
```yaml
|
|
229
246
|
connection_name: "my_connection"
|
|
230
|
-
app_database: "
|
|
247
|
+
app_database: "MONITORIAL_ORBIT"
|
|
231
248
|
```
|
|
232
249
|
|
|
233
250
|
Project profiles, linting rules, pipeline templates, and deployment targets are all managed centrally in the native app and pulled down by the CLI.
|