cassis-cli 1.3.0__tar.gz → 1.4.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cassis-cli
3
- Version: 1.3.0
3
+ Version: 1.4.0
4
4
  Summary: Cassis CLI — run Cassis actions (ontology validation, upload and publish) from your CI pipelines
5
5
  License: Apache-2.0
6
6
  License-File: LICENSE
@@ -24,7 +24,7 @@ Description-Content-Type: text/markdown
24
24
 
25
25
  Run Cassis actions from your CI pipelines:
26
26
 
27
- - `cassis ontology check` validates the ontology files in your repository with the exact same checks as the Cassis GitHub PR check (YAML parsing, round-trip, import validation) — so you can gate merges in any CI system, not just GitHub. In a checkout bound to a project (`project.yml`, `--project`, or `CASSIS_PROJECT_ID`), it also cross-checks the tree against the project's source schema: references to tables or columns the warehouse doesn't have print as **warnings** — advisory only (the object may simply not be built or synced yet), never a failed check.
27
+ - `cassis ontology check` validates the ontology files in your repository with the exact same checks as the Cassis GitHub PR check (YAML parsing, round-trip, import validation) — so you can gate merges in any CI system, not just GitHub. It then prints advisory **ontology quality warnings** for a tree that parsed — tables not assigned to any domain, joins/metrics pointing at unknown tables or columns, missing table/column descriptions (the same findings `ontology test` reports, without the agent run). In a checkout bound to a project (`project.yml`, `--project`, or `CASSIS_PROJECT_ID`), it also cross-checks the tree against the project's source schema: references to tables or columns the warehouse doesn't have print as **warnings** too — advisory only (the object may simply not be built or synced yet). Warnings never fail the check.
28
28
  - `cassis schema pull` downloads the data source's full source schema (as Cassis last introspected it) into `<base-path>/.schema.json` — a **gitignored** local snapshot (the command maintains the ignore entry) with a `pulled_at` stamp. The warehouse stays authoritative; the snapshot is a cache for offline/bulk work — e.g. a coding agent grepping table and column names during a modeling pass instead of paging through the MCP `get_source_schema` tool. Re-run to refresh.
29
29
  - `cassis ontology fmt` rewrites the ontology files in canonical form (think `black`/`gofmt` for the ontology), so hand or agent edits pass the round-trip check.
30
30
  - `cassis ontology upload` uploads the ontology files to a Cassis project (full replace) and, by default, publishes them immediately as a new version — so a merge to your main branch can go live in one CI step.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Run Cassis actions from your CI pipelines:
4
4
 
5
- - `cassis ontology check` validates the ontology files in your repository with the exact same checks as the Cassis GitHub PR check (YAML parsing, round-trip, import validation) — so you can gate merges in any CI system, not just GitHub. In a checkout bound to a project (`project.yml`, `--project`, or `CASSIS_PROJECT_ID`), it also cross-checks the tree against the project's source schema: references to tables or columns the warehouse doesn't have print as **warnings** — advisory only (the object may simply not be built or synced yet), never a failed check.
5
+ - `cassis ontology check` validates the ontology files in your repository with the exact same checks as the Cassis GitHub PR check (YAML parsing, round-trip, import validation) — so you can gate merges in any CI system, not just GitHub. It then prints advisory **ontology quality warnings** for a tree that parsed — tables not assigned to any domain, joins/metrics pointing at unknown tables or columns, missing table/column descriptions (the same findings `ontology test` reports, without the agent run). In a checkout bound to a project (`project.yml`, `--project`, or `CASSIS_PROJECT_ID`), it also cross-checks the tree against the project's source schema: references to tables or columns the warehouse doesn't have print as **warnings** too — advisory only (the object may simply not be built or synced yet). Warnings never fail the check.
6
6
  - `cassis schema pull` downloads the data source's full source schema (as Cassis last introspected it) into `<base-path>/.schema.json` — a **gitignored** local snapshot (the command maintains the ignore entry) with a `pulled_at` stamp. The warehouse stays authoritative; the snapshot is a cache for offline/bulk work — e.g. a coding agent grepping table and column names during a modeling pass instead of paging through the MCP `get_source_schema` tool. Re-run to refresh.
7
7
  - `cassis ontology fmt` rewrites the ontology files in canonical form (think `black`/`gofmt` for the ontology), so hand or agent edits pass the round-trip check.
8
8
  - `cassis ontology upload` uploads the ontology files to a Cassis project (full replace) and, by default, publishes them immediately as a new version — so a merge to your main branch can go live in one CI step.
@@ -1,3 +1,3 @@
1
1
  """Cassis CLI — run Cassis actions from your CI pipelines."""
2
2
 
3
- __version__ = "1.2.0"
3
+ __version__ = "1.4.0"
@@ -139,9 +139,10 @@ def post_ontology_check(
139
139
  ) -> dict[str, Any]:
140
140
  """POST the ontology tree to the check endpoint and return the response body.
141
141
 
142
+ Both routes return advisory ``audit`` quality findings in ``warnings``.
142
143
  With ``project_id``, calls the project-scoped route, which additionally
143
- cross-checks the tree against the project's source schema and returns
144
- advisory ``warnings``; without it, the pure tree check.
144
+ cross-checks the tree against the project's source schema and adds
145
+ ``references`` warnings; without it, the pure tree check.
145
146
  """
146
147
  if project_id:
147
148
  url = api_url.rstrip("/") + f"/api/ci/projects/{project_id}/ontology/check"
@@ -85,11 +85,14 @@ def check(
85
85
  """Validate the ontology files in a repository checkout.
86
86
 
87
87
  Runs the same checks as the Cassis GitHub PR check (YAML parsing,
88
- round-trip, import validation). When the checkout is bound to a project
88
+ round-trip, import validation), then prints advisory quality warnings
89
+ (unassigned tables, broken joins/metrics, missing descriptions) for a
90
+ tree that parsed. When the checkout is bound to a project
89
91
  (``project.yml``, ``--project``, or ``CASSIS_PROJECT_ID``), the tree is
90
92
  additionally cross-checked against the project's source schema; unmatched
91
- references print as warnings and never fail the check. Exits 0 when valid,
92
- 1 when validation fails, 2 on usage errors, 3 on transport/API errors.
93
+ references print as warnings too. Warnings never fail the check or change
94
+ the exit code. Exits 0 when valid, 1 when validation fails, 2 on usage
95
+ errors, 3 on transport/API errors.
93
96
  """
94
97
  api_key = _require_api_key(api_key)
95
98
  files, base_path = _collect_tree(path, base_path)
@@ -114,13 +117,17 @@ def check(
114
117
  raise typer.Exit(EXIT_TRANSPORT) from exc
115
118
 
116
119
  warnings = result.get("warnings") or []
120
+ ref_warnings = [w for w in warnings if w.get("stage") == "references"]
121
+ # Everything else is the quality audit; bucketing by "not references" keeps
122
+ # a warning stage this CLI predates visible instead of silently dropped.
123
+ audit_warnings = [w for w in warnings if w.get("stage") != "references"]
117
124
  if json_output:
118
125
  typer.echo(json.dumps(result, indent=2))
119
126
  elif result["passed"]:
120
127
  typer.secho(f"✓ {result['summary']}", fg=typer.colors.GREEN)
121
128
  # Disambiguate silence: "no warnings" must never read as "references
122
129
  # verified" when the stage didn't run.
123
- if project_id and result.get("references_checked") and not warnings:
130
+ if project_id and result.get("references_checked") and not ref_warnings:
124
131
  typer.secho("✓ Schema references resolve against the source schema.", fg=typer.colors.GREEN)
125
132
  elif project_id and not result.get("references_checked"):
126
133
  typer.secho(
@@ -135,14 +142,23 @@ def check(
135
142
  location = f"{base_path}/{finding.get('path')}: " if finding.get("path") else ""
136
143
  typer.echo(f" {location}{finding.get('message', '')} ({finding.get('stage', '?')})")
137
144
 
138
- if warnings and not json_output:
145
+ if ref_warnings and not json_output:
139
146
  typer.secho(
140
- f"{len(warnings)} schema reference warning(s) — advisory, expected if the objects "
147
+ f"{len(ref_warnings)} schema reference warning(s) — advisory, expected if the objects "
141
148
  "haven't been built or synced yet:",
142
149
  fg=typer.colors.YELLOW,
143
150
  bold=True,
144
151
  )
145
- for warning in warnings:
152
+ for warning in ref_warnings:
153
+ typer.secho(f" {warning.get('message', '')}", fg=typer.colors.YELLOW)
154
+ if audit_warnings and not json_output:
155
+ # Same wording as `ontology test` so the two commands read alike.
156
+ typer.secho(
157
+ f"{len(audit_warnings)} ontology quality warning(s) — advisory, never fail the check:",
158
+ fg=typer.colors.YELLOW,
159
+ bold=True,
160
+ )
161
+ for warning in audit_warnings:
146
162
  typer.secho(f" {warning.get('message', '')}", fg=typer.colors.YELLOW)
147
163
 
148
164
  raise typer.Exit(EXIT_OK if result["passed"] else EXIT_VALIDATION_FAILED)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "cassis-cli"
3
- version = "1.3.0"
3
+ version = "1.4.0"
4
4
  description = "Cassis CLI — run Cassis actions (ontology validation, upload and publish) from your CI pipelines"
5
5
  readme = "README.md"
6
6
  license = { text = "Apache-2.0" }
File without changes
File without changes