如何让 dependentabot 忽略 docker 次要版本

发布于 2025-01-11 14:37:19 字数 428 浏览 3 评论 0原文

我试图在最新的 python 版本之后保留一个小版本,我希望使用 dependentabot 来帮助解决这个问题。

我使用 python slim docker 映像作为我的基本映像,并基于该映像加上 dependentabot 文档,我已将以下内容添加到我的 dependentabot.yml 中:

- package-ecosystem: "docker"
directory: "/"
schedule:
  interval: "daily"
ignore:
  - dependency-name: "python"
    versions: [ "3.10.x" ]

这不起作用。然而,当我告诉 3.10 PR“忽略这个次要版本”时,它成功地做到了这一点,并指出它不会再让我担心 3.10.x 版本了,所以很明显,逻辑就在那里某处

I'm trying to stay one minor version behind the latest python version, and I was hoping to use dependabot to help with that.

I'm using the python slim docker image as my base image, and based on that plus the dependabot docs I've added the following to my dependabot.yml:

- package-ecosystem: "docker"
directory: "/"
schedule:
  interval: "daily"
ignore:
  - dependency-name: "python"
    versions: [ "3.10.x" ]

This is not working. When I tell the 3.10 PR to "ignore this minor version", however, it does so successfully and states that it won't bother me about 3.10.x versions anymore, so clearly the logic is in there somewhere

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酒浓于脸红 2025-01-18 14:37:19

它在这里使用 Gem::Requirementhttps://github.com/dependabot/dependabot-core/blob/c0945b376ef12f3551e22f185dc6f20c56049296/docker/lib/dependabot/docker/requirement.rb#L8

我还没有测试过这个特定场景,但我是使用类似的东西就成功了。我认为这会起作用:

ignore:
  - dependency-name: "python"
    versions: ["~> 3.10", "< 3.11"]

无论如何,在针对 Gem::Requirement 进行测试时:

>> r = Gem::Requirement.new("~> 3.10", "< 3.11")
=> Gem::Requirement.new(["~> 3.10", "< 3.11"])
>> r.satisfied_by?(Gem::Version.new('3.11'))
=> false
>> r.satisfied_by?(Gem::Version.new('3.10'))
=> true
>> r.satisfied_by?(Gem::Version.new('3.10.1'))
=> true

It is using Gem::Requirement here: https://github.com/dependabot/dependabot-core/blob/c0945b376ef12f3551e22f185dc6f20c56049296/docker/lib/dependabot/docker/requirement.rb#L8

I haven't tested this specific scenario, but I am using something similar with success. I think this will work:

ignore:
  - dependency-name: "python"
    versions: ["~> 3.10", "< 3.11"]

It appears to anyway, when testing against Gem::Requirement:

>> r = Gem::Requirement.new("~> 3.10", "< 3.11")
=> Gem::Requirement.new(["~> 3.10", "< 3.11"])
>> r.satisfied_by?(Gem::Version.new('3.11'))
=> false
>> r.satisfied_by?(Gem::Version.new('3.10'))
=> true
>> r.satisfied_by?(Gem::Version.new('3.10.1'))
=> true
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文