0

I'm trying to monitor user commit activity (initial change commit or patching) in Gerrit using REST API.

Right now I have a working example that gets all changes per user using:"changes/?q=owner:" and lists one change for each user based on the latest change created date. The problem is that this method misses two things:

  1. If a user commits a patch on a change created by the user itself, but on a different date compared to created date, this activity will not be caught.
  2. If a user commits a patch on a change created by another user, this activity will not be caught. Worst case for this is that we have a user that never commits any own new initial changes, just working with patching other users initial changes.

Instead I would like to create a query in Gerrit like “give me all activities for user joe” and the look through the result for latest initial commit or patch activity.

Can this be done?

Peder
  • 157
  • 1
  • 1
  • 9

2 Answers2

1

Try to use "changes/?q=committer:xxxxx" instead:

committer:'COMMITTER'
    Changes where 'COMMITTER' is the committer of the current patch set.

See more info in the Gerrit documentation.

0

Thanks Marcelo, you pointed me in the right direction. But I found that "owner" and "author" often is the same. But "committer" was the one that I needed. This catches both my number 1 and 2 issue!

Also if you want the commit date you have to add some options to your query:

changes/?q=committer:<USERID>&o=CURRENT_REVISION&o=CURRENT_COMMIT
Peder
  • 157
  • 1
  • 1
  • 9