Code never lies — Creating reproducibles for any programming language

Sven Efftinge
Nov 29, 2018 · 4 min read

Whenever you want to share a reproducible example on StackOverflow or an issue report, providing real code that can be quickly tried, executed and explored is the best you can do. Online code playgrounds, such as CodePen or JSFiddle, are an excellent way to do that, as they are very accessible for both the creator and the readers. Unfortunately, they are not available for every programming platform, language and often don’t work for larger projects or examples.

Image for post
Photo by Hannah Jacobson on Unsplash

In this post I’d like to introduce you to a new feature in Gitpod, that lets you create reproducible examples for any programming environment and any size of project.

New in Gitpod: Snapshots

No matter what state your Gitpod workspace is in, taking a Snapshot captures everything and provides you a link to share anywhere: on issues, forums (StackOverflow), emails and blogs. Anybody who clicks on a snapshot link instantly gets an exact copy of that workspace, including any uncommitted file changes and the UI layout.

Let’s go through an example.

Spring Boot Example

I went over to spring-boot and picked the first issue in the list:

The issue has a detailed description on how to reproduce the problem. It even has a link to a GitHub repository containing the code! So the author did a lot to make it easy for the maintainers to reproduce the issue and figure out what’s wrong.

However, instead of laying out the steps in prose, an automated solution would be much better. A snapshot would have reduced this to a single click for the maintainers, and the author wouldn’t have to write a lengthy explanation.

Take a Snapshot

Before we are taking the snapshot, we want to make sure everything is in the state we want it to be. So the maintainers get pointed to the culprit immediately. For this example I made sure

  • the build ran through,
  • the right editors are opened
    (I choose to open the two files mentioned in the issue in split mode),
  • the sample application is started automatically

Taking care of the first two items is easy. For the third, you need to add a .gitpod.yml to the root of the project containing the tasks you want to start.

In the case of this project I added a task to start the failing Java process:

- command: >
mvn -q exec:exec \
-Dexec.executable=java \
-Dexec.args=”-cp %classpath com.example.beanoverriding.EmbeddedApplication” \

Btw. to figure out how to start that damn thing using Maven, I had to ask the community on StackOverflow. Of course, by providing a Gitpod Snapshot :-)

With the .gitpod.yml configured and the editors and views laid out as needed, we are ready to take a snapshot. Simply click on the avatar on the top right:

Image for post

Pick “Share Workspace Snapshot” and copy and share the link or one of the snippets in the opened dialog:

Image for post

Here’s the snapshot link for you to try:


Gitpod Snapshots are a very convenient way to create and consume large and small examples for any programming language and platform. Make sure to check out the documentation, which goes into more detail on the options available.

We think snapshots are not only great for reproducing issues or showing solutions and examples, but very useful in other situations. Preparing workshops and tutorials should be super convenient with snapshots, as it will free your audience from any tedious setup procedures. We are looking forward to learning about all the creative ways you will put this feature to use. Please let us know and have fun!


Gitpod - Online IDE for GitHub

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store