Skip to content

Commit 2ca00dc

Browse files
committed
Data Product CLI 0.3.1: lint resolves linked data contracts
1 parent 9c19e92 commit 2ca00dc

15 files changed

Lines changed: 72 additions & 16 deletions

‎CLAUDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Online and on-site use the same numbering: Part C is CI/CD (exercise 7), Part D
1616

1717
## Versions (keep in sync everywhere)
1818

19-
- datacontract-cli `1.2.3`, dataproduct-cli `0.2.0`, entropy-data `0.3.13`: pinned in `scripts/install.sh`, `install.ps1`, `install.bat`, and in `solutions/exercise7/datacontract.yml`.
19+
- datacontract-cli `1.2.3`, dataproduct-cli `0.3.1`, entropy-data `0.3.13`: pinned in `scripts/install.sh`, `install.ps1`, `install.bat`, and in `solutions/exercise7/datacontract.yml`.
2020
- ODCS `v3.2.0` and ODPS `v1.1.0` in all solutions, examples, and `schemas/` (mapped in `.vscode/settings.json`).
2121
- GitHub Actions: `actions/checkout@v7`, `astral-sh/setup-uv@v10.2.0` (setup-uv has no floating major tags).
2222
- When bumping a CLI, re-capture the terminal outputs in the tutorial and re-record the affected videos.

‎exercises/part-c/exercise7-ci-cd-with-github-actions.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Builds on Parts A and B only. You need a [GitHub](https://github.com) account.
6666
- name: Install the CLIs
6767
run: |
6868
uv tool install --python 3.11 'datacontract-cli[postgres]==1.2.3'
69-
uv tool install --python 3.11 'dataproduct-cli==0.2.0'
69+
uv tool install --python 3.11 'dataproduct-cli==0.3.1'
7070
7171
- name: Lint data contracts
7272
run: |
@@ -81,7 +81,7 @@ Builds on Parts A and B only. You need a [GitHub](https://github.com) account.
8181
done
8282
```
8383
84-
Linting checks that every file is valid ODCS or ODPS. No database needed.
84+
Linting checks that every file is valid ODCS or ODPS. `dataproduct lint` also checks that the data contracts linked in the ports exist in the repository. No database needed.
8585

8686
7. Commit, push, and watch the run in the **Actions** tab. It should turn green.
8787

‎scripts/install.bat‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
rem Installs the Data Contract CLI, the Data Product CLI, and the Entropy Data CLI (Windows variant of install.sh).
33
rem Works in cmd and PowerShell. Keep the pinned versions in sync with install.sh and install.ps1.
44
uv tool install --force --python python3.11 "datacontract-cli[all]==1.2.3"
5-
uv tool install --force --python python3.11 "dataproduct-cli==0.2.0"
5+
uv tool install --force --python python3.11 "dataproduct-cli==0.3.1"
66
uv tool install "entropy-data==0.3.13"
77
uv tool update-shell
88
datacontract --version

‎scripts/install.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Run from the repository root:
55
# powershell -ExecutionPolicy Bypass -File scripts\install.ps1
66
uv tool install --force --python python3.11 'datacontract-cli[all]==1.2.3'
7-
uv tool install --force --python python3.11 'dataproduct-cli==0.2.0'
7+
uv tool install --force --python python3.11 'dataproduct-cli==0.3.1'
88
uv tool install 'entropy-data==0.3.13'
99
uv tool update-shell
1010
datacontract --version

‎scripts/install.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# Keep the pinned versions in sync with install.bat and install.ps1 (the Windows variants).
33
uv tool install --force --python python3.11 'datacontract-cli[all]==1.2.3'
4-
uv tool install --force --python python3.11 'dataproduct-cli==0.2.0'
4+
uv tool install --force --python python3.11 'dataproduct-cli==0.3.1'
55
uv tool install 'entropy-data==0.3.13'
66
uv tool update-shell
77
which datacontract

‎solutions/exercise7/datacontract.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Install the CLIs
2323
run: |
2424
uv tool install --python 3.11 'datacontract-cli[postgres]==1.2.3'
25-
uv tool install --python 3.11 'dataproduct-cli==0.2.0'
25+
uv tool install --python 3.11 'dataproduct-cli==0.3.1'
2626
2727
- name: Lint data contracts
2828
run: |

‎solutions/test_all.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export DATACONTRACT_POSTGRES_PASSWORD="${DATACONTRACT_POSTGRES_PASSWORD:-worksho
1010

1111
check_odps() {
1212
echo "=== Validating $1 ==="
13-
dataproduct lint "$1"
13+
dataproduct lint --local-references "$1"
1414
}
1515

1616
psql_cmd() {

‎tutorial/src/content/de/ci-cd.mdx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
- name: Install the CLIs
102102
run: |
103103
uv tool install --python 3.11 'datacontract-cli[postgres]==1.2.3'
104-
uv tool install --python 3.11 'dataproduct-cli==0.2.0'
104+
uv tool install --python 3.11 'dataproduct-cli==0.3.1'
105105
106106
- name: Lint data contracts
107107
run: |
@@ -116,6 +116,8 @@ jobs:
116116
done
117117
```
118118
119+
`dataproduct lint` prüft außerdem, ob die in den Ports verlinkten Datenkontrakte im Repository liegen.
120+
119121
Committe und pushe die Datei, dann öffne den Tab **Actions**. Nach etwa einer Minute ist der Run grün.
120122

121123
</Step>

‎tutorial/src/content/de/contract-first.mdx‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,13 @@ dataproduct lint sku_sales_per_year.odps.yaml
262262

263263
```output
264264
✅ Data product is valid against ODPS v1.1.0
265+
✅ Data contract 'orders_v2' linked by inputPorts[orders] is resolvable: Found
266+
at orders_v2.odcs.yaml
267+
✅ Data contract 'sku_sales_per_year' linked by outputPorts[sku_sales_per_year]
268+
is resolvable: Found at sku_sales_per_year.odcs.yaml
269+
✅ Data contract 'orders_v2' passes datacontract lint: orders_v2.odcs.yaml
270+
✅ Data contract 'sku_sales_per_year' passes datacontract lint:
271+
sku_sales_per_year.odcs.yaml
265272
🟢 Data product is valid.
266273
```
267274

‎tutorial/src/content/de/data-product.mdx‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ dataproduct lint orders.odps.yaml
123123

124124
```output
125125
✅ Data product is valid against ODPS v1.1.0
126+
✅ Data contract 'orders_v1' linked by outputPorts[orders_v1] is resolvable:
127+
Found at orders_v1.odcs.yaml
128+
✅ Data contract 'orders_v2' linked by outputPorts[orders_v2] is resolvable:
129+
Found at orders_v2.odcs.yaml
130+
✅ Data contract 'orders_v1' passes datacontract lint: orders_v1.odcs.yaml
131+
✅ Data contract 'orders_v2' passes datacontract lint: orders_v2.odcs.yaml
126132
🟢 Data product is valid.
127133
```
128134

@@ -137,8 +143,14 @@ dataproduct lint orders.odps.yaml
137143
```
138144

139145
```output
140-
❌ Check that data product is valid against ODPS v1.1.0: kind: 'DataProdukt' is not one of
141-
['DataProduct']
146+
❌ Check that data product is valid against ODPS v1.1.0: kind: 'DataProdukt' is
147+
not one of ['DataProduct']
148+
✅ Data contract 'orders_v1' linked by outputPorts[orders_v1] is resolvable:
149+
Found at orders_v1.odcs.yaml
150+
✅ Data contract 'orders_v2' linked by outputPorts[orders_v2] is resolvable:
151+
Found at orders_v2.odcs.yaml
152+
✅ Data contract 'orders_v1' passes datacontract lint: orders_v1.odcs.yaml
153+
✅ Data contract 'orders_v2' passes datacontract lint: orders_v2.odcs.yaml
142154
🔴 Data product is invalid.
143155
```
144156

@@ -154,7 +166,7 @@ Die CLI nennt das falsche Feld und endet mit Exit-Code `1`. Mach es danach rück
154166
</Step>
155167

156168
<Callout type="note" title="Lint vs. Test">
157-
`dataproduct lint` prüft, ob die Datei laut Standard *wohlgeformt* ist. Es verbindet sich mit keiner Datenbank.
169+
`dataproduct lint` prüft, ob die Datei laut Standard *wohlgeformt* ist und ob die verlinkten Datenkontrakte existieren. Es verbindet sich mit keiner Datenbank.
158170
Ob die Daten hinter einem Output-Port ihr Versprechen halten, prüft `datacontract test` am Kontrakt.
159171
</Callout>
160172

0 commit comments

Comments
 (0)