feat: restructure data/ directory#335
Conversation
There was a problem hiding this comment.
Pull request overview
This PR restructures the repository’s YAML data layout by moving project/lab data under data/projects/ (and e2e/data/projects/ for Playwright), aligning code and validation scripts with the new “one lab = one YAML file” organization (issue #329).
Changes:
- Update data loading and validation utilities to read from
./data/projects(and./e2e/data/projectsfor Playwright). - Introduce per-lab project YAML files (
data/projects/<LAB>.yaml) alongsidelabs.yaml,config.yaml, andtemplate.yaml. - Add/move project tab Vue templates under
data/projects/projectTabs/*and ensure corresponding e2e directories exist.
Reviewed changes
Copilot reviewed 2 out of 91 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/validate-data.ts | Points validation at data/projects and validates all per-lab YAML files. |
| utils/loadData.ts | Loads labs/config/projects from data/projects and enumerates per-lab YAML files. |
| e2e/data/projects/config.yaml | Playwright fixture configuration for highlighted projects. |
| e2e/data/projects/C4DT.yaml | Playwright fixture projects for the C4DT lab. |
| e2e/data/projects/projectTabs/app/.gitkeep | Ensures e2e projectTabs/app directory exists. |
| e2e/data/projects/projectTabs/demo/.gitkeep | Ensures e2e projectTabs/demo directory exists. |
| e2e/data/projects/projectTabs/details/.gitkeep | Ensures e2e projectTabs/details directory exists. |
| e2e/data/projects/projectTabs/hands-on/.gitkeep | Ensures e2e projectTabs/hands-on directory exists. |
| e2e/data/projects/projectTabs/pilot/.gitkeep | Ensures e2e projectTabs/pilot directory exists. |
| e2e/data/projects/projectTabs/presentation/.gitkeep | Ensures e2e projectTabs/presentation directory exists. |
| data/projects/.prettierrc | Adds a local Prettier config for data/projects content. |
| data/projects/config.yaml | Defines highlighted projects in the new data layout. |
| data/projects/template.yaml | Provides a template for authoring per-lab project YAML files. |
| data/projects/TAGS.txt | Documents the tag taxonomy used in project YAML files. |
| data/projects/AIMM.yaml | Moves AIMM lab projects into the new per-lab YAML format/location. |
| data/projects/C4DT.yaml | Moves C4DT lab projects into the new per-lab YAML format/location. |
| data/projects/COMPSEC.yaml | Moves COMPSEC lab projects into the new per-lab YAML format/location. |
| data/projects/INDY.yaml | Moves INDY lab projects into the new per-lab YAML format/location. |
| data/projects/LAMP.yaml | Moves LAMP lab projects into the new per-lab YAML format/location. |
| data/projects/LAP.yaml | Moves LAP lab projects into the new per-lab YAML format/location. |
| data/projects/LARA.yaml | Moves LARA lab projects into the new per-lab YAML format/location. |
| data/projects/LASEC.yaml | Moves LASEC lab projects into the new per-lab YAML format/location. |
| data/projects/LCA2.yaml | Moves LCA2 lab projects into the new per-lab YAML format/location. |
| data/projects/LDS.yaml | Moves LDS lab projects into the new per-lab YAML format/location. |
| data/projects/LIA.yaml | Moves LIA lab projects into the new per-lab YAML format/location. |
| data/projects/LSI.yaml | Moves LSI lab projects into the new per-lab YAML format/location. |
| data/projects/LSIR.yaml | Moves LSIR lab projects into the new per-lab YAML format/location. |
| data/projects/MMSPG.yaml | Moves MMSPG lab projects into the new per-lab YAML format/location. |
| data/projects/NAL.yaml | Moves NAL lab projects into the new per-lab YAML format/location. |
| data/projects/NLP.yaml | Moves NLP lab projects into the new per-lab YAML format/location. |
| data/projects/PARSA.yaml | Moves PARSA lab projects into the new per-lab YAML format/location. |
| data/projects/RS3LAB.yaml | Moves RS3LAB lab projects into the new per-lab YAML format/location. |
| data/projects/SACS.yaml | Moves SACS lab projects into the new per-lab YAML format/location. |
| data/projects/SalatheLab.yaml | Moves SalatheLab projects into the new per-lab YAML format/location. |
| data/projects/SystemF.yaml | Moves SystemF lab projects into the new per-lab YAML format/location. |
| data/projects/VCA.yaml | Moves VCA lab projects into the new per-lab YAML format/location. |
| data/projects/VLSC.yaml | Moves VLSC lab projects into the new per-lab YAML format/location. |
| data/projects/projectTabs/app/freegaen.vue | Adds project “app” tab content under the new data structure. |
| data/projects/projectTabs/app/lightarti.vue | Adds project “app” tab content under the new data structure. |
| data/projects/projectTabs/app/spindle.vue | Adds project “app” tab content under the new data structure. |
| data/projects/projectTabs/demo/at2.vue | Adds project “demo” tab content under the new data structure. |
| data/projects/projectTabs/demo/calypso.vue | Adds project “demo” tab content under the new data structure. |
| data/projects/projectTabs/demo/disco.vue | Adds project “demo” tab content under the new data structure. |
| data/projects/projectTabs/demo/drynx.vue | Adds project “demo” tab content under the new data structure. |
| data/projects/projectTabs/demo/garfield.vue | Adds project “demo” tab content under the new data structure. |
| data/projects/projectTabs/demo/medco.vue | Adds project “demo” tab content under the new data structure. |
| data/projects/projectTabs/demo/odyssey.vue | Adds project “demo” tab content under the new data structure. |
| data/projects/projectTabs/demo/omniledger.vue | Adds project “demo” tab content under the new data structure. |
| data/projects/projectTabs/demo/spindle.vue | Adds project “demo” tab content under the new data structure. |
| data/projects/projectTabs/demo/stainless-for-smart-contracts.vue | Adds project “demo” tab content under the new data structure. |
| data/projects/projectTabs/details/at2.vue | Adds project “details” tab content under the new data structure. |
| data/projects/projectTabs/details/calypso.vue | Adds project “details” tab content under the new data structure. |
| data/projects/projectTabs/details/omniledger.vue | Adds project “details” tab content under the new data structure. |
| data/projects/projectTabs/details/spindle.vue | Adds project “details” tab content under the new data structure. |
| data/projects/projectTabs/hands-on/calypso.vue | Adds project “hands-on” tab content under the new data structure. |
| data/projects/projectTabs/pilot/dvoting.vue | Adds project “pilot” tab content under the new data structure. |
| data/projects/projectTabs/pilot/omniledger.vue | Adds project “pilot” tab content under the new data structure. |
| data/projects/projectTabs/presentation/anyway.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/at2.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/calypso.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/crowdnotifier.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/disco.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/dp3t.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/drynx.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/dvoting.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/freegaen.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/garfield.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/innosuisse-eid.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/klint.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/lightarti.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/matrix-epfl.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/medco.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/omniledger.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/orchard.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/spindle.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/stainless-for-smart-contracts.vue | Adds project “presentation” tab content under the new data structure. |
| data/projects/projectTabs/presentation/tandem_monero.vue | Adds project “presentation” tab content under the new data structure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Validate labs.yaml | ||
| const labsSrc = await fs.readFile(path.join(DATA_DIR, "labs.yaml"), "utf-8"); | ||
| const labsContent = yaml.parse(labsSrc); | ||
| check("data/labs.yaml", labsSchema, labsContent, validateLabs(labsContent), validateLabs.errors); | ||
| check("projects/labs.yaml", labsSchema, labsContent, validateLabs(labsContent), validateLabs.errors); | ||
|
|
||
| // Validate each lab's projects.yaml | ||
| const dirs = (await fs.readdir(DATA_DIR, { withFileTypes: true })).filter( | ||
| (d) => d.isDirectory() && d.name !== "projectTabs" | ||
| // Validate each lab's YAML file | ||
| const files = (await fs.readdir(DATA_DIR, { withFileTypes: true })).filter( | ||
| (f) => | ||
| f.isFile() && | ||
| f.name.endsWith(".yaml") && | ||
| f.name !== "labs.yaml" && | ||
| f.name !== "config.yaml" && | ||
| f.name !== "template.yaml" | ||
| ); | ||
|
|
||
| for (const dir of dirs) { | ||
| const rel = `data/${dir.name}/projects.yaml`; | ||
| const projectsFile = path.join(DATA_DIR, dir.name, "projects.yaml"); | ||
| for (const file of files) { | ||
| const rel = `projects/${file.name}`; | ||
| const projectsFile = path.join(DATA_DIR, file.name); |
There was a problem hiding this comment.
The displayed file path passed to check() (e.g., "projects/labs.yaml" and projects/${file.name}) no longer matches the actual location (data/projects/...). This will make validation output/error messages harder to act on; consider reporting the real repo-relative path (e.g., data/projects/labs.yaml, data/projects/${file.name}).
|
project tabs are not properly shown |
|
@PascalinDe this is in Ready4Review, but it's a draft - putting it back into Active Tasks |
closes #329