Content-Type: text/shitpost


Subject: My software had a bug
Path: you​!your-host​!ultron​!gormenghast​!hal9000​!plovergw​!shitpost​!mjd
Date: 2018-10-18T14:10:43
Newsgroup: rec.food.cooking.my-software-had-a-bug
Message-ID: <7497b61ad6bd099d@shitpost.plover.com>
Content-Type: text/shitpost

After I went to publish today's article titled “intestines” I looked at the blog and it wasn't there.

I have several plugins that could block the introduction of an article before it's ready: there might be a .notyet file in the same directory; it might have published: 0 in the article's metadata, and so on. I checked all those and everything looked fine. The article showed up properly in the test version of the blog, but when I build the static version it was never included.

I finally ran the blog software under the debugger. It was indeed selecting the “intestines” article and then one of the plugins was filtering it out. Stepping through the plugins eventually revealed which one was responsible:

package tests;

my $TEST = $ENV{REQUEST_URI} =~ m{^/test};

# Do NOT use this module when blog is in test mode
sub start { ! $TEST }

# Discard posts whose titles contain tests
sub filter {
  my ($pkg, $files) = @_;

  delete $files->{$_} for grep /test/, keys %$files;
  return 1;
}

The post was being discarded from the live version because “intestines” matches /test/. Sheesh.

I had no idea I had this plugin, which I probably wrote in 2006.