Alex headshot

AlBlue’s Blog

Macs, Modularity and More

Google Code and Mylyn redux

2009 Howto Eclipse Objectivec

Having followed Alex Ruiz’ entry on getting Mylyn to work with Google Code, I thought I’d give it a shot with ObjectivEClipse. The instructions work almost, but not quite, exactly the way you’d want them to. So here for the benefits of all time (i.e. when I next re-install Eclipse), here’s how to get it working.

First up, download and install Mylyn into your Eclipse 3.4 instance, from the update site. You’ll need the “Mylyn Features”; specifically the “Mylyn Task List” and the “Mylyn Focussed UI”. You’ll also need to install from the update site the “Mylyn Incubator” to bring in the “Mylyn Web Connector (Advanced)” although you can select just that one instead of all incubating components.

Just a few restarts later, you’ll have an empty Eclipse task system, just waiting to be populated with all your issues. However, we’ll have to configure it to admit the ObjectivEClipse bugs first.

From the “Task Repositories” view, right-click (or control-click for any unibutton mice out there) in the “Task Repositories” view, and select “Add Task Repository”. It should show you “Bugzilla” and “Web Template (Advanced)” in the list. For Google Code, we want the latter. Clicking “Next” takes you to the mother of all configuration dialogs, plus probably her offspring and some of their friends that they’ve invited over. It ends up looking like this:

Of course, typing that in (unless you happen to have very good OCR software, or good eyes) is going to be a challenge, so here’s the new-and-improved copy-and-paste version of the dialog.

  • Server:
  • Label: ObjectivEClipse — or whatever you want
  • User ID: — from your google account
  • Password: ******* — this is your password, not your google account password
  • Parameter: search (no value)
  • Parameter: can (value 2)
  • Task URL: ${serverUrl}/detail?id=
  • New Task URL: ${serverUrl}/entry
  • Query Request URL: ${serverUrl}/csv?can=${can}&colspec=ID+Status+Type+Owner+Summary&q=${search}
  • Query Pattern: ^"({Id}[0-9]+?)","({Status}.*?)","({Type}.*?)","({Owner}.*?)","({Description}.*?)"$

But hang on, you’re thinking … this is pretty much exactly what Alex wrote, right? Well, yes and no. Firstly, the pattern uses .*? instead of .+? in some key places, which means that it works when you don’t have owners assigned etc.; and secondly it matches on a per-line basis rather than random whitespace at the end (which means lines don’t run into each other). Oh, and the hyper-observant of you will have noticed that can=2 too, which only returns open bugs instead of open-and-closed bugs.

So far, so good. Pressing “Finish” gets us the ObjectivEClipse task repository, and from there, we can right- (control-) click on the task repository to add a new query (or new task, if you’re feeling like you want to contribute). The query dialog brings up the “search” parameter we added earlier - you can either leave that blank to get all (open) tasks, or you can click on “edit” and fill in a value for the search parameter, like owner:alex.blewitt, or status:started, or type:enhancement, or whatever else that advsearch throws your way. You can even combine them e.g. type:enhancement milestone:0.2 if you really want.

The can parameter has some fairly arbitrary values, but correspond to the drop-down lists you get from the issue tracker:

  1. All issues
  2. Open issues
  3. Open and owned by me
  4. Open and reported by me
  5. Open and starred by me
  6. New issues
  7. Issues to verify

Using the default query, as above, will get you all open issues. (You can use can=1, search=isnot:open if you just want to see closed items, or can=1 to see all open and closed items.) Here’s a list of what’s supported, and what they mean, courtesy of the search operators:

  • summary:
  • description:
  • comment: Text search of just those sections
  • reporter:
  • cc:
  • commentby:
  • owner: The google account userid, or the special value me as a synonym for yourself
  • status: Corresponds to the status labels, e.g.
    • New
    • Accepted
    • Started
    • Fixed
    • Verified
    • Invalid
    • Duplicate
    • WontFix
    • Done
  • is:open and isnot:open: Short-hand operators for status types; note that can>1 effectively have is:open
  • label: Searches for a label with the given tag
  • tag:value Searches for a label tag-value e.g. Milestone-0.2 becomes Milestone:0.2 in the search. Note that this is equivalent, but shorter, to label:Milestone-0.2.

The tag:value is especially handy, because you can add any kind of labels you want to a project and can search on them easily. For example, priority:medium and type:enhancement are both variants of label:priority-medium and label:type-enhancement respectively.

Note that you can combine searches; they form a logical ‘and’ together (so owner:me priority:high just gives my high priority items). If you want to have either me tasks or high priority ones, you can use owner:me OR priority:high. For some reason, the case of OR is important - type it as or and you don’t get anything at all.

So, having exhaustively covered how to use this within the context of ObjectivEClipse, please hook it up and give it a go. Of course, the same technique works the same for other projects (e.g. EGit) hosted at Google Code; you just need to change the ${serverUrl} and the description, and you’re away!