Learn more about these different git repos.
Other Git URLs
We didn't pin the pygit2 version and the current release contains a lot breaking changes that affect pagure. Currently unit tests failing, everything related deprecated features that were now removed, e.g. :
FAILED tests/test_pagure_merge_pr_no_fork.py::PagureMergePrNoForkTest::test_api_pull_request_diffstats_no_fork - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_pagure_merge_pr_no_fork.py::PagureMergePrNoForkTest::test_api_pull_request_merge_no_fork - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_pagure_merge_pr_no_fork.py::PagureMergePrNoForkTest::test_internal_merge_status - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_pagure_merge_pr_no_fork.py::PagureMergePrNoForkTest::test_ui_pull_request_merge_no_fork - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_pagure_merge_pr_no_fork.py::PagureMergePrNoForkTest::test_ui_pull_request_merge - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_pagure_merge_pr_no_fork.py::PagureMergePrNoForkTest::test_internal_merge_status_no_fork - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_pagure_send_notification.py::PagureHooksDefault::test_send_notifications - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_pagure_send_notification.py::PagureHooksDefault::test_send_action_notification - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_pagure_utils.py::PagureUtilsTests::test_lookup_deploykey_different_project - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_pagure_merge_pr_no_fork.py::PagureMergePrNoForkTest::test_api_pull_request_merge - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_pagure_utils.py::PagureUtilsTests::test_lookup_deploykey_non_existent_key - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_pagure_merge_pr_no_fork.py::PagureMergePrNoForkTest::test_api_pull_request_diffstats - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_pagure_utils.py::PagureUtilsTests::test_lookup_deploykey_non_deploykey - AttributeError: '_pygit2.Oid' object has no attribute 'hex' FAILED tests/test_style.py::TestStyle::test_code_with_flake8 - AssertionError: 1 != 0 FAILED tests/test_pagure_utils.py::PagureUtilsTests::test_lookup_deploykey - AttributeError: '_pygit2.Oid' object has no attribute 'hex' ======================================================= 508 failed, 1158 passed, 3 skipped, 6140 warnings in 1081.69s (0:18:01) =======================================================
https://github.com/libgit2/pygit2/blob/master/CHANGELOG.md
1.15.0 (2024-05-18)
Many deprecated features have been removed, see below
Upgrade to libgit2 v1.8.1
New push_options optional argument in Repository.push(...) #1282
push_options
Repository.push(...)
New support comparison of Oid with text string
Oid
Fix CheckoutNotify.IGNORED #1288
CheckoutNotify.IGNORED
Use default error handler when decoding/encoding paths #537
Remove setuptools runtime dependency #1281
Coding style with ruff #1280
Add wheels for ppc64le #1279
Fix tests on EPEL8 builds for s390x #1283
Deprecations:
IndexEntry.hex
str(IndexEntry.id)
Breaking changes:
oid.hex
str(oid)
object.hex
str(object.id)
Remove deprecated object.oid, use object.id
object.oid
object.id
Remove deprecated Repository.add_submodule(...), use Repository.submodules.add(...)
Repository.add_submodule(...)
Repository.submodules.add(...)
Repository.lookup_submodule(...)
Repository.submodules[...]
Repository.init_submodules(...)
Repository.submodules.init(...)
Remove deprecated Repository.update_submodule(...), use Repository.submodules.update(...)
Repository.update_submodule(...)
Repository.submodules.update(...)
Remove deprecated constants GIT_OBJ_XXX, use ObjectType
GIT_OBJ_XXX
ObjectType
GIT_REVPARSE_XXX
RevSpecFlag
GIT_REF_XXX
ReferenceType
ReferenceType.OID
ReferenceType.DIRECT
Remove deprecated ReferenceType.LISTALL, use instead ReferenceType.ALL
ReferenceType.LISTALL
ReferenceType.ALL
Remove deprecated support for passing dicts to repository\'s merge(...), merge_commits(...) and merge_trees(...). Instead pass MergeFlag for flags, and MergeFileFlag for file_flags.
merge(...)
merge_commits(...)
merge_trees(...)
MergeFlag
flags
MergeFileFlag
file_flags
Remove deprecated support for passing a string for the favor argument to repository\'s merge(...), merge_commits(...) and merge_trees(...). Instead pass MergeFavor.
MergeFavor
I invested a couple of hours with the attempt to clean our tech debts and make everything pygit 1.15.0 compatible. It's a massive amount of work and I had to give up for now. PR https://pagure.io/pagure/pull-request/5493 will pin the version to <1.15.0 for pip.
For now it's also not a problem in Fedora: - F39, F40, F41: python-pygit2-1.14.0 - EPEL 8, 9: python-pygit2-0.26.4
I did a validation what we actually use from the deprecated list. Most of it was deprecated in versions earlier than the one there are in EPEL. So overall it's pretty safe to just move to the recommended successors.
What I struggled with: It's very hard to identify what type the variable currently is (str or pygit obj) and if str(object.id), object.id or str(oid) has to be used. It becomes even more confusing with things like repo_obj.head.peel().oid.hex or repo_obj.revparse_single(first_commit.parents[0].oid.hex). The pygit2 documentation is pretty thin on that too.
repo_obj.head.peel().oid.hex
repo_obj.revparse_single(first_commit.parents[0].oid.hex)
Long story short, that is a backlog topic and something for July/August, too busy in June to further work on it.
* 0.20.2 (2014-02-04), Remove deprecated oid.hex, use str(oid) * 0.20.2 (2014-02-04), Remove deprecated object.hex, use str(object.id) * 0.20.2 (2014-02-04), Remove deprecated object.oid, use object.id ! 1.14.0 (2024-01-26), Remove deprecated Repository.add_submodule(...), use Repository.submodules.add(...) - not in use ! 1.14.0 (2024-01-26), Remove deprecated Repository.lookup_submodule(...), use Repository.submodules[...] - not in use ! 1.14.0 (2024-01-26), Remove deprecated Repository.init_submodules(...), use Repository.submodules.init(...) - not in use ! 1.14.0 (2024-01-26), Remove deprecated Repository.update_submodule(...), use Repository.submodules.update(...) - not in use ! 1.14.0 (2024-01-26), Remove deprecated constants GIT_OBJ_XXX, use ObjectType - in use by a couple of tests ! 1.14.0 (2024-01-26), Remove deprecated constants GIT_REVPARSE_XXX, use RevSpecFlag - not in use ! 1.14.0 (2024-01-26), Remove deprecated constants GIT_REF_XXX, use ReferenceType - not in use ! 1.14.1 (2024-02-10), Remove deprecated ReferenceType.OID, use instead ReferenceType.DIRECT - not in use ! 1.14.1 (2024-02-10), Remove deprecated ReferenceType.LISTALL, use instead ReferenceType.ALL - not in use ! 1.14.0 (2024-01-26), Remove deprecated support for passing dicts to repository's merge(...), merge_commits(...) and merge_trees(...). Instead pass MergeFlag for flags, and MergeFileFlag for file_flags. - unknown ! 1.14.0 (2024-01-26), Remove deprecated support for passing a string for the favor argument to repository's merge(...), merge_commits(...) and merge_trees(...). Instead pass MergeFavor. - unknown
Metadata Update from @wombelix: - Assignee reset
Commit 0c13cf0 relates to this ticket
Metadata Update from @wombelix: - Issue assigned to wombelix
Edit: looks like I have a fix for this (dump/reload and plugin install are still broken, but those might be unrelated problems, the tests have never fully passed in Debian); I'll apply it to master and open a real pull request.
(Background: I am a Debian Maintainer currently in the process of taking over Debian's pagure package. This package is currently broken, because Debian unstable has pygit2 1.16. While I am aware that pagure is old and Fedora is in the process of moving its infrastructure off it, I think it is the only git forge we have in main - gitlab is in contrib (despite being what Debian's own git infrastructure runs) and forgejo is still in the process of being packaged (adding new packages to Debian is often a long process).)
Patches so far (20, 22 and 33 are the relevant ones; security warning, do NOT pull from random salsa.debian.org repositories without looking, Debian's security boundary is between git main and package upload, not the more usual between git pull request and git main) https://salsa.debian.org/rnpalmer-guest/pagure/-/tree/ad365c564e78e218cb0887169511ede25e5dc8e5/debian/patches CI logs https://salsa.debian.org/rnpalmer-guest/pagure/-/jobs/6910095/raw https://salsa.debian.org/rnpalmer-guest/pagure/-/jobs/6910096/raw
Fedora 41 now have python3-pygit2 1.16.0 and we have a new update to 1.17.0
https://salsa.debian.org/rnpalmer-guest/pagure/-/blob/master/debian/patches/0019-create_remote-removed.patch https://salsa.debian.org/rnpalmer-guest/pagure/-/blob/master/debian/patches/0020-pygit2-hex-oid-removed.patch https://salsa.debian.org/rnpalmer-guest/pagure/-/blob/master/debian/patches/0022-pygit2-git_obj_commit-removed.patch
more these 2 https://salsa.debian.org/rnpalmer-guest/pagure/-/raw/master/debian/patches/0014-imp-pygit2remote-renamed.patch
https://salsa.debian.org/rnpalmer-guest/pagure/-/blob/master/debian/patches/0016-use-markupsafe-markup.patch
https://salsa.debian.org/rnpalmer-guest/pagure/-/blob/master/debian/patches/0021-bleach-now-frozenset.patch and https://salsa.debian.org/rnpalmer-guest/pagure/-/blob/master/debian/patches/0012-assume-new-chardet.patch are also important
and replace jinja2.escape by markupsafe.escape in doc_utils.py and seems now I have my local pagure back in business
I have now filed a real pull request for this.
(Against master; Debian itself has a bigger patch stack because it's still on 5.14.x.)
I have now filed a real pull request for this. (Against master; Debian itself has a bigger patch stack because it's still on 5.14.x.)
Fedora 41 also have pagure-5.14.1 so could be interesting also add the patches to 5.14.x branch https://pagure.io/pagure/commits/5.14.x
Thank you
@sergiomb I've now tried to sort my 5.14 patches into what is generally useful and what is Debian-specific; they still fail a few tests, but they fail far fewer than stock 5.14.
(It's a big enough patch stack that I'm considering the option of instead packaging git HEAD.)
https://salsa.debian.org/debian/pagure/-/blob/master/debian/patches/series?ref_type=heads
Log in to comment on this ticket.