strata-cli 0.1.17 → 0.1.18

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0eed3ab022a70f7362fef36cecee35c47cb9a8e3f86845d2cbc6ed58e4212f16
4
- data.tar.gz: d14df20e4a614d79640a874868d1d819a477cf21bd67ba9f4be8fbe64576db83
3
+ metadata.gz: e13d7f619d5b03f2c0ab353c8064fe5f1c17e97d8a3bc63d0d32abb11da628de
4
+ data.tar.gz: '095c483ea8913658de1d52dbe33bd71491b04b88f91f6e5c957417760bd1db1b'
5
5
  SHA512:
6
- metadata.gz: 290d7b617d7bfb883d1e268d06447aeaa975015293c2b68e062132393d5dc8f8d1e1d846045c292dfd2956737cd744523ab21544d5a739dc232f93cec1d28027
7
- data.tar.gz: 3e20c5dc5ce59f4757ad028c5ab89fe15403b56b386afc6c34b46af8ea53f4d28a99f8cb7786a3d7e23ea518bc848206d29bda461589cebb8b88bcb5eb3102a1
6
+ metadata.gz: 1444ff06c0d6ad24303c6fec60c925fda1fffa17513cb2c8c8e7a2071af0f070181c882d58f832e1fca088c6601168140b0557a20106a0e23513da47173a0302
7
+ data.tar.gz: e952da251f4c0562fcc1f26be54f84245e046ed3041374e5efb17faf4b293a903db3c573142ff43c6efd290306252f2ad37cfce27ec27f0a824b6f6485379bc6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.18] - 2026-09-26
4
+
5
+ ### Changed
6
+
7
+ - **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.
8
+ - **AGENTS.md**: notes that security policies need a Team or Enterprise license and points agents at `strata create policy`.
9
+
10
+ ### Fixed
11
+
12
+ - **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.
13
+ - **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.
14
+ - **AGENTS.md snapshot key**: the template said `snapshot_date:` but the deployer reads `snapshot:`, so tables written from it deployed without a snapshot date.
15
+ - **README**: documents browser sign-in, `strata project sample`, and which commands accept `--api-key`.
16
+
3
17
  ## [0.1.17] - 2026-09-09
4
18
 
5
19
  ### 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:
@@ -429,7 +452,7 @@ Use service principal credentials and run `strata ds auth my_databricks` to save
429
452
  ## Security
430
453
 
431
454
  - ✅ Credentials stored in `.strata` with restrictive permissions (0600)
432
- - ✅ API keys never accepted via command line arguments
455
+ - ✅ 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
456
  - ✅ File paths validated to prevent path traversal attacks
434
457
  - ✅ Git commit hashes validated before use
435
458
  - ✅ YAML files loaded safely to prevent code execution
@@ -453,7 +476,7 @@ server: https://your-strata-server.com
453
476
 
454
477
  ### "API key not found"
455
478
 
456
- Run `strata deploy` and enter your API key when prompted, or manually add to `.strata`:
479
+ 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
480
 
458
481
  ```yaml
459
482
  api_key: your-api-key
@@ -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)
@@ -102,12 +102,6 @@ module Strata
102
102
  end
103
103
  end
104
104
 
105
- def create_security_file
106
- return if cloned_from_git?
107
-
108
- copy_file "security.yml", "#{uid}/security.yml"
109
- end
110
-
111
105
  def initialize_git
112
106
  return if cloned_from_git?
113
107
 
@@ -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 can be implemented in the security.yml file. Use the guidelines documented therin.
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 `snapshot_date` | Wrong measure type | Normal additive measure, or proper snapshot table setup |
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 `snapshot_date: <Date dimension name>` (dimension on same table or unambiguous in the table’s universe).
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
- snapshot_date: Date
332
+ snapshot: Date
333
333
 
334
334
  fields:
335
335
  - type: dimension
@@ -385,6 +385,17 @@ module Strata
385
385
  "database" => "test_db",
386
386
  "username" => "default"
387
387
  }
388
+ when "sqlite"
389
+ {
390
+ "file" => "./data/warehouse.db"
391
+ }
392
+ when "redshift"
393
+ {
394
+ "host" => "mycluster.abc123.us-east-1.redshift.amazonaws.com",
395
+ "port" => 5439,
396
+ "database" => "dev",
397
+ "username" => "awsuser"
398
+ }
388
399
  else
389
400
  {}
390
401
  end
@@ -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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Strata
4
4
  module CLI
5
- VERSION = "0.1.17"
5
+ VERSION = "0.1.18"
6
6
  end
7
7
  end
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.17
4
+ version: 0.1.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ajo Abraham
@@ -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.9
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: []