commit | 248122bf4166617cc22a82e093d62b6fa78f5a9a | [log] [tgz] |
---|---|---|
author | Oleh Prypin <oprypin@webrtc.org> | Thu Jan 10 15:17:39 2019 |
committer | Oleh Prypin <oprypin@webrtc.org> | Thu Jan 10 17:38:41 2019 |
tree | 53219236d73a4d0c07b46f3da4e1ea3a0358f44f | |
parent | 09b840143d54f600bac4fac02a0a18fbb53f2d77 [diff] |
Update for compatibility with changes in Buildbucket plugin https://chromium.googlesource.com/infra/gerrit-plugins/buildbucket/+/ab3014c..b1dd8c8/src/main/resources/static/cr-buildbucket-view.js Bug: chromium:920606 Change-Id: I8d65e1b07f1091ea18bf229c3e9a4c736776a7e9
The plugin queries tryjobs for the current patchset on Gerrit, and gets the binary_sizes
property from each of them. It also queries the equivalent CI jobs for the same base revision, and gets the same property from them. It then displays the results in a table, with rows being the files (keys in binary_sizes
dict), and the columns being:
Size before | Size after | Size difference (including %) | File | Builder
This plugin is configured via the binary-size.config
file present in the repo‘s refs/meta/config
ref, as well as the same file in all repositories in the repo’s inheritance chain (up to and including All-Projects).
See an example of binary-size.config:
https://webrtc.googlesource.com/src/+/refs/meta/config/binary-size.config
Also a short snippet below:
[host] git = "webrtc.googlesource.com" gerrit = "webrtc-review.googlesource.com" [builder "luci.webrtc.try/linux_rel"] base = "luci.webrtc.ci/Linux64 Release" [builder "luci.webrtc.try/win_x64_clang_rel"] base = "luci.webrtc.ci/Win64 Release (Clang)"
This contains a mapping between tryjob builders and equivalent postsubmit builders. Equivalent in the sense that if they ran with the same code, they would produce the same binary_sizes
. The plugin queries builds only from buckets that are mentioned at least once. It is OK to specify builders that don't provide a binary_sizes
property, they will just be ignored.
Note that populating the binary_sizes
property is a separate responsibility, and it is up to you to implement in your recipes. It needs to be a dict like {"some_file.so": 123456, ...}
. The values of the dict are treated as sizes in bytes.
All changes to binary-size.config
files are instantly reflected. There is no caching period or need to restart the server.
This plugin requires the buildbucket plugin in order to search builds. Ensure that they are both installed, or prepare to see errors in the browser's console.
git clone --recursive https://gerrit.googlesource.com/gerrit cd gerrit/plugins git clone https://chromium.googlesource.com/infra/gerrit-plugins/buildbucket cd buildbucket ln -s src/main/resources/static static # May be unneeded in the future. cd .. git clone https://chromium.googlesource.com/infra/gerrit-plugins/binary-size cd binary-size
Use the script run-with-prod-data.sh
(based on polygerrit-ui/run-server.sh
). You may change some paths by setting environment variables, for example:
GERRIT_DIR="$HOME/gerrit" ./run-with-prod-data.sh
# Install dependencies. npm install -g bower npm install -g web-component-tester cd test/ bower install # Run the tests from the directory root. cd ../ wct
Note: Testing is disabled for Safari due to this issue.