| Summary: | support searching for reviews by abbreviated and full hash | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Alex Blewitt <alex.blewitt> |
| Component: | Mylyn | Assignee: | Steffen Pingel <steffen.pingel> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | kevin, matthias.sohn, sascha.scholz |
| Version: | 0.8 | ||
| Target Milestone: | 0.9 | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Alex Blewitt
In fact, it seems that it only finds it if you have previously got the task loaded. I found that if I looked for Ia659100f then it wouldn't show up, despite being in the remote repository but not previously loaded. (The error message is Invalid {{ID}}, running against Gerrit 2.1.7)
Mylyn Reviews is another product Thanks for the bug report Alex. The connector only supports searching by numeric ID. I agree that it should also allow searching by shortened and full hash. Ah, so the concept of numeric ID in Gerrit doesn't really make sense. The command lines deal with a numeric value, but that's a sequence number which is related to the changes as they were appended rather than an identifer per se. It exposes itself in the 'git fetch' e.g. "git fetch http://localhost:8080/p/test refs/changes/19/19/1 && git checkout FETCH_HEAD" but otherwise isn't really known about. So this should be an enhancement for finding by other means, including the (abbreviated) hash. Note that if the string was passed as is to Gerrit, then Gerrit could figure it out, rather than having a task ID finder in Mylyn which uses the (internal) reference. It may make sense to key the change by its full Change-Id, rather than numeric id, for its references in Mylyn. As we move from a post-SQL world, I'm not even sure that unique numeric ID will stay around - but you could probably find out from Shawn if there are any plans in that direction. Yes, we may end up having to abandon the numeric ID altogether since it has been deprecated and may go away entirely at some point. In Gerrit 2.1.x, the API still uses it to identify changes but that is bound to change. Sascha, do you happen to know in which Gerrit release hashes will entirely replace numeric IDs? I don't know when (and if at all) the deprecated numeric id in Gerrit will be removed. I think we should support both numeric id and the I-key in the search. I have added support for looking up the id from the hash in GerritClient.getChange() in ba465ea4caca4f5479eb8d8085af0319d4394f20. It is now possible to open reviews by full change-id. Unfortunately Gerrit does not support searching by abbreviated change-id so we are not able to support this on the client until that's fixed: http://code.google.com/p/gerrit/issues/detail?id=1101 (In reply to comment #8) > Unfortunately Gerrit does not support searching by abbreviated change-id so we > are not able to support this on the client until that's fixed: > http://code.google.com/p/gerrit/issues/detail?id=1101 This is not true. Go into Eclipse EGit (http://egit.eclipse.org) and put 32d6035 in the search field. You will be taken to commit 32d6035f091040c1f0b96ccba369eb755eb8c7c5 Alex (In reply to comment #9) > (In reply to comment #8) > > Unfortunately Gerrit does not support searching by abbreviated change-id so we My mistake, I thought this was for abbreviated commit, not just the change ID. I agree that for the change ID it does not support partial strings. (In reply to comment #8) ... > Unfortunately Gerrit does not support searching by abbreviated change-id so we > are not able to support this on the client until that's fixed: > http://code.google.com/p/gerrit/issues/detail?id=1101 AFAIK this depends on the underlying database platform, I just tried and found it works on postgres and doesn't work on MySQL Interesting. I have added a note to the Gerrit issue. Alex, as a side effect of the change you should be able to open Gerrit reviews by commit ids now as well (it works for any query string that returns a single result). |