小编Mis*_*ate的帖子

Jenkins的Gerrit触发器找不到任何修改版本

我在使用Jenkins + Gerrit时遇到了麻烦.

这是我到目前为止所得到的:

  • Jenkins中的Gerrit Trigger配置似乎没问题:当我推出一个新的变更集时,会启动Jenkins构建.

  • 我用过这个: Jenkins:Gerrit Trigger问题的 设置也能够"手动"启动它.

  • 至于我的配置,我有这样的东西:https://stackoverflow.com/a/18347982/2248987.Branch Specifier是$ GERRIT_BRANCH,Ref Spec是$ GERRIT_REFSPEC

  • Gerrit和Git正在自行处以罚款.访问似乎也可以.

这是我的问题.构建时(gerrit触发或手动),日志输出为:

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://user@host:29418/testproject # timeout=10
Fetching upstream changes from ssh://user@host:29418/testproject
 > git --version # timeout=10
using GIT_SSH to set credentials 
 > git -c core.askpass=true fetch --tags --progress ssh://user@host:29418/testproject refs/heads/master
 > git rev-parse origin/$GERRIT_BRANCH^{commit} # timeout=10
 > git rev-parse $GERRIT_BRANCH^{commit} # timeout=10
ERROR: Couldn't find …
Run Code Online (Sandbox Code Playgroud)

git gerrit jenkins gerrit-trigger

14
推荐指数
2
解决办法
1万
查看次数

Python检查一个或多个值是否为None并知道哪些值是

我有一个带有Firebase数据库后端的Python应用程序.

当我从数据库中检索数据时,我想检查这些值是否可用(如果没有,这意味着数据库以某种方式被破坏,因为缺少强制字段)

我目前的实施如下:

self.foo = myDbRef.get('foo')
self.bar =  myDbRef.get('bar')
self.bip =  myDbRef.get('bip')
self.plop = myDbRef.get('plop')

if self.foo is None or self.bar is None or self.bip is None or self.plop is None:
    self.isValid = False
    return ErrorCode.CORRUPTED_DATABASE
Run Code Online (Sandbox Code Playgroud)

这工作正常,紧凑,但有一个主要问题:我将获得数据库已损坏的信息,但不会丢失哪些字段(可能只是其中之一,或更多,或全部!)

惯用法应该是

if self.foo is None:
    self.isValid = False
    return ErrorCode.CORRUPTED_DATABASE, "FOO IS MISSING" # could be a string, an enum value, whatever, I have the information

if self.bar is None:
    self.isValid = False
    return ErrorCode.CORRUPTED_DATABASE, "BAR IS MISSING"

if self.bip is None:
    self.isValid …
Run Code Online (Sandbox Code Playgroud)

python algorithm firebase-realtime-database

5
推荐指数
1
解决办法
136
查看次数