Thank you for your interest in contributing to Container Use! This document outlines the necessary steps and standards to follow when contributing.
Follow these steps to set up your development environment:
-
Install Go: Ensure you have Go version 1.21 or higher installed.
-
Clone the Repository:
git clone git@github.com:dagger/container-use.git
-
Install Dependencies:
go mod download
-
Container Runtime: Ensure you have a compatible container runtime installed (e.g., Docker).
To build the container-use binary without installing it to your $PATH, you can use either Dagger or Go directly:
go build -o container-use ./cmd/container-usedagger call build --platform=current export --path ./container-useContainer Use includes both unit and integration tests to maintain high code quality and functionality.
-
Run All Tests:
go test ./... -
Run Unit Tests Only (fast, no containers):
go test -short ./... -
Run Integration Tests Only:
go test -count=1 -v ./environment
Tests are structured as follows:
environment_test.go: Contains unit tests for package logic.integration_test.go: Covers integration scenarios to verify environment stability and state transitions.test_helpers.go: Provides shared utility functions for writing tests.
When contributing new features or fixing issues, adhere to these guidelines:
- Write clear unit tests for the core logic.
- Create comprehensive integration tests for validating end-to-end functionality.
- Utilize provided test helpers for common tasks to maintain consistency.
- Follow existing test patterns and naming conventions.
Maintain code consistency and readability by:
- Following standard Go coding conventions.
- Formatting code using
go fmtbefore committing. - Ensuring all tests pass locally before submitting your pull request.
Submit contributions using these steps:
- Fork the Container Use repository.
- Create a descriptive feature branch from the main branch.
- Commit your changes, including relevant tests.
- Open a pull request with a clear and descriptive explanation of your changes.