https://bugzilla.wikimedia.org/show_bug.cgi?id=45090

       Web browser: ---
            Bug ID: 45090
           Summary: Gerrit REST API's changes module doesn't support
                    offset
           Product: Wikimedia
           Version: wmf-deployment
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Git/Gerrit
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: b...@mzmcbride.com
                CC: innocentkil...@gmail.com, rlan...@gmail.com,
                    wikibugs-l@lists.wikimedia.org
    Classification: Unclassified
   Mobile Platform: ---

I'm trying to gather metadata about every Gerrit changeset.

I read <https://gerrit.wikimedia.org/r/Documentation/rest-api-changes.html>,
which states "If the n query parameter is supplied and additional changes exist
that match the query beyond the end, the last change object has a
_more_changes: true JSON field set. Callers can resume a query with the n query
parameter, supplying the last change’s _sortkey field as the value."

Here's what I tried:

---
$ curl -s "https://gerrit.wikimedia.org/r/changes/?q=age:1second&n=500"; | tail
-20
    "project": "mediawiki/extensions/Polyglot",
    "branch": "master",
    "topic": "tidyup",
    "change_id": "I35ebc242fcf04e5b527631d6be67d1a8c78ef251",
    "subject": "Add method parameter documentation",
    "status": "NEW",
    "created": "2013-01-24 18:41:09.000000000",
    "updated": "2013-01-24 21:44:15.000000000",
    "_sortkey": "0022a6180000b1ff",
    "_number": 45567,
    "owner": {
      "name": "Reedy"
    },
    "labels": {
      "Verified": {},
      "Code-Review": {}
    },
    "_more_changes": true
  }
]

$ curl -s
"https://gerrit.wikimedia.org/r/changes/?q=age:1second&n=0022a6180000b1ff";
"0022a6180000b1ff" is not a valid value for "-n"
---

I tried other URL parameters such as &sortkey= and &_sortkey= and
&sortkey_after and &resume_sortkey, but nothing seems to work.

After discussing this issue with qchris in #gerrit on freenode, it seems that
Gerrit's search functionality is broken (or perhaps restricted). qchris pointed
to this (non-working) search example:

---
$ curl -s
"https://gerrit.wikimedia.org/r/changes/?q=status:merged+project:mediawiki/core+sortkey_after:m";
)]}'
[]
---

It's unclear whether this issue has a corresponding bug in Gerrit's bug
tracker. As it stands, it appears to be impossible to pull metadata of more
than 500 changesets from the Gerrit REST API.

Without the ability to specify an offset (and consequently retrieve information
about more than 500 changesets), I'm unable to generate Gerrit reports
([[mw:Gerrit/Reports]]). :-(

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to