-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance GitUtils class with improved repository information handling #79
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
fernandosantos-br
commented
Jul 23, 2025
- Added new attributes to GitInfo for commit SHA, remote URL, and repository validation.
- Implemented methods to parse repository URLs and set up GitHub authentication.
- Enhanced error handling for invalid Git repositories and fetch operations.
- Improved logic for determining current and base references from CI/CD environments.
- Added support for fetching base references from CircleCI using GitHub API.
- Introduced fallback mechanism for base references and improved logging throughout.
- Added new attributes to GitInfo for commit SHA, remote URL, and repository validation. - Implemented methods to parse repository URLs and set up GitHub authentication. - Enhanced error handling for invalid Git repositories and fetch operations. - Improved logic for determining current and base references from CI/CD environments. - Added support for fetching base references from CircleCI using GitHub API. - Introduced fallback mechanism for base references and improved logging throughout.
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.
Pull Request Overview
This PR enhances the GitUtils class with improved repository information handling and CI/CD environment support. The changes focus on making Git operations more robust, adding better error handling, and expanding support for different CI/CD platforms like CircleCI.
- Improved repository URL parsing with support for SSH and HTTPS formats
- Enhanced CI/CD environment detection including CircleCI support with GitHub API integration
- Added comprehensive error handling and authentication management with proper URL restoration
Comments suppressed due to low confidence (1)
src/codeql_wrapper/infrastructure/git_utils.py:484
- [nitpick] The timeout value of 10 seconds may be too short for API calls in slow network conditions. Consider using a configurable timeout or increasing to 30 seconds.
with urllib.request.urlopen(request, timeout=10) as response:
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>