Symfony SMPP Bundle

A number of months ago I was involved in the migration of a message sending system to utilise SMPP for SMS sending. During this process I sent several pull requests through to a GitHub repository, but it appears the repository has been abandoned. This post will cover the process of forking this repository, merging the Pull Requests and submitting it to Packagist.

# The New Repository

Upon completion of this post a new repository will be available through Packagist as nibynool/SmppClientBundle and GitHub as nibynool/SmppClientBundle.

# What is SMPP?

SMPP is a protocol used for sending and receiving SMS messages. It has been developed for inter-carrier communications and as such is extremely fast.

# Timeline of Events

  • 2018-08-14 - Forked kronas/SmppClientBundle
  • 2018-09-08 - Created 5 pull requests
  • 2018-09-20 - Created 1 additional pull request
  • 2018-11-27 - Opened issue on the repository asking if the project was abandoned
  • 2019-01-28 - Began the process of forking the repository for ongoing management

# Forking the Repository

Forking a repository on GitHub has been made extremely easy.

The first step is to navigate to the source repository. In my case this is kronas/SmppClientBundle. Once at the repository click the Fork button in the top right corner. If you are a member of an organisation you will be prompted to choose to fork to the organisation or your personal account. I’m choosing to use my personal account.

A processing screen will be displayed for a few seconds and you will then be redirected to the forked repository.

# Merging the Pull Requests

Six pull requests have been opened by me on the source repository. I will document the merge process for each of these so any issues can be covered as I encounter them.

Before I can merge these PRs I need to clone my fork to my local computer. To do this I just need to run a git clone command.

git clone https://github.com/nibynool/SmppClientBundle
get checkout master

I then need to add the remote repository the pull requests were created from.

git remote add marvelig https://github.com/marvelig/SmppClientBundle

The final bit of preparation is to fetch the other fork’s history.

git fetch marvelig

# PR 1 & 2: Merges without Conflicts

From the original pull request I can the branch it was created from. I navigate to this branch on the remote repository and click the New pull request button. I then need to modify the base repository to point to my fork. I copy the original pull request into the description area and click Create Pull Request.

I can then click Merge pull request, update the commit message and click Confirm Merge.

# PR 3, 4, 5 & 6: Merges with Conflicts

As with merges without conflicts I can see what branch the pull request originated from. I follow the steps used previously, until after creating the pull request I am unable to merge it due to merge conflicts.

To resolve the merge conflicts I need to ensure I have the latest commits from my fork pulled to my computer.

git pull origin master

I then need to start manually merging the remote fork’s branch into my master branch.

git pull marvelig <remote_branch_name>

This task will be incomplete and will tell me where I have merge conflicts. I now need to resolve them (using a text editor); then stage and commit the changes; and finally push them up to GitHub.

git add .
git commit -m "<Commit message>"
git push origin

Now when viewing the pull request on GitHub we will find it is marked as Merged.

# Removing references to Kronas

Now the pull requests have been merged it’s time to remove references to Kronas (except in the README.md file and the author section of composer.json as we should always give appropriate credit).

To do this I will use my preferred IDE to perform a global search for the work kronas. Unless the use is part of a licence I will assess if it should be changed and update where required.

# Submitting to Packagist

The final step is to list the bundle on Packagist. To do this navigate to Packagist and ensure you are logged in.

In the top left corner of the site is a link to Submit. Click this and then provide the URL for the GitHub repository. Read the resulting page and if you’re happy that it is ok click the Submit button.

# Future Tasks

  • Integrate with Travis CI
  • Implement testing with PHP 7.x
  • Improve documentation