strata-cli 0.1.17 → 0.1.19
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/README.md +35 -2
- data/lib/strata/cli/credentials.rb +2 -0
- data/lib/strata/cli/descriptions/datasource/add.txt +1 -1
- data/lib/strata/cli/generators/policy.rb +5 -5
- data/lib/strata/cli/generators/project.rb +0 -6
- data/lib/strata/cli/generators/templates/AGENTS.md +4 -4
- data/lib/strata/cli/helpers/datasource_helper.rb +4 -1
- data/lib/strata/cli/sub_commands/datasource.rb +23 -0
- data/lib/strata/cli/utils/deployment_monitor.rb +9 -0
- data/lib/strata/cli/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7cdf350ee694b8dfcac291d7aeb7f13cc3f0cec82535f56e61fe9408ffbcc6f7
|
|
4
|
+
data.tar.gz: eb05515761938400bbad1961110569d46db0a9f6e118b3b091bdcf42c62f0b34
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a9300ece338d7b455ddf1db63658e95820a96dea1807493e0cfbcbb7931d19d9d5ddef6b5953c16cf083bc28416099a64f3cf5b5263c68b44b5981a018c83487
|
|
7
|
+
data.tar.gz: f5c4575f2ab7415300e22794efedada1cf43bd77da69d9a4d04dd9abb84ac87da109b0b28f911ed2e6e74ad06532ee6b57eed1c1b2dd7693d9da14abbe38147b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.1.19] - 2026-09-30
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **BigQuery datasource**: `strata datasource add bigquery` prompts for `project_id` and `dataset`; `strata ds auth` stores a service account `keyfile` path (Application Default Credentials when left blank). Requires dwh 0.6.0.
|
|
8
|
+
|
|
9
|
+
## [0.1.18] - 2026-09-26
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **security.yml no longer scaffolded by init**: servers on the free license reject deploys that include `security.yml`, so `strata init` no longer creates it. `strata create policy` creates the file from the template the first time a policy is added.
|
|
14
|
+
- **AGENTS.md**: notes that security policies need a Team or Enterprise license and points agents at `strata create policy`.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **License error guidance on deploy**: when the server rejects a deploy because row-level security is not on the current license, `strata deploy` now explains how to resolve it: delete `security.yml` and redeploy, or email sales@strata.do to upgrade.
|
|
19
|
+
- **Datasource prompts for sqlite and redshift**: `strata datasource add` previously wrote an empty, invalid config for these adapters because they had no prompt definitions. A parity test now covers every adapter the dwh gem registers.
|
|
20
|
+
- **AGENTS.md snapshot key**: the template said `snapshot_date:` but the deployer reads `snapshot:`, so tables written from it deployed without a snapshot date.
|
|
21
|
+
- **README**: documents browser sign-in, `strata project sample`, and which commands accept `--api-key`.
|
|
22
|
+
|
|
3
23
|
## [0.1.17] - 2026-09-09
|
|
4
24
|
|
|
5
25
|
### Added
|
data/README.md
CHANGED
|
@@ -77,6 +77,20 @@ Link local project to an existing project on the Strata server.
|
|
|
77
77
|
strata project link 12345
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
### `strata project sample`
|
|
81
|
+
|
|
82
|
+
Clone the Strata TPC-DS sample project and set it up interactively. Prompts for the server URL and signs you in via browser (see [Authentication](#authentication)), then writes `.strata` and sets the project ID so you can deploy immediately.
|
|
83
|
+
|
|
84
|
+
**Options:**
|
|
85
|
+
- `-a, --api-key KEY` - API key (optional — skips browser sign-in when paired with `--server`)
|
|
86
|
+
- `-s, --server URL` - Server URL (optional — prompted if omitted)
|
|
87
|
+
|
|
88
|
+
**Examples:**
|
|
89
|
+
```bash
|
|
90
|
+
strata project sample
|
|
91
|
+
cd tpc-ds-retail-sample && strata deploy
|
|
92
|
+
```
|
|
93
|
+
|
|
80
94
|
</details>
|
|
81
95
|
|
|
82
96
|
<details>
|
|
@@ -350,6 +364,15 @@ ai_api_key: your-ai-key
|
|
|
350
364
|
|
|
351
365
|
**Security:** The `.strata` file automatically has restrictive permissions (0600) for security.
|
|
352
366
|
|
|
367
|
+
### Authentication
|
|
368
|
+
|
|
369
|
+
You don't need to create an API key manually. When no key is configured, `strata deploy` (and `strata project sample`) asks how you'd like to authenticate:
|
|
370
|
+
|
|
371
|
+
- **Sign in via browser (recommended)** — the CLI opens your server's sign-in page in the browser and fetches an API key automatically once you sign in (5-minute timeout).
|
|
372
|
+
- **Paste an API key** — get one from your Strata server dashboard (**Settings → API Keys**) or your Strata administrator.
|
|
373
|
+
|
|
374
|
+
Either way the key is saved to `.strata` for future runs. In CI or other non-interactive environments there are no prompts — write the API key into `.strata` before running `strata deploy --yes`.
|
|
375
|
+
|
|
353
376
|
### Datasources Configuration (`datasources.yml`)
|
|
354
377
|
|
|
355
378
|
Defines all datasource connections:
|
|
@@ -411,6 +434,15 @@ my_databricks:
|
|
|
411
434
|
|
|
412
435
|
Use service principal credentials and run `strata ds auth my_databricks` to save `oauth_client_id` and `oauth_client_secret` in `.strata`.
|
|
413
436
|
|
|
437
|
+
```yaml
|
|
438
|
+
my_bigquery:
|
|
439
|
+
adapter: bigquery
|
|
440
|
+
project_id: my-gcp-project
|
|
441
|
+
dataset: analytics
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
Run `strata ds auth my_bigquery` to save a service account `keyfile` path in `.strata`, or leave it blank to use `gcloud auth application-default login`.
|
|
445
|
+
|
|
414
446
|
## Supported Data Warehouse Adapters
|
|
415
447
|
|
|
416
448
|
- **PostgreSQL** - Full support
|
|
@@ -425,11 +457,12 @@ Use service principal credentials and run `strata ds auth my_databricks` to save
|
|
|
425
457
|
- **Databricks** - Databricks SQL warehouse support
|
|
426
458
|
- **ClickHouse** - ClickHouse HTTP/native SQL support
|
|
427
459
|
- **SQLite** - SQLite database support
|
|
460
|
+
- **BigQuery** - Google BigQuery support (service account keyfile or Application Default Credentials)
|
|
428
461
|
|
|
429
462
|
## Security
|
|
430
463
|
|
|
431
464
|
- ✅ Credentials stored in `.strata` with restrictive permissions (0600)
|
|
432
|
-
- ✅ API keys never
|
|
465
|
+
- ✅ API keys never required on the command line — browser sign-in or the `.strata` file supplies them (optional `--api-key` flags exist on `init --source` and `project sample` for scripting)
|
|
433
466
|
- ✅ File paths validated to prevent path traversal attacks
|
|
434
467
|
- ✅ Git commit hashes validated before use
|
|
435
468
|
- ✅ YAML files loaded safely to prevent code execution
|
|
@@ -453,7 +486,7 @@ server: https://your-strata-server.com
|
|
|
453
486
|
|
|
454
487
|
### "API key not found"
|
|
455
488
|
|
|
456
|
-
Run `strata deploy` and
|
|
489
|
+
Run `strata deploy` and choose **Sign in via browser** when prompted — the CLI fetches and saves a key automatically. Alternatively paste a key at the prompt, or manually add it to `.strata`:
|
|
457
490
|
|
|
458
491
|
```yaml
|
|
459
492
|
api_key: your-api-key
|
|
@@ -50,6 +50,8 @@ module Strata
|
|
|
50
50
|
credentials["oauth_client_secret"] = @prompt.ask("OAuth Client Secret:")
|
|
51
51
|
when "clickhouse"
|
|
52
52
|
credentials["password"] = @prompt.mask("Enter Password (leave blank if none):")
|
|
53
|
+
when "bigquery"
|
|
54
|
+
credentials["keyfile"] = @prompt.ask("Service account keyfile path (leave blank for Application Default Credentials):")
|
|
53
55
|
else
|
|
54
56
|
if required?
|
|
55
57
|
unless %w[postgres mysql trino sqlserver].include?(adapter)
|
|
@@ -18,4 +18,4 @@ Examples:
|
|
|
18
18
|
|
|
19
19
|
strata datasource add snowflake # Directly add Snowflake datasource
|
|
20
20
|
|
|
21
|
-
Supported adapters: postgres, mysql, sqlserver, snowflake, athena, trino, duckdb, druid, clickhouse, databricks, redshift, sqlite
|
|
21
|
+
Supported adapters: postgres, mysql, sqlserver, snowflake, athena, trino, duckdb, druid, clickhouse, databricks, redshift, sqlite, bigquery
|
|
@@ -8,16 +8,16 @@ module Strata
|
|
|
8
8
|
module Generators
|
|
9
9
|
# Appends a new policy entry to the project's security.yml.
|
|
10
10
|
# Receives a fully-resolved attrs hash from the Create subcommand.
|
|
11
|
+
#
|
|
12
|
+
# security.yml is not scaffolded by `strata init` because servers on the
|
|
13
|
+
# free license reject deploys that include it. It is created from the
|
|
14
|
+
# template here, the first time a policy is added.
|
|
11
15
|
class Policy < Group
|
|
12
16
|
argument :attrs, type: :hash
|
|
13
17
|
|
|
14
18
|
def append_policy_to_security_yml
|
|
15
19
|
security_file = "security.yml"
|
|
16
|
-
|
|
17
|
-
unless File.exist?(security_file)
|
|
18
|
-
raise Strata::CommandError,
|
|
19
|
-
"security.yml not found in the current directory. Run 'strata init' first."
|
|
20
|
-
end
|
|
20
|
+
copy_file "security.yml", security_file unless File.exist?(security_file)
|
|
21
21
|
|
|
22
22
|
content = File.read(security_file)
|
|
23
23
|
new_entry = format_policy_yaml(attrs)
|
|
@@ -33,7 +33,7 @@ These are non-negotiable. Violations break deploy, query planning, or production
|
|
|
33
33
|
3. **Measures on unrelated detail facts must have distinct names** — e.g. `Store Gross Sales`, `Catalog Gross Sales`, not one `Gross Sales` on three channel facts. See [Naming conventions](#naming-conventions).
|
|
34
34
|
4. **Dimensions may share names** when the business role is the same; Strata picks among tables at query time. **Measures do not combine that way** — duplicate measure names implies varying levels of aggregation of the same basic fact. The correct table and measure combination will be determined by context (i.e. what dimensions are present in the same query.)
|
|
35
35
|
5. **Cross-fact totals use compound measures or blending** — not the same measure name on multiple facts. See [Combined metrics across facts](#combined-metrics-across-facts).
|
|
36
|
-
6. Security policies
|
|
36
|
+
6. Security policies (Team/Enterprise license) live in security.yml. Run `strata create policy` to scaffold the file with documented guidelines; do not add it on a free-license server, its deploys reject it.
|
|
37
37
|
7. Strata supports role playing or aliasing of dimension tables. For example, user wants date_dim table to also be used when query "Order Return Date". In that case, we simply point to the same physical_name "date_dim" but set the table name to "Order Return Date". If the user asks to alias an dimension table from an existing model we can simply copy the existing model, change the table name, and prefix all the dimensions in it with the appropriate prefix representing the role.
|
|
38
38
|
|
|
39
39
|
## Unsupported or impossible requirements
|
|
@@ -72,7 +72,7 @@ Use plain language, for example:
|
|
|
72
72
|
| “Combine metrics by reusing the same name” | Not how Strata merges facts | Compound measure or blending on shared dimensions |
|
|
73
73
|
| Cross-datasource compound measure | Same datasource required | Model per datasource or separate metrics |
|
|
74
74
|
| Datasource swap migration | Not supported | Rename datasource; human migration plan |
|
|
75
|
-
| Snapshot-style metric on a flow fact without `
|
|
75
|
+
| Snapshot-style metric on a flow fact without a table-level `snapshot` | Wrong measure type | Normal additive measure, or proper snapshot table setup |
|
|
76
76
|
| Requirement needs engine feature you cannot verify | Risk of invalid model | Stop; cite docs or ask human — do not guess |
|
|
77
77
|
|
|
78
78
|
When `strata audit all --agent` reports errors you cannot resolve within Strata’s rules, **stop and report the errors to the user** — do not keep patching YAML until the model drifts further from a valid design.
|
|
@@ -322,14 +322,14 @@ If referenced measures are not joinable in **one universe** from that host table
|
|
|
322
322
|
|
|
323
323
|
**Requirements:**
|
|
324
324
|
|
|
325
|
-
1. Table sets `
|
|
325
|
+
1. Table sets `snapshot: <Date dimension name>` (dimension on same table or unambiguous in the table’s universe).
|
|
326
326
|
2. Measure sets `snapshot: ending` (value at end of period) or `snapshot: beginning` (value at start).
|
|
327
327
|
|
|
328
328
|
```yaml
|
|
329
329
|
name: Inventory
|
|
330
330
|
physical_name: inventory
|
|
331
331
|
datasource: warehouse
|
|
332
|
-
|
|
332
|
+
snapshot: Date
|
|
333
333
|
|
|
334
334
|
fields:
|
|
335
335
|
- type: dimension
|
|
@@ -13,7 +13,8 @@ module Strata
|
|
|
13
13
|
athena: %w[aws-sdk-athena aws-sdk-s3 rexml],
|
|
14
14
|
trino: %w[trino-client],
|
|
15
15
|
sqlite: %w[sqlite3],
|
|
16
|
-
duckdb: %w[duckdb]
|
|
16
|
+
duckdb: %w[duckdb],
|
|
17
|
+
bigquery: %w[google-cloud-bigquery]
|
|
17
18
|
}.freeze
|
|
18
19
|
|
|
19
20
|
def resolve_datasource(ds_key_arg = nil)
|
|
@@ -197,6 +198,8 @@ module Strata
|
|
|
197
198
|
"Notes:\n- AWS SDK gems are pure Ruby; no system libraries required."
|
|
198
199
|
when :trino
|
|
199
200
|
"Notes:\n- 'trino-client' is pure Ruby; no system libraries required."
|
|
201
|
+
when :bigquery
|
|
202
|
+
"Notes:\n- 'google-cloud-bigquery' is pure Ruby; no system libraries required.\n- Authenticate with a service account keyfile or `gcloud auth application-default login`."
|
|
200
203
|
when :duckdb
|
|
201
204
|
"Notes:\n- See https://github.com/suketa/ruby-duckdb"
|
|
202
205
|
else
|
|
@@ -114,6 +114,9 @@ module Strata
|
|
|
114
114
|
if adapter == "databricks"
|
|
115
115
|
say " Databricks uses OAuth M2M with service principal credentials (client ID + client secret).", :cyan
|
|
116
116
|
end
|
|
117
|
+
if adapter == "bigquery"
|
|
118
|
+
say " BigQuery uses a service account JSON keyfile, or gcloud Application Default Credentials if left blank.", :cyan
|
|
119
|
+
end
|
|
117
120
|
say ""
|
|
118
121
|
creds.collect
|
|
119
122
|
creds.write_local(ds_key, self)
|
|
@@ -161,6 +164,9 @@ module Strata
|
|
|
161
164
|
if adapter == "databricks"
|
|
162
165
|
say " Databricks uses OAuth M2M with service principal credentials (client ID + client secret).", :cyan
|
|
163
166
|
end
|
|
167
|
+
if adapter == "bigquery"
|
|
168
|
+
say " BigQuery uses a service account JSON keyfile, or gcloud Application Default Credentials if left blank.", :cyan
|
|
169
|
+
end
|
|
164
170
|
say ""
|
|
165
171
|
creds.collect
|
|
166
172
|
creds.write_local(ds_key, self)
|
|
@@ -385,6 +391,22 @@ module Strata
|
|
|
385
391
|
"database" => "test_db",
|
|
386
392
|
"username" => "default"
|
|
387
393
|
}
|
|
394
|
+
when "sqlite"
|
|
395
|
+
{
|
|
396
|
+
"file" => "./data/warehouse.db"
|
|
397
|
+
}
|
|
398
|
+
when "redshift"
|
|
399
|
+
{
|
|
400
|
+
"host" => "mycluster.abc123.us-east-1.redshift.amazonaws.com",
|
|
401
|
+
"port" => 5439,
|
|
402
|
+
"database" => "dev",
|
|
403
|
+
"username" => "awsuser"
|
|
404
|
+
}
|
|
405
|
+
when "bigquery"
|
|
406
|
+
{
|
|
407
|
+
"project_id" => "my-gcp-project",
|
|
408
|
+
"dataset" => "analytics"
|
|
409
|
+
}
|
|
388
410
|
else
|
|
389
411
|
{}
|
|
390
412
|
end
|
|
@@ -393,6 +415,7 @@ module Strata
|
|
|
393
415
|
def humanize_field(field)
|
|
394
416
|
{
|
|
395
417
|
"account_identifier" => "Account identifier",
|
|
418
|
+
"project_id" => "Project ID",
|
|
396
419
|
"s3_output_location" => "S3 output location",
|
|
397
420
|
"auth_mode" => "Auth mode"
|
|
398
421
|
}.fetch(field, field.split("_").map(&:capitalize).join(" "))
|
|
@@ -37,6 +37,9 @@ module Strata
|
|
|
37
37
|
finished
|
|
38
38
|
].freeze
|
|
39
39
|
TESTING_STAGE = :running_tests
|
|
40
|
+
SECURITY_LICENSE_ERROR = /row-level security is not available on your current license/i
|
|
41
|
+
SECURITY_LICENSE_HINT = "Row-level security requires a Team or Enterprise license. " \
|
|
42
|
+
"Delete security.yml from the project and redeploy, or email sales@strata.do to upgrade your license."
|
|
40
43
|
|
|
41
44
|
# Initialize a new DeploymentMonitor
|
|
42
45
|
#
|
|
@@ -350,6 +353,12 @@ module Strata
|
|
|
350
353
|
error_messages.split("\n").each do |line|
|
|
351
354
|
say " #{line}", :error
|
|
352
355
|
end
|
|
356
|
+
say "\n #{SECURITY_LICENSE_HINT}", :warning if security_license_error?(error_messages)
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
# The server rejects security.yml when the license lacks row-level security.
|
|
360
|
+
def security_license_error?(error_messages)
|
|
361
|
+
error_messages.to_s.match?(SECURITY_LICENSE_ERROR)
|
|
353
362
|
end
|
|
354
363
|
|
|
355
364
|
def display_test_results(test_results, skip_opening_divider: false)
|
data/lib/strata/cli/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: strata-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.19
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ajo Abraham
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.
|
|
19
|
+
version: 0.6.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 0.
|
|
26
|
+
version: 0.6.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: aws-sdk-athena
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -224,7 +224,7 @@ description: |
|
|
|
224
224
|
Comprehensive CLI tool for managing Strata Semantic Analytics projects. Create and initialize
|
|
225
225
|
projects, manage datasource connections, build semantic table models with AI assistance, run
|
|
226
226
|
audits and validations, and deploy projects to Strata servers. Supports multiple data warehouse
|
|
227
|
-
adapters including PostgreSQL, MySQL, SQL Server, Snowflake, Athena, Trino, ClickHouse, and more.
|
|
227
|
+
adapters including PostgreSQL, MySQL, SQL Server, Snowflake, BigQuery, Athena, Trino, ClickHouse, and more.
|
|
228
228
|
email:
|
|
229
229
|
- ajo@strata.site
|
|
230
230
|
- allen@strata.site
|
|
@@ -344,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
344
344
|
- !ruby/object:Gem::Version
|
|
345
345
|
version: '0'
|
|
346
346
|
requirements: []
|
|
347
|
-
rubygems_version: 3.6.
|
|
347
|
+
rubygems_version: 3.6.7
|
|
348
348
|
specification_version: 4
|
|
349
349
|
summary: Command-line interface for the Strata Semantic Analytics System
|
|
350
350
|
test_files: []
|