Skip to content

[IMP] membership_activity_gitlab: retry on 502 and 504 errors#134

Merged
tarteo merged 2 commits into
18.0from
18.0-imp-gitlab-retry-502-error
May 12, 2026
Merged

[IMP] membership_activity_gitlab: retry on 502 and 504 errors#134
tarteo merged 2 commits into
18.0from
18.0-imp-gitlab-retry-502-error

Conversation

@tarteo
Copy link
Copy Markdown
Member

@tarteo tarteo commented Apr 16, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 5, 2026 12:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds resilience to GitLab activity imports by introducing retry behavior for transient upstream failures (502/504) in the membership_activity_gitlab integration, and by enabling transient-error retries at the GitLab client connection level.

Changes:

  • Introduces a use_gitlab decorator to convert GitlabError 502/504 into RetryableJobError with a delay.
  • Applies @use_gitlab to the GitLab “iterated” fetch methods (commits/MRs/issues/notes/approvals).
  • Adds an initial unit test for retry behavior and enables retry_transient_errors=True on the GitLab client connection.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
membership_activity_gitlab/models/project_project.py Adds use_gitlab decorator and applies it to GitLab pagination methods to retry on 502/504.
gitlab/models/gitlab.py Enables transient error retry behavior on the python-gitlab client connection.
membership_activity_gitlab/tests/test_gitlab.py Adds a test asserting 502 becomes a RetryableJobError.
membership_activity_gitlab/tests/__init__.py Registers the new test module for discovery.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gitlab/models/gitlab.py
Comment on lines +22 to +26
gl = gitlab.Gitlab(
url=self.url,
private_token=self.private_token,
retry_transient_errors=True,
)
e.error_message,
seconds=60, # Retry after 1 minute
) from e
raise e
new=mock_get_gitlab_commits_iterated,
):
with self.assertRaises(RetryableJobError):
project.get_gitlab_commits_iterated(1, 100, "2024-01-01", "2024-01-31")
@tarteo tarteo merged commit 0f80b8f into 18.0 May 12, 2026
5 of 7 checks passed
@tarteo tarteo deleted the 18.0-imp-gitlab-retry-502-error branch May 12, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants