-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add base support for forgejo #891
Add base support for forgejo #891
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: ogr/abstract.py
Did you find this useful? React with a 👍 or 👎 |
0ecd191
to
e4efa68
Compare
@pytest.mark.parametrize( | ||
"kwargs_", | ||
[ | ||
pytest.param( | ||
{"repo": "test", "namespace": "packit"}, | ||
id="create project with namespace", | ||
), | ||
pytest.param( | ||
{"repo": "test", "namespace": None}, | ||
id="create project without namespace", | ||
), | ||
pytest.param( | ||
{"repo": "test_1", "namespace": None, "description": "A repo description"}, | ||
id="create project with description", | ||
), | ||
], | ||
) | ||
@record(what="pyforgejo.core.http_client.HttpClient.request") | ||
def test_project_create(service, kwargs_): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used pytest+params
here instead of unittest+inheritance
because I like the way pytest can save us code duplication. But I am fine to go back using unittest for maintaining code compatibility in tests with other modules.
e4efa68
to
24ccfdb
Compare
Build succeeded. ✔️ pre-commit SUCCESS in 2m 49s |
24ccfdb
to
0f0c118
Compare
Build succeeded. ✔️ pre-commit SUCCESS in 2m 49s |
tests in testing-farm are failing because python-pyforgejo in Fedora is still using pypi version 1. My code is based on pypi version 2.0. Should I somehow force pyforgejo installation directly from pypi both for Fedora and EPEL images? |
@majamassarini yes temporarily installing from PyPI makes sense. We could also try to ping the maintainers (also asking about epel), but since it's a major version update, it might not help with stable Fedoras. |
Feat/httpx TODO: Write new tests or update the old ones to cover new functionality. Update doc-strings where appropriate. Update or write new documentation in packit/packit.dev. ‹fill in› Fixes Related to packit/ogr#891 Merge before/after RELEASE NOTES BEGIN requre now supports recording of the requests done by httpx via record_httpx() and recording_httpx() decorators. RELEASE NOTES END Reviewed-by: Nikola Forró Reviewed-by: František Lachman <[email protected]> Reviewed-by: Matej Focko
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, if we want to go with the cached_property
, though I don't expect any reasons why not (it could cause problems only during tests)
- requre.cassette | ||
- pyforgejo.core.http_client | ||
- request | ||
output: !!binary | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be in binary 👀
though should be fixed after re-recording with my commit for requre support
Build failed. ✔️ pre-commit SUCCESS in 2m 50s |
Build failed. ❌ pre-commit FAILURE in 2m 51s |
316fbcc
to
68af763
Compare
Build succeeded. ✔️ pre-commit SUCCESS in 2m 49s |
1276c92
to
3c03130
Compare
Build succeeded. ✔️ pre-commit SUCCESS in 2m 56s |
3c03130
to
7a2331c
Compare
Build succeeded. ✔️ pre-commit SUCCESS in 2m 51s |
7a2331c
to
70bc48d
Compare
Build succeeded. ✔️ pre-commit SUCCESS in 2m 54s |
files/tasks/rpm-test-deps.yaml
Outdated
pip: | ||
name: | ||
- flexmock | ||
- pyforgejo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically speaking it's not a test dependency, shouldn't the one line in zuul-install-requirements-pip.yaml
be enough?
Build succeeded. ✔️ pre-commit SUCCESS in 2m 47s |
Build succeeded. ✔️ pre-commit SUCCESS in 2m 55s |
Co-authored-by: Matej Focko <[email protected]> Signed-off-by: Matej Focko <[email protected]>
Signed-off-by: Matej Focko <[email protected]>
Signed-off-by: Matej Focko <[email protected]>
Build succeeded. ✔️ pre-commit SUCCESS in 2m 55s |
/packit retest-failed |
Skimming through the Testing Farm logs, it appears that even if the ‹pyforgejo› is installed via ‹pip› during the ‹prepare› phase, it still installs the ‹1.0.2› version instead of the latest ‹2.0.0› that is required from within the ‹ogr›'s implementation. Logs from the Testing Farm: 14:15:02 prepare wrapper: /var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-prepare-wrapper.sh-default-3-default-0 14:15:02 script: pip3 install pyforgejo 14:15:02 Workdir '/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/prepare/default-3' created. 14:15:02 Write file '/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-prepare-wrapper.sh-default-3-default-0'. 14:15:02 Copy '/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-prepare-wrapper.sh-default-3-default-0' to '/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-prepare-wrapper.sh-default-3-default-0' on the guest. 14:15:02 Run command: rsync -s -p --chmod=755 -e 'ssh -oForwardX11=no -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oConnectionAttempts=5 -oConnectTimeout=60 -oServerAliveInterval=5 -oServerAliveCountMax=60 -oIdentitiesOnly=yes -p22 -i /etc/citool.d/id_rsa_artemis -oPasswordAuthentication=no -S/var/ARTIFACTS/work-fullm6vdjuvi/ssh-sockets/18.117.139.241-22-root.socket' /var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-prepare-wrapper.sh-default-3-default-0 [email protected]:/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-prepare-wrapper.sh-default-3-default-0 14:15:02 environment 14:15:02 Command returned '0' (success). 14:15:02 Execute command 'export TMT_TOPOLOGY_YAML=/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-test-topology-default-3-default-0.yaml; export TMT_TOPOLOGY_BASH=/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-test-topology-default-3-default-0.sh; export PACKIT_BUILD_LOG_URL=https://download.copr.fedorainfracloud.org/results/packit/packit-ogr-891/fedora-41-x86_64/08655130-python-ogr/builder-live.log; export PACKIT_COMMIT_SHA=70bc48d8faf182674bde3ef9133e1c65a898536a; export PACKIT_COPR_PROJECT=packit/packit-ogr-891; export PACKIT_COPR_RPMS=python3-ogr-0.50.4.post1.dev5+g70bc48d-1.20250214140910645338.pr891.5.g70bc48d.fc41.noarch; export PACKIT_DOWNSTREAM_NAME=python-ogr; export PACKIT_DOWNSTREAM_URL=https://src.fedoraproject.org/rpms/python-ogr.git; export PACKIT_FULL_REPO_NAME=packit/ogr; export PACKIT_PACKAGE_NAME=python-ogr; export PACKIT_PACKAGE_NVR=python-ogr-0.50.4.post1.dev5+g70bc48d-1.20250214140910645338.pr891.5.g70bc48d.fc41; export PACKIT_PR_ID=891; export PACKIT_SOURCE_BRANCH=fix/ogr/875; export PACKIT_SOURCE_SHA=70bc48d8faf182674bde3ef9133e1c65a898536a; export PACKIT_SOURCE_URL=https://github.com/majamassarini/ogr; export PACKIT_SRPM_URL=https://download.copr.fedorainfracloud.org/results/packit/packit-ogr-891/srpm-builds/08655130/python-ogr-0.50.4.post1.dev5+g70bc48d-1.20250214140910645338.pr891.5.g70bc48d.src.rpm; export PACKIT_TARGET_BRANCH=main; export PACKIT_TARGET_SHA=4a3d53fb4582a52462af1158690df513720df793; export PACKIT_TARGET_URL=https://github.com/packit/ogr; export PACKIT_UPSTREAM_NAME=ogr; export PACKIT_UPSTREAM_URL=https://github.com/packit/ogr; export TESTING_FARM_REQUEST_ID=cbc23977-9dd8-48fd-aef9-68e59bf55dbe; export TESTING_FARM_TEST_TYPE=fmf; export TESTING_FARM_GIT_URL=https://github.com/majamassarini/ogr; export TESTING_FARM_GIT_REF=70bc48d8faf182674bde3ef9133e1c65a898536a; export TMT_PLAN_DATA=/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/data; export TMT_PLAN_ENVIRONMENT_FILE=/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/data/variables.env; export TMT_TREE=/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree; export TMT_VERSION=1.42.1; cd /var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree; /var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-prepare-wrapper.sh-default-3-default-0' on guest '18.117.139.241'. 14:15:02 Run command: ssh -oForwardX11=no -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oConnectionAttempts=5 -oConnectTimeout=60 -oServerAliveInterval=5 -oServerAliveCountMax=60 -oIdentitiesOnly=yes -p22 -i /etc/citool.d/id_rsa_artemis -oPasswordAuthentication=no -S/var/ARTIFACTS/work-fullm6vdjuvi/ssh-sockets/18.117.139.241-22-root.socket [email protected] 'export TMT_TOPOLOGY_YAML=/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-test-topology-default-3-default-0.yaml; export TMT_TOPOLOGY_BASH=/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-test-topology-default-3-default-0.sh; export PACKIT_BUILD_LOG_URL=https://download.copr.fedorainfracloud.org/results/packit/packit-ogr-891/fedora-41-x86_64/08655130-python-ogr/builder-live.log; export PACKIT_COMMIT_SHA=70bc48d8faf182674bde3ef9133e1c65a898536a; export PACKIT_COPR_PROJECT=packit/packit-ogr-891; export PACKIT_COPR_RPMS=python3-ogr-0.50.4.post1.dev5+g70bc48d-1.20250214140910645338.pr891.5.g70bc48d.fc41.noarch; export PACKIT_DOWNSTREAM_NAME=python-ogr; export PACKIT_DOWNSTREAM_URL=https://src.fedoraproject.org/rpms/python-ogr.git; export PACKIT_FULL_REPO_NAME=packit/ogr; export PACKIT_PACKAGE_NAME=python-ogr; export PACKIT_PACKAGE_NVR=python-ogr-0.50.4.post1.dev5+g70bc48d-1.20250214140910645338.pr891.5.g70bc48d.fc41; export PACKIT_PR_ID=891; export PACKIT_SOURCE_BRANCH=fix/ogr/875; export PACKIT_SOURCE_SHA=70bc48d8faf182674bde3ef9133e1c65a898536a; export PACKIT_SOURCE_URL=https://github.com/majamassarini/ogr; export PACKIT_SRPM_URL=https://download.copr.fedorainfracloud.org/results/packit/packit-ogr-891/srpm-builds/08655130/python-ogr-0.50.4.post1.dev5+g70bc48d-1.20250214140910645338.pr891.5.g70bc48d.src.rpm; export PACKIT_TARGET_BRANCH=main; export PACKIT_TARGET_SHA=4a3d53fb4582a52462af1158690df513720df793; export PACKIT_TARGET_URL=https://github.com/packit/ogr; export PACKIT_UPSTREAM_NAME=ogr; export PACKIT_UPSTREAM_URL=https://github.com/packit/ogr; export TESTING_FARM_REQUEST_ID=cbc23977-9dd8-48fd-aef9-68e59bf55dbe; export TESTING_FARM_TEST_TYPE=fmf; export TESTING_FARM_GIT_URL=https://github.com/majamassarini/ogr; export TESTING_FARM_GIT_REF=70bc48d8faf182674bde3ef9133e1c65a898536a; export TMT_PLAN_DATA=/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/data; export TMT_PLAN_ENVIRONMENT_FILE=/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/data/variables.env; export TMT_TREE=/var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree; export TMT_VERSION=1.42.1; cd /var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree; /var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-prepare-wrapper.sh-default-3-default-0' 14:15:02 cmd: /var/ARTIFACTS/work-fullm6vdjuvi/plans/full/tree/tmt-prepare-wrapper.sh-default-3-default-0 14:15:02 environment 14:15:03 out: Requirement already satisfied: pyforgejo in /usr/lib/python3.13/site-packages (1.0.2) 14:15:03 out: Requirement already satisfied: attrs>=21.3.0 in /usr/lib/python3.13/site-packages (from pyforgejo) (24.2.0) 14:15:03 out: Requirement already satisfied: httpx>=0.20.0 in /usr/lib/python3.13/site-packages (from pyforgejo) (0.27.0) 14:15:03 out: Requirement already satisfied: python-dateutil<3.0.0,>=2.8.0 in /usr/lib/python3.13/site-packages (from pyforgejo) (2.8.2) 14:15:03 out: Requirement already satisfied: anyio in /usr/lib/python3.13/site-packages (from httpx>=0.20.0->pyforgejo) (3.7.1) 14:15:03 out: Requirement already satisfied: certifi in /usr/lib/python3.13/site-packages (from httpx>=0.20.0->pyforgejo) (2023.5.7) 14:15:03 out: Requirement already satisfied: httpcore==1.* in /usr/lib/python3.13/site-packages (from httpx>=0.20.0->pyforgejo) (1.0.5) 14:15:03 out: Requirement already satisfied: idna in /usr/lib/python3.13/site-packages (from httpx>=0.20.0->pyforgejo) (3.7) 14:15:03 out: Requirement already satisfied: sniffio in /usr/lib/python3.13/site-packages (from httpx>=0.20.0->pyforgejo) (1.3.1) 14:15:03 out: Requirement already satisfied: h11<0.15,>=0.13 in /usr/lib/python3.13/site-packages (from httpcore==1.*->httpx>=0.20.0->pyforgejo) (0.14.0) 14:15:03 out: Requirement already satisfied: six>=1.5 in /usr/lib/python3.13/site-packages (from python-dateutil<3.0.0,>=2.8.0->pyforgejo) (1.16.0) 14:15:03 err: WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning. 14:15:03 Command returned '0' (success). Signed-off-by: Matej Focko <[email protected]>
Since there is no official release of pyforgejo into the Fedora and it's also a breaking release, so there is a rather small chance of merging breaking changes into already released Fedoras, we can still build our own pyforgejo with the latest version that we aim to support. Signed-off-by: Matej Focko <[email protected]>
When running the tests we also need the Copr repo with pyforgejo… Signed-off-by: Matej Focko <[email protected]>
6199103
to
f14131e
Compare
Build succeeded. ✔️ pre-commit SUCCESS in 2m 51s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 2m 48s |
b92e58e
into
packit:main
Fixes #875