0

I have a Gerrit project without any dashboards defined. To make the differentiation between multiple projects on the same Gerrit server easier I would like to create a new dashboards for one of the projects.

The official documentation (at least as of v2.13.5-2456) assumes that the necessary branch where the dashboards are to be created already exist, which ist not the case on my installation. As such, the necessary steps for the first dashboard for a project are omitted there.

So the question is: What are the necessary steps to create a first dashboard for a project? Are there any pitfalls? If so, how can they be avoided?

Luuklag
  • 3,811
  • 11
  • 33
  • 51
Lennart
  • 91
  • 7
  • Not sure if this really belongs here but I had to search the internet for quite a bit and the official documentation is lacking -- also it is about code review so related to programming. – Lennart Feb 01 '17 at 12:56

1 Answers1

1

The biggest problem is creating the new meta branch where the dashboards will be housed. For that you need to make sure the user has the following access rights for the reference refs/meta/dashboards/*:

  • CreateReference
  • Push

Now check out your project as usual with git clone ssh://<user>@<server>:29418/<path/to/project> (you may want to adjust the port as necessary). You will have the current master branch in your working directory. However, the dashboards branch only works if the only files in it are actual dashboard configurations.

To solve this you have to create a new orphan branch, which does not have any history or files in it. That can be achieved with git checkout --orphan dashboard_local.

On this branch you can create your dashboard configuration with the syntax as documented in the official manual. Commit this file and make sure that no files other than dashboard configurations are in this branch.

Now this branch needs to be pushed to the server. You can use the regular Gerrit syntax here: git push origin HEAD:refs/meta/dashboards/<group>. Using the <group> identifier you can group several dashboards together in the Gerrit Web-UI.

If you made no syntax errors your dashboard should now show up and new dashboards can be added to this existing branch.

Based on:

kta
  • 36
  • 4
Lennart
  • 91
  • 7