DEV Community

loading...

How I broke Dev.to on my First PR

bennypowers profile image Benny Powers 🇮🇱🇨🇦 ・1 min read

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

Discussion

pic
Editor guide
Collapse
ben profile image
Ben Halpern

Ah crap. I did not review this carefully enough. Merging the fix.

Collapse
bennypowers profile image
Benny Powers 🇮🇱🇨🇦 Author

no biggie. < 30 minute turnaround for the hotfix is pretty good, i'd say. Thanks for the merge !

Collapse
citizen428 profile image
Michael Kohl

What editor are you using? These two should highlight differently, which makes it a lot easier to spot mistakes like this one:

vscode highlighting

Collapse
bennypowers profile image
Benny Powers 🇮🇱🇨🇦 Author

Totes. I've got a fairly intense atom setup including Ruby highlighting. Thing about cognitive load is that the error could be literally right in front of your eyes and right under your fingertips and you still might not catch it.

Collapse
codingmindfully profile image
Daragh Byrne

Respect for your ownership of this! I'd rather work with someone who made mistakes and owned up to them than someone who never tried things.

First week on one job I made a mistake that was released to production by my line manager, ended up costing the company $100k or so... reviews are important!

Collapse
rachelsoderberg profile image
Rachel Soderberg

Haha, nice job! I've missed a good number of similar characters - when it happens I remember the advice my manager gave me "The longer you stare at a problem, the smaller it is".

Yesterday I could not figure out why I couldn't update to a certain SQL table. Turns out SalesOrderId "108110" is very different than the "180110" I was attempting to query. When I asked him for his input, all he did was repeat the query back to me and I immediately realized I was a goof. :)

Collapse
bigj1m profile image
Jim Plourde

Errors happen. Usually that's what review are for, catching bugs before release. It's not entirely your fault if it went live ;)

Collapse
bennypowers profile image
Benny Powers 🇮🇱🇨🇦 Author

Totally. I'm grateful for the chance to work in the open and participate in transparent, blameless post-mortems. That's the future of working relationships, and what better place is there to practice it than here?