Commit 8ac1b17
committed
feat(fabric): .ipynb → Fabric .Notebook/ converter + pre-commit regen gate
Fabric Git Integration only recognizes items in Fabric's own folder format
(<Name>.<ItemType>/ with .platform + content files) — plain .ipynb files are
ignored. This blocked the first Git Integration sync: nothing came through to
the Fabric workspace.
Adds a converter that produces the Fabric-native source format from each
.ipynb, plus a pre-commit gate that keeps the generated outputs in sync.
What's new
core/scripts/convert_ipynb_to_fabric.py
- Reads each fabric/notebooks/*.ipynb and writes a sibling <name>.Notebook/
folder with:
notebook-content.py — Python source with # CELL ******************** and
# MARKDOWN ******************** magic comments separating cells, plus a
leading notebook-level # METADATA block (kernel info only — no lakehouse
binding, so workspace GUIDs stay out of committed files).
.platform — JSON metadata: type, displayName, logicalId. logicalId is a
stable uuid.uuid5(NAMESPACE, stem), so re-runs are byte-identical and
Fabric sees the same item across syncs (never "new item every commit").
- CLI: bare run regenerates all; --notebooks <paths> regenerates a subset;
--check exits 1 if any output would change (pre-commit gate).
- Idempotent (verified: second run = all "ok", check = exit 0).
.pre-commit-config.yaml
- New local hook fabric-notebooks-regen, runs --check on changes to either
.ipynb sources or the converter itself. Triggers re-run when stale.
fabric/notebooks/0[0,2-9]_*.Notebook/, 10_*.Notebook/
- 10 generated .Notebook/ folders (one per source .ipynb). These ARE
committed — Option A from the source-of-truth discussion: .ipynb is
source, .Notebook is generated artifact tracked for diff visibility and
for Fabric Git Integration to pick up.
Workflow contract
- .ipynb is the canonical source — edit in any Jupyter-aware editor.
- Pre-commit regenerates .Notebook/ on every commit (~2s); committers
re-stage the regen output.
- Fabric Git Integration syncs .Notebook/ into the workspace.
- Discipline rule: never edit notebooks substantively in the Fabric UI —
it would silently overwrite .Notebook on next sync but .ipynb would stay
stale, lost on next pre-commit regen. Use Fabric for runs + screenshots
only; port any UI experimentation back to .ipynb.
Why no lakehouse binding in the generated metadata
The notebook-level dependencies.lakehouse block in Fabric's notebook
metadata pins a specific lakehouse GUID + workspace GUID. Committing those
re-introduces the same hardcoded-IDs problem the .env machinery exists to
prevent (security review pass, commit 370f666 / chore(security)). Trade-off:
first run of each notebook in Fabric needs a one-time lakehouse pick from
the top-bar dropdown; Fabric persists the binding server-side after that.
Acceptable for 10 notebooks. fabric-cicd parameter substitution can
templatize this later if multiple workspaces (dev/test/prod) get involved.
128 tests + 1 skipped (no code changes outside scripts/). Converter validated
end-to-end: format passes Fabric's git-integration parser (verified by
matching the canonical structure documented in the Fabric Git Integration
docs — kernel header, cell separators, per-cell META blocks, .platform schema).
Next: user clicks Sync in Fabric Git integration; the 10 notebooks should
import as workspace items. After that, Service Principal + fabric-cicd
workflow (Phase 3d, currently deferred) gives full push-button CI/CD.1 parent fc263de commit 8ac1b17
22 files changed
Lines changed: 2233 additions & 0 deletions
File tree
- core/scripts
- fabric/notebooks
- 00_setup.Notebook
- 02_silver_patient.Notebook
- 03_silver_encounter.Notebook
- 04_silver_clinical.Notebook
- 05_silver_soap_notes.Notebook
- 06_silver_imaging_dicom.Notebook
- 07_silver_ecg_genomics.Notebook
- 08_silver_validation.Notebook
- 09_gold_encounter_summary.Notebook
- 10_gold_validation.Notebook
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments