Skip to content

Add retry responses for pyforgejo 2.0.7 in forgejo test cassette#986

Merged
majamassarini merged 1 commit into
packit:mainfrom
majamassarini:fix-pyforgejo-2.0.7-retry-cassette
May 20, 2026
Merged

Add retry responses for pyforgejo 2.0.7 in forgejo test cassette#986
majamassarini merged 1 commit into
packit:mainfrom
majamassarini:fix-pyforgejo-2.0.7-retry-cassette

Conversation

@majamassarini

Copy link
Copy Markdown
Member

pyforgejo changed its default retry behavior between versions 2.0.4 and 2.0.7:

  • pyforgejo 2.0.4: max_retries defaults to 0 (no retries, 1 HTTP call)
  • pyforgejo 2.0.7: max_retries defaults to 2 (2 retries, 3 HTTP calls total)

The test_issue_no_such_assignee test expects a 500 Internal Server Error response when attempting to add a non-existent user as an assignee. This is the actual behavior of the Forgejo API, and the test verifies that ogr properly converts this to a GitForgeInternalError.

Compatibility with both versions:

  • pyforgejo 2.0.4 (F43): Uses first response, leaves 2 unused (safe)
  • pyforgejo 2.0.7 (Rawhide): Consumes all 3 responses during retries

Fixes test failure in Fedora Rawhide with python3-pyforgejo-2.0.7.

pyforgejo changed its default retry behavior between versions 2.0.4 and 2.0.7:

- pyforgejo 2.0.4: max_retries defaults to 0 (no retries, 1 HTTP call)
- pyforgejo 2.0.7: max_retries defaults to 2 (2 retries, 3 HTTP calls total)

The test_issue_no_such_assignee test expects a 500 Internal Server Error
response when attempting to add a non-existent user as an assignee. This
is the actual behavior of the Forgejo API, and the test verifies that ogr
properly converts this to a GitForgeInternalError.

Compatibility with both versions:
- pyforgejo 2.0.4 (F43): Uses first response, leaves 2 unused (safe)
- pyforgejo 2.0.7 (Rawhide): Consumes all 3 responses during retries

Fixes test failure in Fedora Rawhide with python3-pyforgejo-2.0.7.
@majamassarini majamassarini requested a review from a team as a code owner May 20, 2026 10:30
@majamassarini majamassarini requested review from betulependule and removed request for a team May 20, 2026 10:30

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the integration test data for Forgejo by adding two new recorded HTTP interactions to the Issues.test_issue_no_such_assignee.yaml cassette. These entries record 500 status code responses from the Forgejo API swagger endpoint. I have no feedback to provide.

@centosinfra-prod-github-app

Copy link
Copy Markdown
Contributor

@mfocko

mfocko commented May 20, 2026

Copy link
Copy Markdown
Member

It returns 500 for non-existing user?

@mfocko mfocko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I don't have any issue with merging this, but I'm also going to have a look at the Forgejo itself. Based on the API docs, I would suspect this should yield 412 — APIError is error format response.

@majamassarini

Copy link
Copy Markdown
Member Author

It returns 500 for non-existing user?

yes, you can see it in the registered file ( I mean in those lines I haven't touched)

@majamassarini

Copy link
Copy Markdown
Member Author

In general I don't have any issue with merging this, but I'm also going to have a look at the Forgejo itself. Based on the API docs, I would suspect this should yield 412 — APIError is error format response.

Ok thanks! I will merge this one as it is so that the rawhide tests start working again.
If the behaviour changes in a future version of forgejo we will know where to change the status code :)

@majamassarini majamassarini merged commit c40521c into packit:main May 20, 2026
21 of 22 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in Packit pull requests May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants