How I broke Dev.to on my First PR

Benny Powers 🇮🇱🇨🇦 - Sep 17 '18 - - Dev Community

Today I made my first PR to dev.to, which lets you add options to glitch embeds. I struggled to install the requirements and build the app, wrote unit tests for the new features, learned my first bits of ruby, and after a few hours of playtime, submitted the PR. It was quickly accepted, ✨THANKS, @ben!🌟

That's when I noticed that every single glitch embed on the entire site was broken

🤦‍♂️

Thanks to @rhymes, for pointing the problem out:

I think there's a bug somewhere, because now if I try to embed this:

glitch.com/edit/#!/familiar-violet

with {% glitch familiar-violet %} or {% glitch familiar-violet app %} I get the 404 page

glitches

a glitch indeed :P

The solution was as face-palmy as the bug itself: I left out the # which designates an interpolation in ruby strings:

-    src={@uri}
+    src=#{@uri}
Enter fullscreen mode Exit fullscreen mode

A fun learning exercise for me. I sincerely hope that my oversight didn't cause any inconvenience.

New PR is in flight, once the fix is live I'll write a regression test.

https://github.com/thepracticaldev/dev.to/pull/683

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player