[Bug]: gitfs with pygit2 >= 1.20 keeps deleted branches as saltenvs (fetch prune no longer used)
Maintainer thường phản hồi trong vòng 3 ngày
Một pull request liên quan đã được merge.
- #70768 của @aliassar — đã merge
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Start in salt/utils/gitfs.py and inspect the three pygit2.GIT_FETCH_PRUNE references in Pygit2._fetch, Pygit2.clean_stale_refs, and verify_pygit2. Check how pygit2.enums.FetchPrune.PRUNE is used and compare anonymous with authenticated remotes when pruning. Done when pygit2 1.20 or newer prunes deleted refs on fetch for both remote types, without requiring the git binary for the pygit2 provider.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened?
pygit2 1.20.0 removed the old GIT_* constants, including GIT_FETCH_PRUNE (it's pygit2.enums.FetchPrune.PRUNE now, available since 1.14.0). salt/utils/gitfs.py still reads pygit2.GIT_FETCH_PRUNE in three places and treats the AttributeError as "this pygit2 is too old to prune":
Pygit2._fetchstops passingprune=toRemote.fetch().Pygit2.clean_stale_refsfalls back togit remote prunefor anonymous remotes, and for remotes with credentials it just logs "The installed version of pygit2 (...) does not support detecting stale refs for authenticated remotes" and returns[].verify_pygit2now requires thegitbinary to be on PATH, otherwise the pygit2 provider is rejected.
So with an authenticated gitfs/git_pillar remote (user/password or SSH key), a branch or tag deleted on the remote stays around as a saltenv forever.
Repro: I drove salt.utils.gitfs.Pygit2 directly against a local repo with master and feature branches, fetched, deleted feature in the remote, and fetched again. "Authenticated" means credentials/remotecallbacks are set the same way salt sets them for gitfs_user/gitfs_password.
pygit2 1.19.2 pygit2 1.20.0
--- anonymous remote --- anonymous remote
after deleting feature: ['base'] after deleting feature: ['base']
prune kwarg: [PRUNE, PRUNE] prune kwarg: [None, None]
--- authenticated remote --- authenticated remote
after deleting feature: ['base'] after deleting feature: ['base', 'feature']
prune kwarg: [PRUNE, PRUNE] prune kwarg: [None, None]
(The anonymous case still works on 1.20 only because it falls back to the git CLI.) Same result on pygit2 1.21.0 once the add_file problem from #70673 is out of the way.
The same debug message shows up in the log in #70298 (pygit2 1.20.0), and #70744 bumps pygit2 to >=1.21.0, so this will hit packaged installs soon.
Expected: pygit2 >= 1.20 prunes on fetch like older releases, and deleted branches stop being saltenvs.
Seen on 3008.x at 987eefd0f3. The code is the same on 3006.x, 3007.x and master, so any install that pulls in pygit2 >= 1.20 is affected.
Type of salt install
pip (git)
Major version
3008.x
What supported OS are you seeing the problem on? Can select multiple. (If bug appears on an unsupported OS, please open a GitHub Discussion instead)
Not OS specific (reproduced on macOS from a git checkout).
salt --versions-report output
Not from a packaged install. Relevant bits: salt 3008.x @ 987eefd0f3, Python 3.11, pygit2 1.20.0 (libgit2 1.9.6) and 1.21.0 (libgit2 1.9.7). pygit2 1.15.1 and 1.19.2 are fine.
- Ngôn ngữ chính
- Python
- Star
- 15.8k
- Fork
- 5.6k
- Merge trung bình
- 5 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 99
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của saltstack/salt
-
[Bug]: Scheduled returns scan all accepted minion keys causing extreme loadCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
saltstack/salt#70789 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[Bug]: pip.installed with upgrade=True upgrades a package but returns an empty changes dictionaryCó thể đã có người làm @ITJamie đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
[Bug]: Minion with file_client: local crashes on connect: 'AsyncPillar' object has no attribute 'aclose'Có thể đã có người làm @shawnrruss đã nhận 9 ngày trước. Đang mởbug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 3 ngày
-
[Bug]: mine.update clear=True raises UnboundLocalError on the master and stores nothingCó thể đã có người làm @cestercian đã nhận 11 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
saltstack/salt#70622 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của saltstack/salt
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
btclib-org/btclib-wallet#872 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
btclib-org/btclib#3093 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
patrickballard/wheelgap#269 ·
-
priority: low python
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
LearningCircuit/local-deep-research#8635 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
README says the land/sea mask must match the XS grid; the demo mask does not, and Step 4 worksĐang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
buckai-observatory/Automated-Cloud-Removal-and-Seamless-Satellite-Image-Mosaicking-Pipeline#52 ·
Maintainer thường phản hồi trong vòng 1 ngày