Skip to content

Conversation

@stuartc
Copy link
Member

@stuartc stuartc commented Sep 18, 2025

Description

This PR improves Docker build management and development environment setup scripts with comprehensive refactoring.

Changes:

Docker & Build Management:

  • Add bin/update-images script that automates updating Dockerfile ARG versions from .tool-versions file
  • Fix Dockerfile-dev for aarch64 (Apple Silicon) builds by switching to nodesource apt repo
  • Update postgres version in docker-compose.yml to 15.12

Bootstrap Script Refactoring:

  • Complete refactor of bin/bootstrap with modern bash practices and better UX
  • Add comprehensive environment fact gathering phase that shows complete system status upfront
  • Separate dependency checking from installation strategy for better error reporting
  • Implement batch homebrew package installation (libsodium, cmake, rust)
  • Add Rust dependency support via homebrew with automatic installation
  • Improve error handling with detailed status reporting before any failures
  • Use modern bash practices: set -euo pipefail, functions, associative arrays
  • Show users exactly what's missing vs what can be automatically installed

Validation steps

Docker Management:

  1. Run ./bin/update-images --help to see available commands
  2. Run ./bin/update-images --dry-run to preview changes without applying them
  3. Test Dockerfile-dev builds on Apple Silicon machines

Bootstrap Script:

  1. Run ./bin/bootstrap to test the improved dependency management
  2. Test on systems with missing dependencies to see improved error reporting
  3. Verify homebrew packages are installed in batch rather than one-by-one

Additional notes for the reviewer

  • The update-images script includes parameter validation, error handling, backup file cleanup, and supports dry-run mode with side-by-side diffs
  • The bootstrap script now provides much better visibility into environment status and fails gracefully with actionable error messages
  • Both scripts follow modern bash best practices and pass shellcheck validation

AI Usage

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

Pre-submission checklist

  • I have performed a self-review of my code.
  • I have implemented and tested all related authorization policies. (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

Updated postgres version in docker-compose.yml to 15.12
Automates updating Dockerfile ARG versions from .tool-versions file.
Supports dry-run mode with side-by-side diffs, Debian version discovery
via Docker Hub API, and atomic updates with rollback on failure.

Usage: ./bin/update-images [update|--update-debian|--dry-run|show-debian-images]
@github-project-automation github-project-automation bot moved this to New Issues in v2 Sep 18, 2025
@stuartc stuartc requested a review from midigofrank September 18, 2025 10:29
@codecov
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.56%. Comparing base (20e1062) to head (dea8ab8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3589      +/-   ##
==========================================
- Coverage   89.57%   89.56%   -0.01%     
==========================================
  Files         401      401              
  Lines       16472    16472              
==========================================
- Hits        14754    14753       -1     
- Misses       1718     1719       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

stuartc and others added 4 commits September 18, 2025 14:51
- Remove caching and cleanup steps (no longer needed)
- Use NodeSource repository setup script for Node.js installation
- Install specific Node.js version matching Dockerfile approach
Extract major version using shell variable instead of inline pipe
to avoid CircleCI parameter parsing errors.
- Add environment fact gathering phase
- Separate dependency checking from installation strategy
- Implement batch homebrew package installation
- Add Rust dependency checking preferring existing install over Homebrew
- Improve error handling with better status reporting
- Show complete dependency overview before any installations
- Use modern bash practices (set -euo pipefail, functions, arrays)
@stuartc stuartc mentioned this pull request Sep 22, 2025
9 tasks
@stuartc stuartc force-pushed the some_dockerfile_love branch from 819abda to dea8ab8 Compare September 22, 2025 06:18
@stuartc stuartc changed the title Add Dockerfile version management script and fix aarch64 builds Improve Docker management and bootstrap script with comprehensive refactoring Sep 22, 2025
@stuartc stuartc merged commit e591165 into main Sep 22, 2025
7 of 8 checks passed
@stuartc stuartc deleted the some_dockerfile_love branch September 22, 2025 06:25
@github-project-automation github-project-automation bot moved this from New Issues to Done in v2 Sep 22, 2025
@stuartc stuartc removed the request for review from midigofrank September 22, 2025 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants