How starburstdata/metabase-driver works
Main Components
• Driver Plugin Module: Highlight the drivers/starburst directory as the core of the plugin. This includes source code (Clojure files under src), driver implementations, and tests.
• Build & Automation System:
• The Makefile that manages cloning the Metabase repository, copying driver files, building the .jar, and starting the local server.
• GitHub Actions workflows (found under .github) which encapsulate CI checks, release branch creation, release artifact building, and dependency management.
• External Dependencies:
• The Metabase Repository: Depicted as an external system that this project interacts with (via cloning & integration into the Metabase modules directory).
• Dockerized Trino Server: Used during testing where a Docker container (from resources/docker/trino) is used to simulate/expose a Trino server, essential for validating connectivity and data population into test catalogs.
• Testing Environment: Components that include local server start-up (Makefile targets for server and test) and specific test directories (test directories under drivers/starburst/test).
Relationships and Interactions
• Build Process Flow: Illustrate the steps where “make build” first clones the Metabase repo, then copies the Starburst driver files into the appropriate Metabase modules directory. This subsystem then triggers the build scripts provided in the Metabase repo to compile and package the .jar.
• Plugin Integration: Represent the final .jar file that must be placed in the Metabase plugins directory. This signals the separation of concerns: the Starburst driver, once built and tested, acts as a plug-in that extends Metabase’s functionality.
Key Architectural Patterns and Design Principles
• Plugin Architecture: The driver is designed as a plug-in which adheres to Metabase’s driver API, so clearly segmenting the driver code from the main platform (Metabase) is essential.
• Modular Build & Test Strategy: Show how the Makefile serves as an orchestrator for different stages (build, server startup, tests) and how CI/CD workflows (via GitHub Actions) integrate continuous validation and release management.
• Dependency Management: Illustrate the version file (app_versions.json) and the use of dependency files (e.g., deps.edn) which are instrumental in ensuring reproducible builds.
Elements
• Components clearly labeled “Driver Plugin (Starburst)”, “Metabase Repository”, “Makefile Build Process”, “CI/CD Workflows (GitHub Actions)”, “Docker – Trino Server”, and “Test Suite”.
• Codebase components (driver source, tests)
• Automation components (Makefile, GitHub workflows)
• External systems (Metabase core application, Dockerized servers)
• Actions such as “Build”, “Test”, “Deploy/Release”, and “Plugin Integration” at the relevant parts of the workflow.