Search code examples
pythonrestgerrit

How to get all the changes for a particular project, branch with start date and end date


I want to get all the changes from Gerrit using Gerrit rest API given

  1. REPO name
  2. branch name
  3. start date - the date from which I want the review.
  4. end date - the date till which I want the reviews from the start date.

so far I have tried this:

rest = GerritRestAPI(url=gerrit_url)
changes = rest.get('projects/{project name}')

but this is giving me the project information but I want the changes.

I want something like this

changes = rest.get('projects/{project name}/branch/{branchname}/startdate/{startdate}/enddate/{enddate}')

Please help me with this.


Solution

  • Use the following:

    changes = rest.get('changes/?q=project:{projectname}+branch:{branchnme}+after:{startdate}+before:{enddate}')