Refreshing the OpenStreetMap Codebase

The codebase that powers OpenStreetMap is older than any other Rails project that I work on. The first commit was in July 2006, and even then, that was just a port of an existing pre-rails system (hence why you might still see it referred to as “The Rails Port”)

It’s a solid, well-tested and battle-hardened codebase. It’s frequently updated too, particularly its dependencies. But if you know where to look, you can see its age. We have very few enduring contributors, with is surprising given its key position within the larger OpenStreetMap development community. So I’ve been taking a look to learn what I can do to help.

OpenStreetMap-website Contributions

For someone just getting started with Rails, they’ll find that many parts of our code don’t match what’s in any of the books they read, or any the guides online. More experienced developers will spot a lot of things that were written years ago, and would nowadays been done differently. And for some of our developers, particularly our Summer of Code students, they are learning what to do by reading our existing code, so our idiosyncrasies accumulate.

I started trying to fix a minor bug with the diary entries and a bunch of things struck me as needing a thorough refresh. I started the process of refactoring the tests to use factories instead of fixtures – 2 down, 37 to go. I’ve started rewriting the controllers to use the standard rails CRUD method names. And I’ve made a list of plenty of other things that I’d like to tackle, all of which will help lower the barrier for new (and experienced) developers who want to get stuck into the openstreetmap-website code.

I hope that progress will snowball – as it becomes easier to contribute, more people will join in, and in turn help make it even easier to contribute.

But it’s time-consuming. I need help to share these projects around. If you’re interested, please get stuck in!

6 thoughts on “Refreshing the OpenStreetMap Codebase

  1. Mikel Maron

    Andy, love the invitations are insights you’re making here for the rails app, and for the OWG. Have anything in mind for SotM, like a BoF to onboard more developers, or focus on hitting some of these issues?

  2. Andy Post author

    Hi Mikel – I’m definitely interested in helping anyone at SotM next week who wants to get involved in these topics. Whether that’s a BoF, or in the Sunday workshops, or even just the hallway track – I’m all ears.

  3. Komяpa (@komzpa)

    Looks to me that thing that begs for refactoring the most is DB schema – we’re in 2016, hstore been around for a while, jsonb is standard in Postgres setup – yet rails_port still keeps all the tags separated from the object, wasting the disk round-trips and index searches.

  4. Pingback: weeklyOSM 322 | weekly – semanario – hebdo – săptămânal – haftalık – 週刊 – týdeník – edisi

  5. Pingback: Steady progress on the OpenStreetMap Website | Gravitystorm Blog

  6. Pingback: Factory Refactoring – Done! | Gravitystorm Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s