Skip to content

Comments

Migrate to cursor, add ESP-IDF#4

Merged
hacker-cb merged 17 commits intomasterfrom
dev
Oct 27, 2025
Merged

Migrate to cursor, add ESP-IDF#4
hacker-cb merged 17 commits intomasterfrom
dev

Conversation

@hacker-cb
Copy link
Contributor

This pull request introduces a comprehensive set of standards, automation, and documentation improvements for managing Docker images and CI/CD workflows in the repository. The main changes include the addition of reusable GitHub Actions workflows for Docker builds, standardization of workflow and Dockerfile practices, and the introduction of detailed documentation and project structure conventions. These updates streamline the process for adding new images, ensure consistency, and make local and CI/CD testing easier.

CI/CD Workflow Automation and Standardization

  • Added a reusable workflow (.github/workflows/reusable-docker-build.yml) for Docker image builds, supporting dynamic tagging, cache strategy, multi-architecture builds, and image signing. This workflow is now used by per-image workflows like platformio.yml and the new esp-idf.yml, greatly simplifying and standardizing CI/CD for all images. [1] [2] [3] [4]
  • Introduced a dedicated workflow for the ESP-IDF image (esp-idf.yml) and refactored the PlatformIO workflow to use the new reusable workflow, improving maintainability and consistency. [1] [2] [3]
  • Added .actrc configuration for local workflow testing with act, enabling developers to test CI workflows locally with consistent container options and verbose output.

Repository, Dockerfile, and Workflow Standards

  • Added detailed standards for Dockerfiles (dockerfile-standards.mdc), GitHub Actions workflows (github-actions-standards.mdc), documentation (documentation-standards.mdc), and commit conventions (commit-conventions.mdc). These documents set clear expectations for image structure, build arguments, environment variables, workflow naming, and commit practices. [1] [2] [3] [4]
  • Introduced a project structure guide (project-structure.mdc) outlining directory layout, registry naming, and branch strategy for the multi-image Docker project.

Documentation and Contribution Process

  • Added a step-by-step guide for adding new Docker images, including directory structure, Dockerfile and README requirements, workflow setup, and local/CI testing instructions.
  • Enforced that each image must have comprehensive documentation and that the root README remains minimal and scalable. [1] [2]

Cleanup

  • Removed the .replit configuration, as it is no longer needed for the current development workflow.

These changes collectively make the repository more maintainable, scalable, and contributor-friendly, while ensuring high-quality, consistent Docker images and CI/CD processes.

- Restructure root README for multi-image project architecture
- Complete rewrite of PlatformIO image README from scratch
- Remove misleading claims about pre-cached toolchains
- Add comprehensive usage examples (CI/CD, local dev)
- Include detailed troubleshooting section
- Document design decisions and rationale
- Clarify that toolchains download on first build
- Add version information table
- Improve structure and readability throughout
- project-structure.mdc: Always-applied rule defining multi-image architecture
- documentation-standards.mdc: Guidelines for README files (root and image-specific)
- dockerfile-standards.mdc: Conventions for Dockerfile creation and optimization
- adding-new-images.mdc: Complete checklist for adding new Docker images
- commit-conventions.mdc: Git commit message standards and best practices

These rules ensure consistency across the project and guide future development.
- Add 🐳 Docker whale to workflow name for better visibility
- Add step icons for improved readability:
  - 📥 Checkout repository
  - 🔧 Set up Docker Buildx
  - 🔐 Log in to Registry
  - 🏷️ Extract metadata
  - 🎯 Generate tags
  - 💾 Determine cache strategy
  - 🐳 Build and push Docker image
  - 📝 Install Cosign
  - ✍️ Sign Docker image

Improves visual scanning and gives workflow a modern, professional appearance.
- Define emoji icon conventions for workflow names
- Provide comprehensive icon reference for common step types
- Include practical examples and benefits
- Ensure consistency across all workflow files
- Auto-applies to all .yml/.yaml files in .github/workflows/

This rule will help maintain visual consistency and readability
in GitHub Actions workflows as the project grows.
- Explicitly disallow AI from committing changes automatically

- AI can suggest commit messages but requires user confirmation

- AI can propose what to commit but user must approve

- Ensures developer maintains full control over commit history
- Emphasize Dockerfile-first approach
- Require local build before documentation
- Add warning to never document before successful build
- Restructure as step-by-step workflow
- Simplify workflow steps for adding new Docker images
- Emphasize the importance of building the image before documentation
- Update README requirements to include essential sections
- Streamline Dockerfile and README creation guidelines
- Enhance testing and verification checklist for new images
…tion

- Set 'alwaysApply: true' for guidelines on adding new images, commit conventions, Dockerfile standards, documentation standards, and GitHub Actions standards
- Ensures uniform application of rules across relevant files
- Create reusable Docker build workflow for all images
- Refactor platformio.yml to use reusable workflow (141 -> 45 lines)
- Support custom_tags (plural) with comma-separated values
- Add .actrc configuration for local workflow testing
- Update .gitignore with act-related files and better organization
- Update Cursor rules to document reusable workflow pattern
- Add local testing guidelines with act to documentation standards
- Remove sections on Troubleshooting and Design Decisions from documentation standards to maintain focus on usage.
- Update PlatformIO README to eliminate troubleshooting content, emphasizing reliance on upstream documentation.
- Streamline version information presentation for improved clarity.
- Introduced a new input parameter 'build_args' for specifying build arguments in the reusable Docker build workflow.
- This allows users to pass multiple build arguments in a newline-separated format, enhancing flexibility in Docker image builds.
- Introduced a new Docker image for ESP-IDF 5.4.1, including QEMU support and comprehensive testing tools.
- Created a GitHub Actions workflow for building the ESP-IDF Docker image, allowing for automated builds on push and pull request events.
- Updated README with detailed usage instructions, supported chips, and quick start guide for the ESP-IDF image.
- Added Dockerfile for the ESP-IDF image, including necessary dependencies and configuration for testing and code quality tools.
Copilot AI review requested due to automatic review settings October 27, 2025 21:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request transforms the repository into a comprehensive multi-image Docker development environment with standardized workflows, documentation, and CI/CD automation. The main focus is adding ESP-IDF support alongside existing PlatformIO capabilities, while establishing clear standards and reusable workflows for future image additions.

Key Changes:

  • Added reusable GitHub Actions workflow for Docker builds with standardized tagging, caching, and signing
  • Introduced ESP-IDF 5.4.1 image with QEMU emulation and comprehensive testing tools
  • Established comprehensive documentation and coding standards via Cursor rules
  • Cleaned up obsolete Replit configuration files

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/reusable-docker-build.yml New reusable workflow providing standardized Docker build pipeline with multi-arch support, dynamic tagging, and Cosign signing
.github/workflows/esp-idf.yml Workflow for ESP-IDF image builds using the reusable workflow
.github/workflows/platformio.yml Refactored to use reusable workflow, eliminating code duplication
images/esp-idf/Dockerfile New ESP-IDF 5.4.1 image with QEMU, pytest, and testing frameworks
images/esp-idf/README.md Comprehensive documentation for ESP-IDF image
images/platformio/README.md Enhanced documentation with detailed usage examples and version info
README.md Updated to support multi-image architecture with generic overview
.cursor/rules/*.mdc New standards documents for Dockerfiles, workflows, documentation, and commits
.actrc Configuration for local workflow testing with act
.replit, replit.md Removed obsolete Replit configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +31 to +33
# Create ccache directory that's writable by any user
RUN mkdir -p /opt/ccache && \
chmod 1777 /opt/ccache
Copy link

Copilot AI Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting permissions to 1777 (world-writable with sticky bit) on /opt/ccache could pose a security risk. While the sticky bit prevents users from deleting others' files, this allows any user to write to this directory. Consider using a more restrictive permission model or documenting the security implications.

Suggested change
# Create ccache directory that's writable by any user
RUN mkdir -p /opt/ccache && \
chmod 1777 /opt/ccache
# Create ccache directory with restricted permissions (owner: root, group: root)
RUN mkdir -p /opt/ccache && \
chown root:root /opt/ccache && \
chmod 0770 /opt/ccache

Copilot uses AI. Check for mistakes.
…de image scope for better caching management
…er branch

- Modify the logic for adding the ESP-IDF version tag to ensure it is only included when the workflow is triggered on the master branch.
- Adjust handling of custom tags to maintain flexibility in tagging based on branch context.
@hacker-cb hacker-cb closed this Oct 27, 2025
@hacker-cb hacker-cb reopened this Oct 27, 2025
@hacker-cb hacker-cb merged commit 6d2be49 into master Oct 27, 2025
6 of 9 checks passed
@hacker-cb hacker-cb deleted the dev branch October 27, 2025 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant