Primiano Tucci | a662485 | 2020-05-21 19:12:50 +0100 | [diff] [blame] | 1 | # Contributing to Perfetto |
| 2 | |
| 3 | ## Repository |
| 4 | |
| 5 | This project uses [Android AOSP Gerrit][perfetto-gerrit] for code reviews, |
| 6 | follows the [Google C++ style][google-cpp-style], and targets `-std=c++11`. |
| 7 | |
| 8 | Development happens in the AOSP repository: |
| 9 | https://android.googlesource.com/platform/external/perfetto/ |
| 10 | |
| 11 | https://github.com/google/perfetto is an up-to-date and actively maintained |
| 12 | read-only mirror of the above. Pull requests through GitHub are not accepted. |
| 13 | |
| 14 | ## Code Reviews |
| 15 | |
| 16 | All submissions, including submissions by project members, require review. |
| 17 | We use [Android AOSP Gerrit][perfetto-gerrit] for this purpose. |
| 18 | |
| 19 | `git cl upload` from [Chromium depot tools][depot-tools] is the preferred |
| 20 | workflow to upload patches, as it takes care of runing presubmit tests, |
| 21 | build-file generators and code formatting. |
| 22 | |
| 23 | If you submit code directly through `repo` and your CL touches build files or |
| 24 | .proto files, it's very likely that it will fail in the CI because the |
| 25 | aforementioned generators are bypassed. |
| 26 | |
| 27 | ## Continuous integration |
| 28 | |
| 29 | There are two levels of CI / TryBots involved when submitting a Perfetto CL: |
| 30 | |
| 31 | - [ci.perfetto.dev](https://ci.perfetto.dev): it covers building and testing |
| 32 | on most platforms and toolchains within ~15 mins. Anecdotally most build |
| 33 | failures and bugs are detected at the Perfetto CI level. |
| 34 | |
| 35 | - The [Android CI](https://ci.android.com) (also known as TreeHugger) builds a |
| 36 | full system image and runs full integration tests within ~2-4 hours. This can |
| 37 | shake a number of more rare integration bugs, often related with SELinux, |
| 38 | initrc files or similar. |
| 39 | |
| 40 | Both CIs are kicked in when the `Presubmit-Ready: +1` is set and will publish a |
| 41 | comment like [this][ci-example] on the CL. |
| 42 | |
| 43 | You need to wait for both CIs to go green before submitting. The only |
| 44 | exceptions are UI-only, docs-only or GN-only changes, for which the Android CI |
| 45 | can be bypassed, as those are not built as part of the Android tree. |
| 46 | |
| 47 | ## Community |
| 48 | |
| 49 | You can reach us on our [Discord channel](https://discord.gg/35ShE3A). |
Primiano Tucci | a662485 | 2020-05-21 19:12:50 +0100 | [diff] [blame] | 50 | |
| 51 | Mailing list: https://groups.google.com/forum/#!forum/perfetto-dev |
| 52 | |
| 53 | This project follows |
| 54 | [Google's Open Source Community Guidelines](https://opensource.google/conduct/). |
| 55 | |
| 56 | ### Bugs |
| 57 | |
| 58 | For bugs affecting Android or the tracing internals: |
| 59 | |
| 60 | * **Googlers**: use the internal bug tracker [go/perfetto-bugs](http://goto.google.com/perfetto-bugs) |
| 61 | * **Non-Googlers**: use [GitHub issues](https://github.com/google/perfetto/issues). |
| 62 | |
| 63 | For bugs affecting Chrome Tracing: |
| 64 | |
| 65 | * Use http://crbug.com `Component:Speed>Tracing label:Perfetto`. |
| 66 | |
| 67 | ## Contributor License Agreement |
| 68 | |
| 69 | Contributions to this project must be accompanied by a Contributor License |
| 70 | Agreement. You (or your employer) retain the copyright to your contribution; |
| 71 | this simply gives us permission to use and redistribute your contributions as |
| 72 | part of the project. Head over to <https://cla.developers.google.com/> to see |
| 73 | your current agreements on file or to sign a new one. |
| 74 | |
| 75 | You generally only need to submit a CLA once, so if you've already submitted one |
| 76 | (even if it was for a different project), you probably don't need to do it |
| 77 | again. |
| 78 | |
| 79 | [perfetto-gerrit]: https://android-review.googlesource.com/q/project:platform%252Fexternal%252Fperfetto+status:open |
| 80 | [google-cpp-style]: https://google.github.io/styleguide/cppguide.html |
| 81 | [depot-tools]: https://dev.chromium.org/developers/how-tos/depottools |
| 82 | [ci-example]: https://android-review.googlesource.com/c/platform/external/perfetto/+/1108253/3#message-09fd27fb92ca8357abade3ec725919ac3445f3af |