Page MenuHomePhabricator

Create a development environment to work on Metrics Platform PHP client library
Open, Needs TriagePublic3 Estimated Story Points

Description

Background

At this moment there is no a formal way to have/create a local development environment to use while working on MP PHP client library code so that we can run some tasks locally like tests or updating dependencies before pushing any change to the repository.

For example, at this moment each one of us has his own local environment and, every time we want to run something in a production-like environment, we have to execute those commands running a bash session over the buster-php74 image hosted at the wikimedia docker registry. For example, to update dependencies we need to do the following:

docker run -it -v .:/work docker-registry.wikimedia.org/dev/buster-php74:1.0.0-s2 /bin/bash
cd /work
rm -r vendor
rm composer.lock
composer install

and something similar to run locally the tests.

Goal

The current task aims to create a local development environment in order to provide a formal way to establish a production-like environment in our local laptop.

Acceptance Criteria
  • The environment is created and tested
  • Documentation about how to work on MP using this environment has been added to MP's wikitech site
Notes

fresh seems to be an interesting starting point. It's a docker container that contains all necessary tools/frameworks/libraries you need to work on any project that involves npm usage in a secure way. It seems reasonable to do something similar but for PHP/composer projects.

Event Timeline

Sfaci renamed this task from Create an development environment to work on Metrics Platform PHP client library to Create a development environment to work on Metrics Platform PHP client library.Jan 16 2024, 8:52 AM
phuedx set the point value for this task to 3.Jan 16 2024, 10:47 AM

fresh seems to be an interesting starting point.

As we discussed during standup, Fresh 🌱 provides a tutorial that details the Docker command that it runs in order to create the environment. Perhaps the easiest (maybe not the best?) path forward would be to use that command with the docker-registry.wikimedia.org/dev/buster-php74:1.0.0-s2 Docker image?

Also, in terms of which PHP version to target, we'd ideally target the CI version, which itself should be targeting the production version (which is 7.4.33 per https://en.wikipedia.org/wiki/Special:Version#mw-version-software).