TouK / sputnik

Static code review for your Gerrit patchsets. Runs Checkstyle, PMD, FindBugs, Scalastyle, CodeNarc, JSLint for you!
Apache License 2.0
201 stars 117 forks source link

Allow specifying Gerrit review by full revision path #240

Open marquiswang opened 3 years ago

marquiswang commented 3 years ago

Right now, Sputnik requires two parameters, the changeId and commitId to report to Gerrit:

sputnik --conf /path/to/conf.properties --changeId I0a2afb7ae4a94ab1ab473ba00e2ec7de381799a0 --revisionId 3f37692af2290e8e3fd16d2f43701c24346197f0

It turns out you can also use the change and revision's numeric ids

sputnik --conf /path/to/conf.properties --changeId 12345 --revisionId 5

However, with a lot of build setups, it is easiest to extract the identifier for the patchset as a single string "12345/5". You can get this out of the URI for a gerrit review, or from the ref in the Gerrit repo itself.

In my organization's build setup, the build configuration simply sees the branch as "12345/5".

Right now, we use a separate build step that splits this by the "/" and sets two build parameters for the changeId and revisionId. However, it would simplify the setup if we could just pass in --changeId 12345/5.