我想阻止Renovate对某些依赖项进行重大升级,但仍允许对这些依赖项进行次要升级和补丁升级。使用ignoreDeps
完全排除它们,这不是最佳的。我还需要在一个 Gitlab 合并请求中获得每次运行的所有建议升级,因此使用单独的matchUpdateTypes
组不适合我的用例。
有没有办法实现我正在寻找的东西?
使用 Angular 14 的项目中的具体示例,Renovate 不应尝试升级到 15,但仍为我提供最新的 14.x 升级:
"@angular/router": "14.2.7", // what I have now
"@angular/router": "14.2.10", // what should be suggested
"@angular/router": "15.0.0", // what should be avoided
Run Code Online (Sandbox Code Playgroud)
我在所有存储库中的一般包规则如下所示:
"packageRules": [
{
"groupName": "all dependencies",
"groupSlug": "all",
"matchPackagePatterns": [
"*"
],
"matchUpdateTypes": [
"major",
"minor",
"patch"
]
}
],
Run Code Online (Sandbox Code Playgroud)
我在renovate.json
每个存储库的文件中指定要忽略的特定依赖项,如下所示:
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
"ignoreDeps": [
"@angular/router"
]
}
Run Code Online (Sandbox Code Playgroud)
但这会阻止所有更新。我尝试过使用该架构,但这完全忽略了配置:
// BROKEN
{
"$schema": …
Run Code Online (Sandbox Code Playgroud) 在 Spring-Boot 2.4 中,我在执行器运行状况端点和就绪探针方面遇到了这个问题。当我的自定义关键组件之一出现故障时,/health/readiness
端点会显示DOWN
,/health
端点也会显示 ,但详细readinessState
信息/health
仍会显示UP
。
为什么会这样呢?不也应该readinessState
说DOWN
吗?
我在网上找到的许多教程似乎都没有解决这个问题。
我的假设:这readinessState
与准备情况无关,并暴露了另一条信息。我希望我错了,因为这毫无意义,而且我对代码的理解似乎表明情况并非如此。
有关我的配置的更多信息:
相关摘录自application.yml
management:
endpoints:
web:
base-path: /
endpoint:
health:
show-details: ALWAYS
probes:
enabled: true
group:
readiness:
include: db, myCustom, diskSpace
Run Code Online (Sandbox Code Playgroud)
当我执行myCustom
go时DOWN
,会出现以下结果:
GET /health
{
"status": "DOWN",
"components": {
..., // other components
"myCustom": {
"status": "DOWN"
},
"readinessState": {
"status": "UP" // here UP
} …
Run Code Online (Sandbox Code Playgroud) spring-boot spring-boot-actuator readinessprobe health-check
如何使用 scikit svm 绘制一维数据的分离“超平面”?
我遵循二维数据指南:http://scikit-learn.org/stable/auto_examples/svm/plot_svm_margin.html,但不知道如何使其适用于一维数据
pos = np.random.randn(20, 1) + 1
neg = np.random.randn(20, 1) - 1
X = np.r_[pos, neg]
Y = [0] * 20 + [1] * 20
clf = svm.SVC(kernel='linear', C=0.05)
clf.fit(X, Y)
# how to get "hyperplane" and margins values ??
Run Code Online (Sandbox Code Playgroud)
谢谢
我想buildDiscarder
根据全局变量进行不同的配置。目前我有
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
}
Run Code Online (Sandbox Code Playgroud)
但我正在寻找类似的东西
// BROKEN
options {
if ("${SOME_VAR}" == 'some_val') {
buildDiscarder(logRotator(numToKeepStr: '5'))
} else {
buildDiscarder(logRotator(daysToKeepStr: '7'))
}
}
Run Code Online (Sandbox Code Playgroud)
有什么方法可以在 Jenkins 声明式管道中实现这种行为吗?我认为我不能在这里使用script
//when
块expression
,或者至少当我尝试时它不起作用。
continuous-integration jenkins jenkins-pipeline jenkins-declarative-pipeline
我试图使用自定义包装/装饰在Python,我想声明一个内部类,这样我就可以,例如打印属性的快照.我从这个问题中尝试过的事情没有成功.
这是我想要做的(注意:这段代码不起作用,我解释下面发生的事情)
class TestWrapper():
def __init__(self, a, b):
self.a = a
self.b = b
self.c = 0
def enter_exit_info(self, func):
def wrapper(*arg, **kw):
print '-- entering', func.__name__
print '-- ', self.__dict__
res = func(*arg, **kw)
print '-- exiting', func.__name__
print '-- ', self.__dict__
return res
return wrapper
@enter_exit_info
def add_in_c(self):
self.c = self.a + self.b
print self.c
@enter_exit_info
def mult_in_c(self):
self.c = self.a * self.b
print self.c
if __name__ == '__main__':
t = TestWrapper(2, 3)
t.add_in_c() …
Run Code Online (Sandbox Code Playgroud) 基本上我想要实现的是调用第二个存储库(a ReactiveCrudRepository
)或抛出异常,具体取决于调用第一个存储库的结果。
我最初的想法是这样的:
/** Reactive with blocking code */
public Flux<SecondThing> getThings(String firstThingName) {
FirstThing firstThing = firstRepo
.findByName(firstThingName)
// Warning: "Inappropriate blocking method call"
.blockOptional() // this fails in test-context
.orElseThrow(() -> new FirstThingNotFound(firstThingName));
return secondRepo.findAllByFirstThingId(firstThing.getId());
}
Run Code Online (Sandbox Code Playgroud)
这对应于以下非反应式方法:
/** Non-reactive */
public List<SecondThing> getThings(String firstThingName) {
FirstThing firstThing = firstRepo
.findByName(firstThingName)
.orElseThrow(() -> new FirstThingNotFound(firstThingName));
return secondRepo.findAllByFirstThingId(firstThing.getId());
}
Run Code Online (Sandbox Code Playgroud)
我还没有找到一种方法以反应式非阻塞方式做到这一点。Mono
我所需要的只是在第一次调用中出现空值时抛出错误,如果不为空则继续管道;但我在这里似乎无法正确使用onErrorStop
或doOnError
正确使用,并且map
没有帮助,因为它跳过了空的Mono
.
如果我使用id
而不是,我有一个解决方法name
,但我对它不太满意,因为它在 是 的实例FirstThing
但没有 …
我创建了一条路线和一个集成,但我无法使用awscli
. 是否可以通过命令行执行此操作,或者只能通过 Web 界面执行此操作?
我的目标是在 Localstack Pro 中重现现有的 API-Gateway v2 配置(使用 AWS Web 控制台创建),在容器启动期间专门使用 aws-cli 工具进行设置。
我可以毫无困难地创建 API、路由和集成:
awslocal apigatewayv2 create-api --name="test-api" --protocol="http"
awslocal apigatewayv2 create-integration --api-id ebb87127 --integration-type AWS --integration-uri arn:aws:lambda:us-east-1:000000000000:function:some-lambda
awslocal apigatewayv2 create-route --api-id ebb87127 --route-key '$default'
Run Code Online (Sandbox Code Playgroud)
aws apigatewayv2
但我在文档下找不到任何将路由链接到集成的内容。
使用 Web 界面在“真正的”AWS 中执行此操作非常简单:
如何在命令行中实现这一点?
python ×2
aws-cli ×1
decorator ×1
gitlab ×1
health-check ×1
jenkins ×1
jenkins-declarative-pipeline ×1
localstack ×1
matplotlib ×1
numpy ×1
python-2.7 ×1
renovate ×1
scikit-learn ×1
spring-boot ×1
svm ×1
wrapper ×1