Development Workflows for Magma
Introduction
This document outlines the recommended development workflows for contributing to Magma. Whether you're a new contributor or an experienced developer, following these workflows will help streamline your development process and ensure compatibility with the Magma codebase. This guide covers setting up development environments using devcontainers, managing container updates, and provides directions for tackling "good first issue" tasks.
Development Environment Setup with Devcontainers
Devcontainers (Development Containers) provide a consistent, reproducible development environment using Docker, ensuring that all developers work with the same tools and dependencies. This approach minimizes "works on my machine" issues and simplifies onboarding for new contributors.
Prerequisites
- Docker: Ensure Docker is installed on your system. Follow the Docker installation guide for your operating system.
- Visual Studio Code: Recommended for devcontainer support. Install VS Code and the "Remote - Containers" extension.
- Devcontainer extention:
Setting Up a Devcontainer for Magma
- Clone the Magma Repository:
git clone https://github.com/magma/magma.git
cd magma - Open in VS Code:
- Open the cloned repository in Visual Studio Code.
- Use the Command Palette (
Ctrl+Shift+PorCmd+Shift+Pon macOS) and select "Remote-Containers: Reopen in Container".
- Configuration:
- The
.devcontainerextention builds the necessary docker image with all developments tools needed, this image contains the configuration for the development environment. - The container will build with all necessary dependencies for Magma development, including build tools, libraries, and runtime environments.
- The
- Start Developing:
- Once the container is running, your VS Code environment will be inside the container, with access to all required tools.
- Use terminal commands within VS Code to build, test, and run Magma components.
Benefits of Devcontainers
- Consistency: All developers use the same environment, reducing discrepancies.
- Isolation: Development environment is isolated from your local system, preventing conflicts with other projects.
- Ease of Setup: New contributors can get started quickly without manual dependency installation.
For more details on devcontainers, refer to the VS Code Remote - Containers documentation.