Ephemeral Feature Environments
Automated deployment of temporary Magento 2 environments for pull requests, using anonymised production data to reduce risk and speed up reviews
Automatic deployment of temporary Magento environments for every pull request, complete with anonymized production data and unique subdomains. Environments spin up within 5-10 minutes, with full shell access for debugging, enable parallel QA testing, and clean up automatically when PRs close.
Problem
QA and code review bottlenecked on shared dev environments where only one feature could be tested at a time. And releases often blocked due to client change requests once work hits the staging site. And often the hosted staging and development site, would lack production-realistic data causing regressions and bugs to slip through.
The shared staging environment became a critical bottleneck - any client RFCs cause release blockages. And stale data cause bugs going live, that could have been prevented.
Solution
Created a ephemeral host, which was capable of deploying warden environments and providing temporary sites for individual features to be validated prior to being added to the release queue. Environments created on PR creation with a recent (last 24 hours) stripped production database and automatically destroyed on closure.
Along with a complimentary CLI tool, to facilitate log, shell and DB access for debugging purposes to the deployment environment based on current GIT remote and active branch.
Paired with Dependabot/Renovate and a E2E test suite, allows Module and Platform updates to be performed entirely by QA/PMs.
Impact
Technical Highlights
Dedicated servers providing significant compute at low cost, running Docker Swarm for orchestrating workloads for many clients.
Automated Updates
Feature environments are a critical part of an effective automated update pipeline
- Dependabot creates PR with updates
- Feature environment automatically deployed
- E2E tests run in CI
- QA manually validates in environment
- PM approves deployment from environment preview
Code Review Process
Ephemeral environments significantly boosts QA productivity and effectiveness
- Developer opens PR
- Feature environment link automatically posted to PR
- Reviewers can test the changes
- Feedback cycle shortens dramatically
- Confident merging with real-world testing
Impact
- Reduced review time from days to hours
- Eliminated environment conflicts between teams
- Enabled non-technical stakeholders to preview changes
- Caught integration issues earlier in development cycle
- Accelerated automated updates by removing dev requirement
- Improved code quality through easier testing