gerrit

Google authentication for Gerrit and Jenkins

萝らか妹 提交于 2019-11-29 11:33:55
问题 Jenkins and Gerrit have both plugins for OpenID 2.0, but this API has been deprecated by Google May 19 2014 (https://developers.google.com/accounts/docs/OpenID) making it impossible for new installation to use and existing installations must migrate to OAuth2.0(OpendID connect). When trying to use OpenID 2.0 you will get the error message "Error 400: OpenID auth request contains an unregistered domain". The Gerrit team is aware of the problem but no solution as of yet: https://code.google.com

Gerrit Change has Status:Submitted, Merge Pending, how to solve it?

主宰稳场 提交于 2019-11-29 05:40:22
The Gerrit system is only used by us several people. Once there is a Change A, and its status is: "Submitted, Merge Pending". The change list in the "open" web page. Also I noticed this Change had a dependency on another change B (which status is abandoned). How to make A listed on "Merged" web page ? How to make B disappear, so A has no more dependency on B ? If change A has a dependency on B, then A cannot be merged until B is merged. Since you have abandoned B, Gerrit will not automatically merge A. What you will need to do is modify A (perhaps using git rebase ) so that it no longer

What environment variables are passed to Jenkins when using the Gerrit Trigger Plugin?

六月ゝ 毕业季﹏ 提交于 2019-11-28 23:43:05
I'm using the Gerrit Trigger Plugin to kick off Jenkins builds, but haven't found a good place where all of the environment variables are documented. Does such documentation exist? As a start, I had a Jenkins build shell script dump all environment variables with GERRIT in the name: GERRIT_PATCHSET_UPLOADER=\"Alan Thompson\" <theEmail@gmail.com> GERRIT_PATCHSET_REVISION=eec3b0b65fcdf30872befa2e9ace06e96cd487b4 GERRIT_CHANGE_ID=Ieec3b0b65fcdf30872befa2e9ace06e96cd487b4 GERRIT_PATCHSET_NUMBER=1 GERRIT_EVENT_ACCOUNT_EMAIL=theEmail@gmail.com GERRIT_CHANGE_NUMBER=8 GERRIT_CHANGE_OWNER=\"Alan

Gerrit代码Review入门实战

我们两清 提交于 2019-11-28 22:21:20
代码审核(Code Review)是软件研发质量保障机制中非常重要的一环,但在实际项目执行过程中,却因为种种原因被Delay甚至是忽略。在实践中,给大家推荐一款免费、开放源代码的代码审查软件Gerrit。 1、Why Code Review Code Review是什么 Code Review最直观的解释即看代码。常规的做法为自己看,有时代码逻辑问题可能自己看不出来,需要找同事一起看,在大家知识体系相对平均的情况下可能需要花钱专门的公司帮助查看。 Code Review需要看哪些?对于刚入职场或者刚接触到Coding的新人来说,代码风格是比较重要的一块。除此之外,编码规范及代码结构写法,框架和工具的选型,具体项目的业务逻辑,安全隐患,性能问题等都可以通过review的方式发现。Code Review从前往后大致分为结对编程,提交代码后,测试之前,发版之前,发版之后等几个阶段,越往后,Code Review的效果越差,修复的成本也越来越高。 为什么一定要做入库前Code Review 首先,代码审查的最大的功用是纯社会性的。如果你在编程,而且知道将会有同事检查你的代码,你编程态度就完全不一样了。你写出的代码将更加整洁,有更好的注释和程序结构。 其次,偷懒是人的天性,从节约成本的角度考虑,大家一般会选择在测试之前无限制的Delay Code Review。入库前做Code

Code Review最佳实践

折月煮酒 提交于 2019-11-28 22:20:50
Code Review最佳实践 原文链接 : Code Review Best Practices 原文作者 : Kevin London 译文出自 : 开发技术前线 www.devtf.cn 译者 : ayyb1988 校对者: chaossss 状态 : 完成 在Wiredrive上,我们做了很多的Code Review。在此之前我从来没有做过,这对于我来说是一个全新的体验,下面来总结一下在Code Review中做的事情以及说说Code Review的最好方式。 简单的说,Code Review是开发者之间讨论修改代码来解决问题的过程。很多文章谈论了Code Review的诸多好处,包括知识共享,代码的质量,开发者的成长,却很少讨论审查什么、如何审查。 审查的内容 体系结构和代码设计 单一职责原则: 一个类有且只能一个职责。我通常使用这个原则去衡量,如果我们必须使用“和”来描述一个方法做的事情,这可能在抽象层上出了问题。 开闭原则 对于面向对象的语言,对象在可扩展方面开放、对在修改方面关闭。如果我们需要添加另外的内容会怎样? 代码复用:根据 “三振法” ,如果代码被复制一次,虽然不喜欢这种方式,但通常没什么问题。但如果再一次被复制,就应该通过提取公共的部分来重构它。 换位考虑 ,如果换位考虑,这行代码是否有问题?用这种模式是否可以发现代码中的问题。 用更好的代码:

Import repository from git to gerrit

ぐ巨炮叔叔 提交于 2019-11-28 21:01:47
问题 I have two questions about Gerrit: How do I convert or import an already existing Git repository into Gerrit's format? There were a lot of commits without Gerrit control, I want to simply push those commits into a Gerrit project. I see two ways to do it: Copy existing bare Git directory to Gerrit and then add it to database. Is that a safe method? Push all commits from my local repository to gerrit repository. How to revert repository from Gerrit to original Git format? Is it required to

How to configure specific upstream push refspec for Git when used with Gerrit?

左心房为你撑大大i 提交于 2019-11-28 17:18:28
I'm setting up Git with Gerrit Code Review and am looking for a way to make the necessary Git commands relatively straightforward for users who might be new to Git. The commands I currently have for starting a new feature branch are essentially (assuming Gerrit is origin ): git checkout baseline git pull git checkout -b work1234 git push -u origin work1234 This starts a new work package work1234 branched from some baseline , and the final push creates the branch in Gerrit and sets the upstream. So .git/config looks something like: [branch "work1234"] remote = origin merge = refs/heads/work1234

How to review a specific commit on Git

戏子无情 提交于 2019-11-28 10:16:59
I sent a commit (named "A commit") to review (Gerrit) using git review command. Now, I make a new commit (named "B commit") and I want to send it to review as well, but I don't want to re-send the "A commit". There is no dependencies each other. How to send a review to gerrit for a specific commit?. UPDATE : $ git add --all $ git status # On branch delete_role # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: path/to/file.ext $ git status # On branch delete_role nothing to commit (working directory clean) $ git branch *delete_role master $ git log --graph -

How can I recover my Git repository for a “missing tree” error?

╄→尐↘猪︶ㄣ 提交于 2019-11-28 05:49:33
We are using Gerrit for our Git repository. On a project that has been active for several months, we are suddenly unable to push any changes. When we execute git push we see the following error: error: unpack failed: error Missing tree 14d62f0ed4385e3f68f226ac133fa9932a9c65c9 Executing git fsck --full yields: dangling tree 2701c92fb6eab1826482f6bcc9598413e651a92a dangling blob c505b3b12cfacd1e26dec8dc559820a30fc20c27 dangling blob 8907f94b5b4ec881e1b86d50681795e368c167ff dangling blob 4938d9fc34c6e2f92c68872bfec6e070b2b3a9c2 dangling blob 8a5c8b8d35484ea1470e2d8e6c482fcb97b23d0f dangling

git unpack error on push to gerrit

╄→гoц情女王★ 提交于 2019-11-28 03:18:51
On push of a new branch to a gerrit server we encounter the following error: de@roma:~/git-hate/www$ git push origin landingpage Counting objects: 149, done. Delta compression using up to 2 threads. Compressing objects: 100% (73/73), done. Writing objects: 100% (111/111), 2.77 MiB, done. Total 111 (delta 68), reused 80 (delta 38) remote: Resolving deltas: 100% (68/68) error: unpack failed: error Missing tree 30c4809ade0b4b0c81cb7f882450774862b82361 fatal: Unpack error, check server log To ssh://user@git-server/repository ! [remote rejected] landingpage -> landingpage (n/a (unpacker error))