<!-- greptile_comment --> <h3>Greptile Summary</h3> This PR introduces a multi-dataset architecture for both the Python processing pipeline and the SvelteKit web app. The pipeline gains a `--dataset` flag and a `datasets.json` registry, while the web app adds a dataset picker home page and per-dataset dashboard routes at `/datasets/[dataset]`. The Python backend uses a careful deferred-import pattern in `pipeline.py` to ensure the dataset selection env var is set before `common` is initialized, which is correct and well-structured. Key issues found: - **`datasets.json` committed but also added to `.gitignore`**: Once a file is tracked by git, `.gitignore` entries have no effect. The committed file also contains real machine-specific absolute paths (`/research/obo/netflow_datasets/*`), contradicting the docs. Running `git rm --cached datasets.json` is needed to actually untrack it. - **Hardcoded dataset-specific start date**: `handleResetView` in `DatasetDashboardPage.svelte` resets to `'2025-02-11'`, a UOregon-specific date that will be incorrect for other datasets like UGR16. - **`datasetDbCache` has no invalidation path**: The server-side SQLite connection cache in `server/datasets.ts` is never cleared. If the pipeline recreates a database (e.g. `FIRST_RUN=True`), the web app will serve stale data until restarted. - **Duplicate navigation links**: The "Datasets" and "Home" nav entries both point to `/`. <h3>Confidence Score: 3/5</h3> - Safe to merge for functionality, but the committed datasets.json with real paths is a git hygiene issue that should be resolved first. - The core multi-dataset logic in both the Python pipeline and the web app is well-implemented and the deferred-import pattern for dataset selection is correct. However, the accidental commitment of datasets.json with real machine-specific paths (despite documenting that it shouldn't be committed) creates a persistent git tracking problem, and the hardcoded UOregon-specific reset date in DatasetDashboardPage will cause subtle UX issues for other datasets. - datasets.json (git tracking issue), netflow-webapp/src/lib/components/netflow/DatasetDashboardPage.svelte (hardcoded start date), netflow-webapp/src/lib/server/datasets.ts (DB cache invalidation) <h3>Important Files Changed</h3> | Filename | Overview | |----------|----------| | netflow-db/common.py | Major addition: multi-dataset registry loading, validation, and lookup helpers. Module-level initialization order is correct (DATASET_REGISTRY → DEFAULT_DATASET → ACTIVE_DATASET). Deferred imports in pipeline.py correctly rely on NETFLOW_DATASET being set before common is first imported. | | netflow-db/pipeline.py | Adds --dataset flag; sets NETFLOW_DATASET env var before deferred import of common, which ensures the correct dataset config is used. Refactored discovery/processing helpers into inner functions. Clean and correct. | | netflow-webapp/src/lib/server/datasets.ts | New server-side dataset registry module; includes mtime-based caching for the registry file. DB connection cache is indefinite with no invalidation path if the database file is recreated by the pipeline. | | datasets.json | Committed with real machine-specific absolute paths and simultaneously added to .gitignore — adding to .gitignore does not untrack an already-committed file, so changes will still be tracked by git. | | netflow-webapp/src/lib/components/netflow/DatasetDashboardPage.svelte | New per-dataset dashboard page wrapping all existing charts; handleResetView hardcodes '2025-02-11' as a default start date that is specific to the UOregon dataset and will be wrong for other datasets. | | netflow-webapp/src/routes/+layout.svelte | Minor update; "Datasets" nav link duplicates the "Home" link (both point to /). | </details> <sub>Last reviewed commit: da9782a</sub> > Greptile also left **4 inline comments** on this PR. <!-- /greptile_comment --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Multi-dataset support with a dataset registry, per-dataset databases, dataset index, and per-dataset dashboard pages with interactive, reorderable charts * Dataset selection propagated across file views, charts, and APIs; CLI/web option to target a specific dataset * New dataset preparation utility to normalize/import external NetFlow archives * **Documentation** * Guides for datasets.json configuration and multi-dataset pipeline usage with examples * **Tests** * Unit tests for the datasets API * **Chores** * Updated env template, .gitignore and package deps; added test tooling <!-- end of auto-generated comment: release notes by coderabbit.ai -->
57 files changedLine totals unavailable