Merged
Conversation
Implement the core parser for Boothfile DSL that: - Validates # syntax=codingbooth/boothfile:1 header - Parses all Phase 1-3 commands (run, copy, env, setup, install, etc.) - Supports heredoc syntax with three modes (verbatim, &&-join, ;-join) - Handles comments (full-line and inline) - Provides error messages with line numbers and suggestions - Includes DOCKER escape hatch for unsupported directives
Implement the compiler that converts parsed Boothfile commands to Dockerfile: - Generate fixed CodingBooth prologue (syntax, ARG, FROM, SHELL, USER, WORKDIR) - Compile all Phase 1 commands (run, copy, env, workdir, expose, label, arg) - Compile heredoc with three modes (verbatim, &&-join, ;-join) - Compile Phase 2 setup command (setup python 3.12 -> RUN python--setup.sh 3.12) - Compile Phase 3 install command (install pip django -> RUN pip--install.sh django) - Support custom setup script detection with automatic COPY injection - Handle DOCKER escape hatch (pass-through to Dockerfile)
Integrate Boothfile compiler into the booth CLI: - Add --boothfile flag to specify Boothfile path - Add --emit-dockerfile flag to output generated Dockerfile without building - Add --strict flag to treat warnings as errors - Add Boothfile/EmitDockerfile/Strict fields to AppConfig with env vars - Auto-detect .booth/Boothfile (takes precedence over .booth/Dockerfile) - Compile Boothfile to .booth/.Dockerfile.generated for Docker build - Support custom setup script detection from .booth/setups/ File selection precedence: 1. --dockerfile (explicit) - use directly 2. --boothfile (explicit) - compile and use 3. .booth/Boothfile (auto-detect) - compile and use 4. .booth/Dockerfile (auto-detect) - use directly
Test full parse->compile pipeline with realistic scenarios: - Django/Python project Boothfile - Java/Maven project Boothfile - Node.js project Boothfile - Data science environment with scientific stack - Go microservices environment Test heredoc modes: - Verbatim mode for complex shell scripts - And-join mode (&&) for package installation - Semi-join mode (;) for optional commands Test edge cases: - Custom setup script detection - Error recovery and multiple error reporting - Empty Boothfile, comments-only Boothfile - Long command lines, special characters
Update docs/plans/Boothfile.md: - Add heredoc mode selection (verbatim, &&-join, ;-join) - Add arg variable usage with naming conventions - Update examples for new heredoc syntax Update README.md: - Add Boothfile to Table of Contents - Add new CLI flags (--boothfile, --emit-dockerfile, --strict) - Update .booth/ folder structure with Boothfile and setups/ - Add comprehensive Boothfile section with: - Why Boothfile (comparison with Dockerfile) - Command reference table - Heredoc modes documentation - Variable usage with arg - Custom setup scripts - File precedence rules - Complete example
Add integration tests for: - test014: --emit-dockerfile flag with auto-detected Boothfile - test015: --boothfile flag to explicitly specify Boothfile path Tests verify that the Boothfile compiler correctly generates: - Dockerfile prologue (syntax, ARG, FROM, SHELL, etc.) - Compiled commands (setup, install, env)
Demonstrates Boothfile DSL features: - Setup commands (python, nodejs) - Install commands (pip, npm packages) - Build arguments with defaults - Environment variables - Heredoc support with and-join mode - Expose ports Includes Flask app, README, booth wrapper, and test script.
18a4e96 to
c036e73
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.