-
Notifications
You must be signed in to change notification settings - Fork 110
[Integration][Gitlab-V2] Handle HTTP error codes #1735
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
Conversation
CI Feedback 🧐(Feedback updated until commit eb19a25)A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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.
LGTM
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.
How do we handle logs when a CI/CD does not exist and we want to skip ?
User description
Description
What - Implement graceful handling of HTTP error codes (401, 403, 404) in GitLab integration to prevent resync failures when accessing resources without proper permissions or when resources don't exist.
Why - Currently, the integration fails when encountering 401, 403, or 404 errors, particularly when trying to access pipelines or jobs for projects without CI/CD enabled. This causes the entire resync process to fail instead of gracefully skipping these resources.
How -
Type of change
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examples
folder in the integration directory.Preflight checklist
Screenshots
Include screenshots from your environment showing how the resources of the integration will look.
API Documentation
Provide links to the API documentation used for this integration.
PR Type
Bug fix, Tests
Description
Gracefully handle 401, 403, and 404 errors in GitLab API client
Enhance error handling in paginated resource fetching
Add comprehensive tests for 401 and 403 error handling
Changes walkthrough 📝
base_client.py
Graceful handling of 401/403/404 errors in API requests
integrations/gitlab-v2/gitlab/clients/base_client.py
rest_client.py
Robust error handling in paginated and file resource fetching
integrations/gitlab-v2/gitlab/clients/rest_client.py
gracefully
test_base_client.py
Tests for 401 and 403 error handling in API client
integrations/gitlab-v2/tests/clients/test_base_client.py