How Canaries Help Us Merge Good Pull Requests

Technical update from my colleague Alister for how WordPress.com uses automated tests for build confidence, now running for on GitHub pull requests instead of after deployment to production. The tests and webhook “bridge” infrastructure are open source just like the Calypso source code itself.

Developer Resources

At WordPress.com we strive to provide a consistent and reliable user experience as we merge and release hundreds of code changes each week.

We run automated unit and component tests for our Calypso user interface on every commit against every pull request (PR).

We also have 32 automated end-to-end (e2e) test scenarios that, until recently, we would only automatically run across our platform after merging and deploying to production. While these e2e scenarios have found regressions fairly quickly after deploying (the 32 scenarios execute in parallel in just 10 minutes), they don’t prevent us from merging and releasing regressions to our customer experience.

Introducing our Canaries

Earlier this year we decided to identify three of our 32 automated end-to-end test scenarios that would act as our “canaries”: a minimal subset of automated tests to quickly tell us if our most important flows are broken. These tests execute after a pull…

View original post 477 more words

SSH Config for Slow Connections

Via Andy Skelton in 2010, proving once again that great advice is timeless.

With these lines in your SSH config file—usually in .ssh directory in your user home directory—you’ll enjoy a more reliable remote shell session.

# Do not kill connection if route is down temporarily.
TCPKeepAlive no

# Allow ten minutes down time before giving up the connection.
ServerAliveCountMax 30
ServerAliveInterval 20

# Conserve bandwith. (Compression is off by default.)
Compression yes

Why Isn’t Open Source A Gateway For Coders Of Color?

Food for thought: Why Isn’t Open Source A Gateway For Coders Of Color?. (Via my wife, Erin.)

The Investigative Mindset

Knowing where to look for answers is more important than memorizing a set of requirements or rules.

I have a confession: I often have no idea what I’m doing.

I remember clearly what it felt like my first day at my job: I was new, overwhelmed, and maybe even scared. But the work was exciting, mind-filling, and fun. Now, several years into the role, I still feel this push-and-pull. I’ve learned to juggle these opposing feelings and be both productive and successful at my job.

The key to this—and I believe one of the most important traits for my success—is an investigative mindset. Knowing where to look for answers is more important than memorizing a set of requirements or rules.

Why? Rules and requirements change, and the context I work in is constantly changing. I’m more productive in my work by making good, informed decisions—not by the book. I can work smarter, gaining a new awareness of how everything works.

How? To develop this mindset, I exercise the following:

1. Take initiative on my own first: do the legwork to find the answer. Be tenacious and know where to look.
2. Ask questions, know when to stop looking and ask for help. Not being afraid to be ignorant or wrong.
3. Share my ideas for the better solution.
4. Look to my teammates as a critical force—we learn together.

Often, the investigation takes me out of bounds—out of my “area”—that’s OK, and natural. I talk to other people outside my team, and I learn a bit more about how it all works together. I fill in the gaps in my knowledge. I’ve raised my awareness.

It wasn’t always this clear for me … after only 3 or 4 months into being at Automattic I had a revelation that changed my mindset—put it into words. One day, I ran into a quote one of our internal P2 sites, expressed as a formula or pseudocode.

( intuition + investigation ) > memorization

I said “Yes, Yes, YES!” I was in the privacy of my home office, so no one heard me, of course. It really made sense, though. And it alleviated part of the struggle I was having to completely internalize all the things I was supposed to know and do. All the stats and bots and checklists and dos and donts.

This was later echoed by something UX guru Jared Spool said at An Event Apart:

The mindset of investigation is about informed decisions, not going “by the book.” Dogmatic, rule-based methodologies exist only to enforce things; they avoid critical thinking and good decision making.

I realized if I made good, informed decisions I could solve problems in both normal and edge cases. Instead of a one-time answer, I could build a framework to answer any question. A mentality. The outcome of finding the answer, solving the problem, sharing the solution—rewards this mindset. A loop. Doing it over and over.

This feedback loop is hugely powerful. It gives me confidence to continue to strive for an investigative mind.


Notes

1. A video my colleague Justin Shreve posted echoes this investigative mindset, specifically as it applies to software development: Being a developer is being a problem solver.

2. Thinking about investigation reminded me of my time in the Future Problem Solving (FPS) club in high school. We found creative solutions to mock issues like world hunger or renewable energy. It was fun and challenging, but the best part was the process itself. Investigate, organize, present, debate. Learn. (Random trivia: according to Wikipedia a later team from my school won a state FPS competition. Rock!)

3. One more quote: “Never memorize what you can look up in books.” —Einstein (unsourced)

Review: Forge, a Tool for Bootstrapping a WordPress Theme

Forge is a tool for quickly developing a WordPress theme built by the fine folks at The Theme Foundry.

Forge is a free command-line toolkit for bootstrapping and developing WordPress themes in a tidy environment using front-end languages like Sass, LESS, and CoffeeScript.

During the early development process of this year’s default theme for WordPress, the Twenty Twelve team—Drew Strojny and myself—used Github and Forge to build the theme (view the archived source).

I would like to share my thoughts on using Forge during this process now that the theme is back in the core WordPress environment: Subversion and Trac.

In summary: Forge is too restrictive for general theme develpoment.

Continue reading “Review: Forge, a Tool for Bootstrapping a WordPress Theme”

Change GNU Screen Keyboard Command

I changed the command character for screen from Control-a to Control-b recently, after switching to a wireless Mac keyboard. On this small, portable keyboard—which is the same layout as most Mac laptops—there’s only one Control key, and it’s on the left side of the keyboard.

The weird angle to hit Control-a was hurting my hand. Gone now is the left-side contortion I was forced to make to strike with my pinky and ring finger.

It’s pretty easy to change the command key mapping, just add escape ^Bb to your screen config file (usually located in your home directory). Here’s what my .shellrc looks like:

# Make the shell in every window as your login shell
shell -$SHELL

# Instead of Control-a, make the escape/command character be Control-b
escape ^Bb

# Autodetach session on hangup instead of terminating screen completely
autodetach on

# Turn off the splash screen
startup_message off

# Use a 100000-line scrollback buffer
defscrollback 100000

Automatic WordPress Updates with SVN

Want to keep your WordPress install up to date automatically? Follow these steps to add a cron job to update your WordPress install every 6 hours.

Set up the install

The WordPress install must be a Subversion checkout. You can grab the bleeding edge source with a command like this:

svn co http://core.svn.wordpress.org/trunk/ .

If you aren’t familiar with Subversion, start here:

Schedule the updates

Add the cron job from the command line.

  1. Edit the cron job list.
    crontab -e
  2. Add the cron job (edit the path to your WordPress install).
    MAILTO=""
    # Update WordPress install every six hours
    * */6 * * * svn up -q ~/path/to/your/wp-install
  3. Save and close.

To learn more about editing cron jobs from the command line search Google for man cron and man crontab.

You can also use a GUI tool like CronniX on Mac OS X to manage the cron jobs.

Notes

  • The -q parameter tells the svn update command to run silently so that you don’t have to worry about any output from the cron job. But, you should add the MAILTO definition if you want to completely silence output.
  • Some systems don’t recognize the */6 syntax for hourly notation. If you get an error when trying to save the cron job you might have to change it to comma-separated values instead: 0,6,12 or similar.