# Contributing to deb-bootc-image-builder Thank you for your interest in contributing to deb-bootc-image-builder! This document provides guidelines and information for contributors. ## ๐Ÿ—๏ธ Repository Structure This repository follows the standard structure used by [osbuild/bootc-image-builder](https://github.com/osbuild/bootc-image-builder) and other osbuild projects: ``` . โ”œโ”€โ”€ .fmf/ # FMF (Flexible Metadata Format) testing framework โ”‚ โ”œโ”€โ”€ config # FMF configuration โ”‚ โ”œโ”€โ”€ plans/ # Test plans โ”‚ โ”œโ”€โ”€ stories/ # User stories โ”‚ โ””โ”€โ”€ features/ # Feature specifications โ”œโ”€โ”€ .github/ # GitHub workflows and templates โ”‚ โ””โ”€โ”€ workflows/ # CI/CD workflows โ”œโ”€โ”€ .tekton/ # Tekton CI/CD pipelines โ”œโ”€โ”€ bib/ # Main Go application (bootc-image-builder) โ”‚ โ”œโ”€โ”€ cmd/ # Command-line interfaces โ”‚ โ”œโ”€โ”€ internal/ # Internal packages โ”‚ โ””โ”€โ”€ data/ # Static data files โ”œโ”€โ”€ bin/ # Binary outputs and tools โ”œโ”€โ”€ containerfiles/ # Container definitions โ”œโ”€โ”€ devel/ # Development tools and documentation โ”œโ”€โ”€ docs/ # Project documentation โ”œโ”€โ”€ osbuild-stages/ # Custom osbuild stages for Debian โ”œโ”€โ”€ ostree-workspace/ # OSTree development workspace โ”œโ”€โ”€ plans/ # Test plans and specifications โ”œโ”€โ”€ recipes/ # YAML recipe files for OS builds โ”œโ”€โ”€ scripts/ # Utility scripts organized by function โ”‚ โ”œโ”€โ”€ build-scripts/ # Build and compilation scripts โ”‚ โ”œโ”€โ”€ integration-scripts/ # Integration and testing scripts โ”‚ โ”œโ”€โ”€ test-scripts/ # Test execution scripts โ”‚ โ””โ”€โ”€ test-files/ # Test-related files โ”œโ”€โ”€ test/ # Test files and utilities โ”‚ โ”œโ”€โ”€ integration/ # Integration tests โ”‚ โ”œโ”€โ”€ unit/ # Unit tests โ”‚ โ”œโ”€โ”€ performance/ # Performance tests โ”‚ โ””โ”€โ”€ test-images/ # Test image files โ”œโ”€โ”€ Containerfile # Main container definition โ”œโ”€โ”€ Containerfile.particle-os # Particle OS specific container โ”œโ”€โ”€ Makefile # Build and development tasks โ”œโ”€โ”€ README.md # Project documentation โ””โ”€โ”€ CHANGELOG.md # Change history ``` ## ๐Ÿ“ Directory Organization ### **Core Application (`bib/`)** - **`cmd/`**: Command-line interfaces and entry points - **`internal/`**: Internal packages and implementation - **`data/`**: Static data files and resources ### **Scripts (`scripts/`)** - **`build-scripts/`**: Build, compilation, and deployment scripts - **`integration-scripts/`**: Integration testing and workflow scripts - **`test-scripts/`**: Test execution and validation scripts - **`test-files/`**: Test-related configuration and data files ### **Testing (`test/`)** - **`integration/`**: End-to-end integration tests - **`unit/`**: Unit tests for individual components - **`performance/`**: Performance and benchmark tests - **`test-images/`**: Test image files and artifacts ### **Documentation (`docs/`)** - **User guides**: How to use the tool - **Developer guides**: How to contribute and develop - **Architecture docs**: System design and implementation details ## ๐Ÿงช Testing Framework This project uses the **FMF (Flexible Metadata Format)** testing framework, which is the standard for osbuild projects: - **`.fmf/plans/`**: Test plans and specifications - **`.fmf/stories/`**: User stories and requirements - **`.fmf/features/`**: Feature specifications and tests ## ๐Ÿš€ Development Workflow ### **1. Setting Up Development Environment** ```bash # Clone the repository git clone https://github.com/your-username/deb-bootc-image-builder.git cd deb-bootc-image-builder # Install Go dependencies cd bib go mod download cd .. # Install Python dependencies for testing pip install -r test/requirements.txt ``` ### **2. Running Tests** ```bash # Run all tests pytest test/ # Run specific test categories pytest test/unit/ pytest test/integration/ pytest test/performance/ # Run with FMF fmf run --all ``` ### **3. Building the Application** ```bash # Build from source cd bib go build -o particle-os cmd/builder/main.go cd .. # Use Makefile targets make build make test make clean ``` ## ๐Ÿ“ Code Style and Standards ### **Go Code** - Follow Go standard formatting (`go fmt`) - Use `golangci-lint` for linting - Follow Go naming conventions - Include proper error handling ### **Python Code** - Follow PEP 8 style guidelines - Use type hints where appropriate - Include docstrings for functions and classes - Run `flake8` and `pylint` for code quality ### **Shell Scripts** - Use `bash` with `set -euo pipefail` - Follow shell script best practices - Include proper error handling and cleanup ## ๐Ÿ”ง Adding New Features ### **1. Create Feature Branch** ```bash git checkout -b feature/your-feature-name ``` ### **2. Implement Feature** - Add code in appropriate directories - Include tests for new functionality - Update documentation as needed ### **3. Test Your Changes** ```bash # Run relevant tests pytest test/unit/test_your_feature.py pytest test/integration/test_your_feature.py # Run full test suite make test ``` ### **4. Submit Pull Request** - Create descriptive PR title and description - Reference any related issues - Ensure all tests pass - Request review from maintainers ## ๐Ÿ› Reporting Issues When reporting issues, please include: 1. **Clear description** of the problem 2. **Steps to reproduce** the issue 3. **Expected vs actual behavior** 4. **Environment details** (OS, Go version, etc.) 5. **Relevant logs** and error messages ## ๐Ÿ“š Additional Resources - **Project Documentation**: See `docs/` directory - **Original Project**: [osbuild/bootc-image-builder](https://github.com/osbuild/bootc-image-builder) - **FMF Testing**: [FMF Documentation](https://fmf.readthedocs.io/) - **osbuild**: [osbuild.org](https://www.osbuild.org) ## ๐Ÿค Getting Help - **GitHub Issues**: For bug reports and feature requests - **GitHub Discussions**: For questions and general discussion - **Matrix**: Join #image-builder on fedoraproject.org Thank you for contributing to deb-bootc-image-builder!