How mariavyso/fact-data-modeling-pub-mariavyso works
Project Type and Purpose
• This repository is not a typical full-stack app but an automated grading harness for a SQL assignment (“Fact Data Modeling”).
• Students supply SQL files in the submission/ folder; the system runs tests against those queries, generates feedback, and posts results via GitHub.
File Structure Analysis
• Top-level
• .github/workflows/autograding.yml – CI pipeline definition
• Dockerfile – container spec for the test runner
• README.md – assignment instructions
• _app/ – core grading application
• requirements.txt – Python dependencies
• src/entrypoint.sh – container entrypoint, kicks off tests and comment generation
• src/trino_tests.py – logic to connect to Trino, execute SQL tests, collect results
• src/generate_comment.py – assembles test results and posts comments to the PR via GitHub API
• src/util.py – shared helper functions
• submission/ – student‐editable files (query_1.sql … query_8.sql)
README Insights
• Emphasis on not modifying _app, Dockerfile, or .github (they power automation).
• Tests are triggered by opening a PR; results are passed to TAs automatically.
• Under the hood, the harness spins up a container, runs Trino against sample data, and uses Python scripts to drive the workflow.
a. Main Components
• Student Submission (SQL files in submission/)
• GitHub Actions CI (.github/workflows/autograding.yml)
• Docker Container (built from Dockerfile)
• Entry Point Script (entrypoint.sh)
• Test Runner (trino_tests.py + Trino engine)
• Feedback Generator (generate_comment.py + GitHub API)
b. Relationships & Interactions
1. Student pushes code → GitHub Action triggers on PR
2. CI builds Docker image (includes _app code + Python deps)
3. Container runs entrypoint.sh
4. trino_tests.py connects to Trino, loads submission/*.sql, executes and validates results
5. Results passed to generate_comment.py, which calls GitHub API to post feedback on the PR
c. Architectural Patterns
• CI/CD Pipeline: Automated workflow triggered by pull request events
• Containerization: Isolated grading environment for reproducibility
• Modular Scripts: Separate concerns (testing vs. comment generation)
d. Technology & Framework Highlights
• GitHub Actions for orchestration
• Docker for consistent runtime
• Python (with dependencies in requirements.txt) as the glue
• Trino (Presto) as the SQL execution engine
• GitHub API for publishing results