Skip to content

Conversation

nuwan-samarasinghe
Copy link
Collaborator

@nuwan-samarasinghe nuwan-samarasinghe commented Aug 28, 2025

Ticket: https://mhclgdigital.atlassian.net/browse/FLS-1473

Change description

Build & CI cleanup: submodules, dependencies, Docker, caching; upgrade webpack

Summary

This PR streamlines our build pipeline and dependency management, improves Docker image quality and caching, and upgrades the Designer build to webpack 5 to align with @hapi/hapi v21.

What changed

  1. Submodules handled at checkout

    • Move submodule fetching out of Docker and into GitHub Actions checkout.
    • All submodules are now downloaded during CI checkout (no git submodule in Docker).
  2. Centralized dependency management

    • Removed manual updates for the xGov form builder joi dependency.
    • Dependencies now resolved via the root package.json (consistent across packages).
  3. Immutable installs with Yarn

    • Enforce deterministic installs using yarn.lock (e.g., yarn install --frozen-lockfile).
    • Prevents “works on my machine” version drift.
  4. Test & SCSS adjustments

    • Minor updates to tests and styles to reflect consolidated dependencies.
    • Trade-off: small refactors, but much simpler dependency graph.
  5. .dockerignore added

    • Stop deleting .git inside the Dockerfile—exclude it via .dockerignore instead.
    • Smaller build context and cleaner images.
  6. Simplified Dockerfiles

    • Leaner, easier-to-read Dockerfiles with fewer moving parts.
  7. Improved Docker layer caching

    • Layer order optimised so unchanged layers are reused.
    • Rebuilds only when inputs change → faster CI and local builds.
  8. Designer build: webpack v4 → v5

    • Upgrade to webpack 5 to match @hapi/hapi 21 support.
    • Updated config/plugins where required.

Why this is better

  • Faster builds: Better layer caching and smaller contexts.

  • Reproducible installs: Lockfile-driven, immutable dependency resolution.

  • Simpler pipeline: Less logic inside Docker; more control in CI.

  • Modern toolchain: Designer on webpack 5 for current ecosystem compatibility.

  • Unit tests and other appropriate tests added or updated

  • README and other documentation has been updated / added (if needed)

  • Commit messages are meaningful and follow good commit message guidelines (e.g. "FS-XXXX: Add margin to nav items preventing overlapping of logo")

How to test

All e2e should pass

@nuwan-samarasinghe nuwan-samarasinghe force-pushed the FLS-1473-build-optimization branch 3 times, most recently from e0459cb to 792b353 Compare August 28, 2025 12:38
@nuwan-samarasinghe nuwan-samarasinghe force-pushed the FLS-1473-build-optimization branch from 40eb12a to cee1740 Compare August 28, 2025 12:55
Copy link

@nuwan-samarasinghe nuwan-samarasinghe enabled auto-merge (squash) August 28, 2025 14:18
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