A few PHP developers in a Java World

A few PHP developers in a Java WorldElendevBlockedUnblockFollowFollowingApr 23It has been now more than a year since I’ve started at Swissquote, in a brand new team.

We inherited two major projects: managing the existing Drupal 7 public website and the yet to come Drupal 8 version of the same site.

We decided to use as much as possible the available infrastructure to ease the deployments.

As such, we started to use the provided Jenkins build farm, SonarQube server, and so on.

Those decisions has led us to what we’ve learned relatively soon: uncharted territories for a Drupal project.

To have a little bit of context:A brief presentation of SwissquoteSwissquote is an online banking and trading enterprise with 700+ employees (at the time those lines are written).

In those 700+ employees, there are more than 200 developers.

The developer population is mostly composed of Java developers (approximately 80%), ~20 Python developers, ~10 front-end developers, ~10 mobile developers (iOS / Android) and ~4 PHP developers (including me).

The challenges for such a small teamBeing the sole PHP team in the whole enterprise, we have to face alone the technical challenges encountered in the Swissquote infrastructure.

We can’t rely on other team to have already resolved the issues we are facing.

A great example is the usage of the build farm.

The build farmThe build farm is a kubernetes cluster where each team are provided a Jenkins instance, and builds are executed in Docker container.

The previous team didn’t used the build farm, so we decided to move to it to avoid having deployment issues because of our own custom computer configurations.

What we didn’t realized at the time (since we migrated at first a Drupal 7 website), is that the build-farm doesn’t have access to Internet.

The reasons behind the fact that the build farm has no access to internet is, first, the reproducibility of the builds: we need to ensure that even when Internet is down, we can still fix things and deploy to production.

The second reason is to ensure that no malicious code is pulled directly from Internet and executed into the build farm.

Drupal 8 is not like Drupal 7: it uses composer and as such executing the composer install command requires an accessible composer repository.

The Java developers don’t have this issue since they use a local Nexus to store all their dependencies.

At first, we tried to bend into the existing infrastructure: I’ve installed the Nexus Composer plugin, a brand-new plugin under heavy development at the time (we started to use it 10 days after the creation of the repository).

I was able to contribute to the development of this plugin but unfortunately it doesn’t support the official Drupal 8 repository and I haven’t been able to develop this part, making it unusable for us.

We had to commit all the vendors and the contributor modules into the repository for Drupal 8We thought about Packagist.

com on premise, but at the time it was not an option; Packagist.

com requires git repositories and we were using Mercurial.

The solution we had to use was to commit all the vendors and the contributor modules into the repository.

© Man vs.

 WildUsing Java tools (maven)The standard build process uses maven to generate artifacts and push them to a Nexus repository.

They are later deployed in production using other tools like XLDeploy.

To bend in the existing deployment process, we’ve decided to keep using maven for now: everything is already handled by the configuration of the build farm (maven configuration, Nexus repository access, …).

We can rely on other teams expertiseUsing maven in a PHP project is unusual but there is more pros than cons.

We use exec-maven-plugin to execute custom scripts we’ve made to do some job (build the assets, running some linters and some tests).

We also use maven-assembly-plugin to generate an archive containing the whole Drupal project with its dependencies (vendors, built assets, …).

The rest of the pom.

xml contains mostly deployment configuration that are used by many other teams too.

In that specific case, we can rely on other teams expertise.

There are other teams impacted tooFor other teams (Ops for example) it means having to deal with custom processes for some of the teams, leading to more complexity.

We usually come with new requirements and new constraints and we requires good flexibility from other teams.

But don’t worry, there is good, even great tooWe are given the opportunity to choose the technologies, the coding standards and the process we are working with without having to deal with any other teams / legacy processes.

It means working with cutting-edge technologies, taking sometimes risks but being able to change direction quickly in case of problems.

This flexibility allows us to be early adopters, even beta testers for new toolsThis liberty, when it comes to choose the technologies and to adapt the processes, allow us to be early adopters and sometimes even beta testers for new tools.

I think here about the migration to GitHub Enterprise inside Swissquote: we’ve been able to be the first team to successfully migrate our projects to it, and thus benefit from the improved tooling of GitHub and Git.

Encountering challenging problems is not so bad: it also means having to find creative solutions.

I’ve been able to contribute to some of Swissquote’s core libraries to add features that are now used by other teams.

ConclusionRepresenting a technological minority means having to solve problems that nobody has encountered or using tools that nobody else uses.

It can be sometimes cumbersome to have to struggle to use some tools that other teams uses easily, just because neither the tools, the infrastructure or the process are flexible enough.

On the other hand, it’s really challenging and offer us a real freedom to use whatever tools and technology we deem necessary.

We also have the opportunity to contribute to some of the internal tools and processes.

And last but not least: we can count on other teams to help us adapting the tools to our needs.

In my opinion, the frustrations are largely outweighed by the benefits and I’m glad to be able to represent a minority in such an environment.

.. More details

Leave a Reply