Friday, June 29, 2007

Re: Atom Protocol Exerciser (Ape) setup notes

Note: I had intended to post the first part of this on his blogDave Johnson's blog as a comment, but it rejected me twice. Apparently I write like a spammer.

That was a lot more complicated that I had expected; makes me wonder if I'm the first person (other than Tim, of course) to deploy the APE.

I deployed it locally a few months ago, while debugging my Atom protocol plugin for Trac. During that time, I wrote up some implementation questions (which Tim graciously answered) and the method I used to run it.


Incidentally, lately I was tweaking my particular implementation since Tim Bray had recently updated the APE to be compliant with the latest revision of the specification. My shebang line for go.rb changed from #!/bin/bash /usr/bin/jruby to #!/usr/bin/env jruby. It's still working fine, even if it's still a little slow.

I need to figure out how to fix some of the errors that I get. For instance:

18. ? Client-provided slug 'ape-61911' not used in server-generated URI.

I have no idea how to fix this. When I get a valid Slug header, I use it verbatim:

To server:
GET /trac/atom/wiki/ape-61911 HTTP/1.1\r
Host: localhost\r
Accept: */*\r
\r

Perhaps the following line is confusing the APE:

Location: http://me.malept.com/trac/xmingw/atom/wiki/ape-61911\r

Additionally, apparently my plugin currently has some problems with the new multi-post app:edited test, but so far I think it's something wrong in my code as opposed to being a bug in the APE. I'm going to try to take a look at it tonight.

5 comments:

Tim said...

Don't know why ongoing thinks you're a spammer. Sorry.

Anyhow, two things could be causing the slug problem. (a) the Ape looks not in URL of the atom entry, but in the public-facing URL (if that's different), usually found in link rel="alt" (or just link with no rel); the slug is for the benefit of the outward-facing version. (b) JRuby regexes, pre 1.0, are a bit buggy, so the Ape could just be wrong. Test by running under Ruby not JRuby.

Mark said...

Oops. I guess I should have been more specific. I was posting a comment on Dave Johnson's weblog, and even though I (think) I answered the addition question correctly, it rejected my comment twice. I'll fix that in my main post in a sec.

Mark said...

Tim said: (using un-semantic HTML because Blogger comments suck)

(a) the Ape looks not in URL of the atom entry, but in the public-facing URL (if that's different), usually found in link rel="alt" (or just link with no rel); the slug is for the benefit of the outward-facing version.

Shouldn't that be link[@rel="alternate"]?

Mark said...

Update: fixed the link[@rel="alternate"] bug - see comments.

Susan said...

If you're looking for the best Things to do in the world, this list has something for everybody! From adventure to culture, food to history .