Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = Gerrit Code Review - Dashboards |
Edwin Kempin | d25d10a | 2012-07-19 10:56:34 +0200 | [diff] [blame] | 2 | |
Edwin Kempin | 1f55622 | 2015-04-22 13:24:39 +0200 | [diff] [blame] | 3 | [[custom-dashboards]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 4 | == Custom Dashboards |
Edwin Kempin | d25d10a | 2012-07-19 10:56:34 +0200 | [diff] [blame] | 5 | |
| 6 | A custom dashboard is shown in a layout similar to the per-user |
| 7 | dashboard, but the sections are entirely configured from the URL. |
| 8 | Because of this custom dashboards are stateless on the server side. |
| 9 | Users or projects can simply trade URLs using an external system like |
| 10 | a project wiki, or site administrators can put the links into the |
| 11 | site's `GerritHeader.html` or `GerritFooter.html`. |
| 12 | |
| 13 | Dashboards are available via URLs like: |
| 14 | ---- |
| 15 | /#/dashboard/?title=Custom+View&To+Review=reviewer:john.doe@example.com&Pending+In+myproject=project:myproject+is:open |
| 16 | ---- |
| 17 | This opens a view showing the title "Custom View" with two sections, |
| 18 | "To Review" and "Pending in myproject": |
| 19 | ---- |
| 20 | Custom View |
| 21 | |
| 22 | To Review |
| 23 | |
| 24 | Results of `reviewer:john.doe@example.com` |
| 25 | |
| 26 | Pending In myproject |
| 27 | |
| 28 | Results of `project:myproject is:open` |
| 29 | ---- |
| 30 | |
| 31 | The dashboard URLs are easy to configure. All keys and values in the |
| 32 | URL are encoded as query parameters. Set the page and window title |
| 33 | using an optional `title=Text` parameter. |
| 34 | |
| 35 | Each section's title is defined by the parameter name, the section |
| 36 | display order is defined by the order the parameters appear in the |
| 37 | URL, and the query results are defined by the parameter value. To |
| 38 | limit the number of rows in a query use `limit:N`, otherwise the |
| 39 | entire result set will be shown (up to the user's query limit). |
| 40 | |
| 41 | Parameters may be separated from each other using any of the following |
| 42 | characters, as some users may find one more readable than another: |
| 43 | `&` or `;` or `,` |
| 44 | |
Martin Fick | 99898fc | 2012-11-13 00:04:16 -0700 | [diff] [blame] | 45 | The special `foreach=...` parameter is designed to facilitate |
David Pursehouse | 9246356 | 2013-06-24 10:16:28 +0900 | [diff] [blame] | 46 | more easily writing similar queries in a dashboard. The value of the |
Martin Fick | 99898fc | 2012-11-13 00:04:16 -0700 | [diff] [blame] | 47 | foreach parameter will be used in every query in the dashboard by |
| 48 | appending it to their ends with a space (ANDing it with the queries). |
| 49 | |
| 50 | Example custom dashboard using foreach to constrain a dashboard |
| 51 | to changes for the current user: |
| 52 | |
| 53 | ---- |
| 54 | /#/dashboard/?title=Mine&foreach=owner:self&My+Pending=is:open&My+Merged=is:merged |
| 55 | ---- |
| 56 | |
| 57 | |
Edwin Kempin | 861d4e1 | 2013-03-27 10:28:18 +0100 | [diff] [blame] | 58 | [[project-dashboards]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 59 | == Project Dashboards |
Edwin Kempin | b2efe21 | 2012-11-12 23:03:36 +0100 | [diff] [blame] | 60 | |
| 61 | It is possible to share custom dashboards at a project level. To do |
Jonathan Nieder | 5758f18 | 2015-03-30 11:28:55 -0700 | [diff] [blame] | 62 | this define the dashboards in a `+refs/meta/dashboards/*+` branch of the |
Martin Fick | 671767b | 2012-11-18 14:11:06 -0700 | [diff] [blame] | 63 | project. For each dashboard create a config file. The file path/name |
| 64 | will be used as name (equivalent to a title in a custom dashboard) for |
| 65 | the dashboard. |
Edwin Kempin | b2efe21 | 2012-11-12 23:03:36 +0100 | [diff] [blame] | 66 | |
Bruce Zu | 4bb60f7a | 2013-08-09 12:52:19 +0800 | [diff] [blame] | 67 | Example of a dashboard config file: |
Edwin Kempin | b2efe21 | 2012-11-12 23:03:36 +0100 | [diff] [blame] | 68 | |
| 69 | ---- |
Edwin Kempin | f6db7ff | 2012-11-20 16:42:06 +0100 | [diff] [blame] | 70 | [dashboard] |
Edwin Kempin | b2efe21 | 2012-11-12 23:03:36 +0100 | [diff] [blame] | 71 | description = Most recent open and merged changes. |
| 72 | [section "Open Changes"] |
| 73 | query = status:open project:myProject limit:15 |
| 74 | [section "Merged Changes"] |
| 75 | query = status:merged project:myProject limit:15 |
| 76 | ---- |
| 77 | |
Martin Fick | 7aa89fe | 2012-11-18 14:05:58 -0700 | [diff] [blame] | 78 | Once defined, project dashboards are accessible using stable URLs by |
| 79 | using the project name, refname and pathname of the dashboard via URLs |
Bruce Zu | 4bb60f7a | 2013-08-09 12:52:19 +0800 | [diff] [blame] | 80 | , e.g. create a dashboard config file named `Main` and push it |
| 81 | to `refs/meta/dashboards/Site` branch of All-Projects, then access it |
Martin Fick | 7aa89fe | 2012-11-18 14:05:58 -0700 | [diff] [blame] | 82 | like: |
| 83 | ---- |
| 84 | /#/projects/All-Projects,dashboards/Site:Main |
| 85 | ---- |
| 86 | |
Martin Fick | c2f373f | 2012-11-14 01:24:47 -0700 | [diff] [blame] | 87 | Project dashboards are inherited from ancestor projects unless |
Martin Fick | 671767b | 2012-11-18 14:11:06 -0700 | [diff] [blame] | 88 | overridden by dashboards with the same ref and name. This makes |
| 89 | it easy to define common dashboards for every project by simply |
| 90 | defining project dashboards on the All-Projects project. |
Martin Fick | c2f373f | 2012-11-14 01:24:47 -0700 | [diff] [blame] | 91 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 92 | === Token `${project}` |
Edwin Kempin | 07fb612 | 2013-04-04 08:44:41 +0200 | [diff] [blame] | 93 | |
Martin Fick | c31ee09 | 2012-11-14 14:16:42 -0700 | [diff] [blame] | 94 | Project dashboard queries may contain the special `${project}` token |
Edwin Kempin | 07fb612 | 2013-04-04 08:44:41 +0200 | [diff] [blame] | 95 | which will be replaced with the name of the project to which the |
| 96 | dashboard is being applied. This is useful for defining dashboards |
| 97 | designed to be inherited. With this token, it is possible to cause a |
| 98 | query in a project dashboard to be restricted to only changes for the |
| 99 | project in which an inherited dashboard is being applied by simply |
| 100 | adding `project:${project}` to the query in the dashboard. |
Martin Fick | c31ee09 | 2012-11-14 14:16:42 -0700 | [diff] [blame] | 101 | |
Edwin Kempin | 07fb612 | 2013-04-04 08:44:41 +0200 | [diff] [blame] | 102 | The `${project}` token can also be used in the link:#dashboard.title[ |
| 103 | dashboard title] and in the link:#dashboard.description[dashboard |
| 104 | description]. |
Edwin Kempin | b2efe21 | 2012-11-12 23:03:36 +0100 | [diff] [blame] | 105 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 106 | === Section `dashboard` |
Edwin Kempin | 07fb612 | 2013-04-04 08:44:41 +0200 | [diff] [blame] | 107 | |
| 108 | [[dashboard.title]]dashboard.title:: |
Edwin Kempin | f6db7ff | 2012-11-20 16:42:06 +0100 | [diff] [blame] | 109 | + |
| 110 | The title of the dashboard. |
| 111 | + |
| 112 | If not specified the path of the dashboard config file is used as |
| 113 | title. |
| 114 | |
Edwin Kempin | 07fb612 | 2013-04-04 08:44:41 +0200 | [diff] [blame] | 115 | [[dashboard.description]]dashboard.description:: |
Edwin Kempin | b2efe21 | 2012-11-12 23:03:36 +0100 | [diff] [blame] | 116 | + |
| 117 | The description of the dashboard. |
| 118 | |
Martin Fick | cb8fe2f | 2012-11-19 21:58:20 -0700 | [diff] [blame] | 119 | dashboard.foreach:: |
| 120 | + |
| 121 | The value of the foreach parameter gets appended to every query in the |
| 122 | dashboard. |
| 123 | + |
| 124 | Example dashboard config section to constrain the entire dashboard to |
| 125 | the project to which it is applied: |
| 126 | + |
| 127 | ---- |
| 128 | [dashboard] |
| 129 | foreach = project:${project} |
| 130 | ---- |
| 131 | |
| 132 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 133 | === Section `section` |
Edwin Kempin | b2efe21 | 2012-11-12 23:03:36 +0100 | [diff] [blame] | 134 | |
| 135 | section.<name>.query:: |
| 136 | + |
| 137 | The change query that should be used to populate the section with the |
| 138 | given name. |
| 139 | |
Edwin Kempin | 861d4e1 | 2013-03-27 10:28:18 +0100 | [diff] [blame] | 140 | [[project-default-dashboard]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 141 | == Project Default Dashboard |
Edwin Kempin | 4885343 | 2012-11-14 20:46:58 +0100 | [diff] [blame] | 142 | |
| 143 | It is possible to define a default dashboard for a project in the |
| 144 | projects `project.config` file in the `refs/meta/config` branch: |
| 145 | |
| 146 | ---- |
| 147 | [dashboard] |
| 148 | default = refs/meta/dashboards/main:default |
| 149 | ---- |
| 150 | |
| 151 | The dashboard set as the default dashboard will be inherited as the |
| 152 | default dashboard by child projects if they do not define their own |
| 153 | default dashboard. The `local-default` entry makes it possible to |
| 154 | define a different default dashboard that is only used by this project |
| 155 | but not inherited to the child projects. |
| 156 | |
| 157 | ---- |
| 158 | [dashboard] |
| 159 | default = refs/meta/dashboards/main:default |
| 160 | local-default = refs/meta/dashboards/main:local |
| 161 | ---- |
| 162 | |
Edwin Kempin | d25d10a | 2012-07-19 10:56:34 +0200 | [diff] [blame] | 163 | GERRIT |
| 164 | ------ |
| 165 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 166 | |
| 167 | SEARCHBOX |
| 168 | --------- |