Monday, April 21, 2008

Eclipse Mylyn - Sync to PEAR

After figuring out how to tie Mylyn to Sourceforge's trackers, and learning via observation how its screen-scraping regexp worked, I moved on to configuring a Task Repository tied to the PEAR bug tracking system.

Rather than rehashing the explanations of what Mylyn elements I am configuring, this time I'm just going to provide the config settings that worked for me. Once again, my configuration points to PhpDocumentor items only, so you'd need to adjust accordingly to point to a different PEAR package.

Task Repository:
  • Server: http://pear.php.net (notice "http")
  • User ID (my own PEAR account)
  • Password
"Additional Settings":
  • serverUrl = https://pear.php.net (notice "https")
  • package_name = PhpDocumentor
  • limit (list the Parameter, but enter no Value)
  • id (list the Parameter, but enter no Value)

I have only one Task List repository query defined, which pulls all three item types in the PEAR bug tracker together (Bugs, Requests, Documentation items):
  • serverUrl = https://pear.php.net
  • package_name = PhpDocumentor
  • limit = 100 (I choose this number arbitrarily, but you want it as high as needed to ensure all bugs you want captured will appear in the one resulting webpage)
  • id (list the Parameter, but enter no Value)
"Advanced Configuration:"
The Query URL is

${serverUrl}/bugs/search.php?cmd=display&status=OpenFeedback&limit=${limit}&package_name[0]=${package_name}


The Query Pattern is

<tr valign="top" class="...">[\s]*<td align="center"><a href="/bugs/({Id}[0-9]+)">[0-9]+</a><br /><a href="[^"]*">\(edit\)</a></td>[\s]*<td align="center">....-..-.. ..:.. ...</td>[\s]*<td>({Type}[a-zA-Z]+)</td>[\s]*<td>[^<]*</td>[\s]*<td>[^<]*</td>[\s]*<td>[^<]*</td>[\s]*<td>[^<]*</td>[\s]*<td>({Description}.[^<]+)</td>[\s]*<td>.[^<]*</td>[\s]*</tr>


Contrasting this pattern with my Sourceforge pattern, you might notice that I'm capturing Type in addition to Id and Description.

Ideally, I would want to also capture a Roadmap for each item, so that I could separate items into task groups (a PEAR Roadmap equates to a plan for a particular future release version). However, doing this would require a Task Query for each task group that I wanted to make... plus, Roadmap is not a column visible on the Bug table webpage that is scraped, so it is a moot point at the current time. So, for now, having all items listed together is enough for me.

2 comments:

Philippe said...

Wouldn't using the RSS feed work better instead of scrapping the bug page?

The Nazg said...

Indeed, that would be a more controlled and reliable method. I'll have to explore that when I repeat this Eclipse setup on my Ubuntu box.