Gerrit: use gsql can't access gerrit database - gerrit

I want to do some data visualization for Gerrit, but I can't log in to the corresponding database.
like this

Gerrit 3.0 onwards has removed the use of an external database in favor of the git based noteDb and gsql has been removed

Related

Getting git items for a particular branch/tag via TFS rest api

Now that TFS 2015 comes with the same new Rest API of VS Team Services, I've taken a look at the API doc:
https://www.visualstudio.com/en-us/integrate/api/git/overview
One question naturally raised is that most queries do not expose an parameter for git branch or tag (e.g. download /path/to/my/file with tag 'release_v1.0'), which looks like a show stopper. As in my case, I need programatically pull out some source file under a certain branch/tag.
Is it not supported yet?
Yes you can. As or the link that you have above you can use the provided so to retrieve both branches and yes. In git they are really all the same thing, pointers. This use the "refs" api.
https://www.visualstudio.com/integrate/api/git/refs

How to store git commit hash during TFS build for display on a page?

How can I get the current commit hash from git and store it somewhere so that I can display it on an ASP.net MVC page? Does TFS expose that information anywhere? Is there some consistent way I can do it whether I build on a TFS server or locally?
If you need something like this, it'll most likely be a custom MsBuild task (to make it available locally) or a custom Team Build Activity.
On the build server the current Commit hash or tag (depending on how the build was queued) is available as part of the IBuildDetails.
On the client you can use LibGitSharp or invoke the git commandline to grab the current commit in your workspace and put it somewhere in the output directory.
But if you want to know if there is a standard, default way, then no.

How to assign access rights to a Gerrit project using API / SSH?

I'm looking for a way to automatically add +2 permissions for certain refs for a lot of projects in Gerrit and unfortunately it seems there are no API calls to modify access rights, only to read them. Do you have any idea how to modify refs permissions for a big amount of projects?
I'm using Gerrit 2.9.
Thanks.
One possibility would be to create a batch script to modify the project.config for those projects and commit them back to gerrit.
This is how you can checkout the project.config for the All-Projects, it works the same for other projects: http://blog.bruin.sg/2013/04/how-to-edit-the-project-config-for-all-projects-in-gerrit/
Simply put:
Create list of project you want to change
Iterate over the lest
Checkout the refs/meta/config ref
Use script to modify project.config
Commit and push back to the server
More information about the project.config: http://gerrit-review.googlesource.com/Documentation/config-project-config.html

How to use Jenkins credential store when accessing CVS?

Is there a way to use the credential store with the CVS plugin to access a CVS repository? Looking for a way to store credential once and have one place to change it, despite many jobs making use of it.
The CVS plugin doesn't use the credentials store directly (although there are potential plans to move to this in a future overhaul of the plugin), but it does have a concept of global credentials which should provide what you need. The reason for having something separate from global credentials was that CVS introduced this prior to the credentials plugin being available and the steps have never been taken to try and perform a migration.
To use this credential feature, ensure you have version 2.4 or above of the CVS plugin, goto your 'Manage Configuration' screen, scroll down to the CVS section and click the 'Add' button next to the 'Authentication' option. Once you've added any credentials in here, go back to the jobs you're wanting to use the global credentials on, check the CVS root matches what you put in the authentication section and that it doesn't contain a username and then run your job. When running, the console should then show 'Using globally configured credentials for...' when trying to connect to CVS.

Purge Abandoned Change-Ids from Gerrit for good

On Gerrit Web UI, I do not see a way to purge Change-Ids in "Abandoned" state.
While trying out Gerrit we created a good number of Change-Ids that are required to go
away from the Web UI.
Is cleaning from DB directly using SQL scripts, the only alternative?
Gerrit: version 2.4.2
OS: RedHat Based
Please let me know if you require any additional information.
Thanks
Yes, purging the DB is the only way (currently) to completely delete changes. They also will still exist in the repository under the refs/changes/ branch, but won't show up in the Web UI once the database has been purged.

Resources