kaberett: A sleeping koalasheep (Avatar: the Last Airbender), with the dreamwidth logo above. (dreamkoalasheep)
kaberett ([personal profile] kaberett) wrote in [site community profile] dw_dev2016-03-30 06:32 pm
Entry tags:

Code tour, 1st March--30th March

TOURING COD. Quite a lot of cod, because this round of code tour contains most of the pull requests that were made during the contributor event at the end of February!

These will all be going live in the next code push.

Issue 717: Indicate entry security status in comment notifs for locked/filtered entries (pull request)
Patch by: [github.com profile] kaberett
Description: This is a tiny tweak to emailed notifications! Notifications will now include "(locked)" after the entry URL if, at the time the e-mail was generated, the entry you're being notified about (whether it's a new post or a new comment on a parent post) was locked (or posted to a custom access filter, as the case may be). Why? Well, [staff profile] denise kept being confused about why she was being shown the "You do not have permission to view this entry" screen, and eventually realising that it was because she was logged into the wrong account.

Issue 1465: Fixes #1465 remaining parts
Patch by: [github.com profile] cesy
Description: Issue 1465 related to the fact that the admin console reference page didn't list which privs were required for which commands (for example, to grant privileges to another user account the priv you need is admin); a few got missed in a previous pass, so this fix makes it so that all the commands have necessary privs listed.

Issue 1546: bonus_icons console command could use an 'xfer' param (pull request)
Patch by: [github.com profile] kaberett
Description: If you've bought bonus icon slots, it's possible to transfer them between accounts -- and over the past few months there's been a small but noticeable uptick in the number of users asking to transfer icon slots between accounts. Which is fine, and not a problem, except that [staff profile] denise was having to manually subtract the slots from account A and then manually add them to account B; this new command combines those steps into a single command, for less typing and less potential for human error!

Issue 1602: Clarifying automated test comments (pull request)
Patch by: [github.com profile] cesy
Description: Comments, in code, are bits of text that can't be executed, and exist to help people interacting with that code understand what it's trying to do. Tests exist to make sure that your code does what you want it to when you make changes. Some of the comments describing what some of the tests were supposed to do were... wrong. Very, very wrong. In the sense that they claimed that the test was supposed to do the exact opposite of what it... actually... did. This had (please note the understatement) the potential to be a touch confusing, so [personal profile] cesy Fixed The Problem.

Issue 1623: Country lists include two United Kingdoms with identical text (pull request)
Patch by: [github.com profile] kaberett
Description: ... okay. So. You can, if you choose to do so, display your location in your profile. You select your location from a drop-down list of countries, which is pre-populated from a list maintained by Someone Else. This was fine, and great, until Dreamwidth changed which source list it used, which meant that the UK changed from being recorded in the database as "UK" to being recorded in the database as "GB". To make sure that location display in profiles didn't break for people who'd selected the UK prior to the changeover, [github.com profile] afuna told the codebase that "UK" meant the same as "GB"... which in turn meant that the UK then showed up twice in the drop-down list of countries. There is only one UK. We do not need two of them. The list will, as of the next code push, not offer you a confusing choice between two identical countries.

Issue 1626: Quick reply pluralisation is incorrect when going from 0 to 1 and 1 to 2 comments (pull request)
Patch by: [github.com profile] sgsabbage
Description: Quick*Reply is the thing that lets you click "reply" on your reading page, type in a comment, leave it, and then keep on scrolling without ever leaving said reading page... but it turned out to be a little tricksy to update the comment count link when going from zero comments to one comment, and from one comment to two comments. [github.com profile] sgsabbage is, much to his horror, rapidly becoming The Local Expert on how Quick*Reply works; he's made it so that comment counts in these weird edge cases behave correctly, so you'll no longer end up with "1 comments" or "2 comment" being displayed. It involves Javascript and the Styles system.

Issue 1630: Dev suggestion: Allow DW-based sites to disable anonymous (logged-out) support requests (pull request)
Patch by: [github.com profile] Sophira
Description: I AM SO EXCITED ABOUT THIS ONE THAT I CANNOT EVEN, FOLK. Because, right, there's this problem on the internet, and it is called Spammers. It turns out that if you have a Dreamhack up and running, Spammers Will Probably Find It. Spammers will proceed to open approximately one million anonymous Support requests, that are entirely spam, which fires off approximately one million e-mails letting you know that new (spammy) Support requests have been filed (by spammers) in your development sandbox. And, okay, in my case it was actually only 11000, but (1) eleven thousand is a BIG NUMBER, okay; (2) it meant that it took upward of thirty seconds to load my Dreamhack's Support board while testing some fixes relating to it; and (3) it is in general a Bad Idea to teach e-mail providers that e-mails from Dreamhacks are spam. All of which is to say that I am enormously and eternally grateful to Sophie for this one -- which disables anonymous Support requests, and means that I am getting MUCH LESS SPAM.

Issue 1637: Fix atom feed test (pull request)
Patch by: [github.com profile] cesy
Description: A test -- see above -- was never being run, in the sense that it was deliberately being prevented from being run during testing, because it failed. It failed because it was asserting that the correct behaviour was nothing even a tiny bit like what Dreamwidth has... actually... been doing, for the past six years, which is what is known technically as A Pity. [github.com profile] cesy made the entirely-reasonable-under-the-circumstances assumption that how the site's been behaving is how the site's supposed to behave, and has updated the test accordingly, so that if the dev team does manage to break feeds at any point they will actually notice straight away. (... in theory. If they run the tests. ;) )

Issue 1641: Clarify extradata options on entry success (pull request)
Patch by: [github.com profile] kaberett & [github.com profile] kareila
Description: The "congrats you posted an entry!" page will now be EVEN MORE detailed. If you posted to a custom access filter or filters, it will tell you which; and if you're posting to a community it will now correctly reflect that you're posting to a community in terms of the language used (which I... missed, completely, in my last set of edits, oops). And then I complained to [github.com profile] kareila that there was a lot of code that did exactly the same set of things but was written differently depending on whether you were creating or editing an entry, and she very kindly refactored the wretched thing, i.e. made it so that the same code gets used everywhere. This is brilliant because it means that any future changes to this page will have to be made in fewer places, which massively reduces the chances of people, er, forgetting things. So that's more information, and easier upkeep: wins all round!

Issue 1651: Quick*Reply on non-reading-page views needs to update comment count (pull request)
Patch by: [github.com profile] sgsabbage
Description: The asterisk in Quick*Reply is a wildcard -- QuickReply itself is the thing that lets you comment directly from an entry page, instead of having to open up the ?mode=reply page, and at the last few contributor weekends we ended up getting a bit bogged down in how to refer to the version of QuickReply that lets you comment directly from your Reading Page or from journal pages. QuickerReply? QuickestReply? ... QuicksandReply, says [personal profile] sgsabbage, a little helplessly and sinking fast? So! Quick*Reply it is. This is the same thing as 1626 above, except 1626 got filed when Quick*Reply only happened on Reading Pages, and then it got rolled out to journal pages too. Correct comment counts everywhere!

Issue 1657: Quick Reply: clicking on Browse icons posts comments (Recent page) (pull request)
Patch by: [github.com profile] sgsabbage
Description: Clicking on "Browse icons" is not supposed to post your comment; it is supposed to let you choose which icon you want to use. Soon it will. This is, and again this is a technical term, An Improvement.

Issue 1669: Page title for viewing custom access filters uses filter number not name (pull request)
Patch by: [github.com profile] kaberett
Description: If you have custom access filters, you can filter your journal page to show only posts made to a specific filter. However, the page title was then something utterly uninformative -- "kaberett | (16)", or whatever, where the number in brackets is the filter number for database purposes. This patch means that the page title will instead be "username | filter name", matching what happens when you filter your reading page by subscription filter, which is Rather More Helpful.

Issue 1674: add DeviantArt to profile list (pull request)
Patch by: [github.com profile] srukle
Description: This one got requested on Twitter! You'll soon be able to add your DeviantArt name to the "Other Services" section of your profile.

Issue 1675: Remove duplicate "about" from Support views (pull request)
Patch by: [github.com profile] kaberett
Description: To my intense embarrassment, it took me several years of Support volunteering to spot that the helpful hints about how to write replies included "There's no HTML allowed, so don't worry about about escaping < and >", emphasis mine. This incredibly tiny tweak just removes that second "about", for greater readability but honestly mostly just so that it won't bug me now I've noticed.

Issue 1692: Logging out from community settings gives error, but only on Dreamhacks (pull request)
Patch by: [github.com profile] kareila
Description: This one just affects the Dreamhack service! Dreamhacks are individual instances of the Dreamwidth codebase that developers can use to test changes before said changes get applied to the live site, which hopefully reduces the number of errors that you end up having to deal with (having said which I managed to epically break profile pages for five minutes during a code push last June, before someone spotted and fixed it). Turned out that if you were logged in to a Dreamhack, and doing community admin, and then you logged out, you'd get an error page -- which is not what happens on Dreamwidth proper. As it's generally a good idea for test environments to be as close as possible to the live site, this... makes test environments behave more like the live site!

Issue 1708: Wow that is not okay language in comments (pull request)
Patch by: [github.com profile] me-and
Description: Code comments, as above, exist to help developers understand why code's been written in a particular way. Unfortunately, comments have not always been written in a way that's... actually kind, or inclusive, or at all okay. I spotted some racist language while working on a bug and replaced it with less wildly inappropriate language; [personal profile] me_and did the logical next step of searching the rest of the codebase to see if any other comments included that kind of terminology, and put in a pull request that actually got rid of all instances. So. That's a thing.

Issue 1711: Some JS being served over HTTP not HTTPS on Create Entries page? (pull request)
Patch by: [github.com profile] kareila
Description: Some Javascript was indeed being served over HTTP not HTTPS on the Create Entries page! HTTPS is more secure and makes for safer browsing; the web's increasingly moving to using HTTPS everywhere. There was absolutely no good reason to be providing that particular bit of JS over HTTP instead of HTTPS, thus making the page in question less secure, not least because it was also being served over HTTPS. This removes the HTTP-flavoured version for a higher-security browsing experience. (Want to know more about HTTPS Everywhere? Here's the Electronic Frontier Foundation on the topic.)

Issue 1715: E-mailed Support notifications do not include referenced FAQs (pull request)
Patch by: [github.com profile] kaberett
Description: Well, actually they did - *provided* you were the person who'd submitted the Support request. However, if you were a Support volunteer who'd asked to be notified when people left answers to requests, there would be no indication at all if a FAQ had been formally referenced, unless the answer happened to make a mysterious mention of "the attached FAQ". This patch means notifications will now include the title and link for any FAQ that's referenced, so volunteers' notifications make sense without clicking through!

Issue 1720: new function LJ::Talk::init_s2journal_js (pull request)
Patch by: [github.com profile] kareila
Description: More refactoring! There was a lot of repeated Javascript in the code that generates journal and reading page views, relating to how to display cut tags, Quick*Reply, and the icon browser. This bundles it all up neatly into one place, so there's less repetition: consequently making changes to how any of these features behave in future will be much easier and much less likely to leave something out accidentally.

Issue 1723: Some http:// image URLs not being run through the image proxy (pull request)
Patch by: [github.com profile] kareila
Description: Some embedded images, particularly in posts to feed accounts, weren't displaying -- because of the precise nature of how they were being embedded. This fixes that, so images should (... hopefully!) start showing up consistently again!

Issue 1726: Ablism patrol in comments (pull request)
Patch by: [github.com profile] azurelunatic
Description: After spotting the racism in code comments, it occurred to Azz that there might be some other common and less-than-ideal language other places in the codebase. So they did a search, and got rid of a bunch, and It Was Good.

21 total issues resolved
Contributors: [github.com profile] Sophira, [github.com profile] azurelunatic, [github.com profile] cesy, [github.com profile] kaberett, [github.com profile] kareila, [github.com profile] me-and, [github.com profile] sgsabbage, [github.com profile] srukle
azurelunatic: A glittery black pin badge with a blue holographic star in the middle. (Default)

[personal profile] azurelunatic 2016-03-30 06:08 pm (UTC)(link)
With a bonus of replacing one all-caps, easy-to-spot bit of text which was *meant* as a FIXME flag with an actual FIXME, so it wouldn't get missed when someone was wandering around searching on the strings FIXME and TODO when searching for bits of cod that could be optimized.
azurelunatic: A glittery black pin badge with a blue holographic star in the middle. (Default)

[personal profile] azurelunatic 2016-03-30 07:54 pm (UTC)(link)
does this mean
a particularly large/difficult tour
is a

:D :D :D
srukle: (Default)

[personal profile] srukle 2016-03-30 08:23 pm (UTC)(link)
Ah, good CODE review. ;-)
Edited 2016-03-30 20:23 (UTC)
srukle: (woah)

[personal profile] srukle 2016-03-30 10:56 pm (UTC)(link)
Thank you for sharing this. xD
brainwane: My smiling face, including a small gold bindi (Default)

Much thanks!

[personal profile] brainwane 2016-03-31 01:25 am (UTC)(link)
I am always a fan of HTTPS-related improvements. And the "Page title for viewing custom access filters uses filter number not name" improvement makes me happy, as do the language improvements for code comments. And

There is only one UK. We do not need two of them.

made me smile.
sporky_rat: A Giant Sta-Puft Marshmallow Man cruisin' down the street in NYC (campfire time!)

[personal profile] sporky_rat 2016-03-31 03:56 am (UTC)(link)
I do say, I thoroughly enjoy when [personal profile] kaberett does a code tour. Informative, fun and easy to read.

Excellent drive through the code country, today, Kab. :D
misskat: A bunch of minions from Despicable Me in heart formation (Minion Heart)

[personal profile] misskat 2016-03-31 01:32 pm (UTC)(link)
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2016-03-31 02:07 pm (UTC)(link)
misskat: Guy in 1780's clothes, point at his horse. text: get on my horse (Get on my horse)

[personal profile] misskat 2016-03-31 03:08 pm (UTC)(link)
I run on coffee and spite, and I am all out of coffee.
misskat: Picture of Kat with black plastic frames (Default)

[personal profile] misskat 2016-03-31 03:05 pm (UTC)(link)
Because I'm the PRESIDENT.


(I am Hercules Mulligan.)
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2016-03-31 03:09 pm (UTC)(link)

They knock you down, you get the fuck back up again?

misskat: Picture of Kat with black plastic frames (Default)

[personal profile] misskat 2016-03-31 05:01 pm (UTC)(link)

I'm the SPY on the INSIDE.

woggy: Dom (from the webcomic Megatokyo) talking on a phone (Dom)

[personal profile] woggy 2016-04-01 02:45 pm (UTC)(link)
holy cow, refactoring cod around 1641. win.

(i noticed a bit of duplication when i was poking around those bits but didn't trust myself not to Break Everything, so. yay kar!)
jewelfox: A portrait of a female anthropomorphic fox, with a pink jewelled pendant and a cute overbite. (Default)

[personal profile] jewelfox 2016-04-03 07:54 pm (UTC)(link)
Awesome <3

Question: When you say "soon," do you mean "when the code push goes live," or is there more work that needs to be done on stuff like the DeviantArt links?
azurelunatic: a bunch of grapes on the vine (grapevine)

[personal profile] azurelunatic 2016-04-03 10:08 pm (UTC)(link)
When the code push goes live. (Historically, the trouble with saying stuff like "which should be Wednesday at 3am!! :D" has been, someone's baby gets sick or someone has a surprise party thrown on them, and the code push gets pushed off to a better time...) Usually stuff which has more work yet to be done either doesn't get added to the code tour & release until it's all done, or gets split up into multiple tickets and the code tour guide mentions the ticket that's got the pending work in case someone feels ~inspired~. ;)