Skip to content

fix: prevent 'None' git service in CI uploads - #790

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/ci-git-service-detection
Open

fix: prevent 'None' git service in CI uploads#790
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/ci-git-service-detection

Conversation

@sentry

@sentry sentry Bot commented Sep 12, 2026

Copy link
Copy Markdown

This PR addresses an issue where the git_service parameter could be None during an upload, leading to the literal string "None" being interpolated into the upload URL. This caused a Pydantic validation error on the backend, as "None" is not a valid git service.

The root cause was that the _get_git_service method in CI adapters often returned None (the default from the base class), forcing reliance on git ls-remote parsing of the remote URL. This parsing can fail in environments with non-standard or proxied git remote URLs.

To fix this, _get_git_service has been overridden in the following CI adapters to provide a reliable git service based on the CI environment:

  • GithubActionsCIAdapter: Returns "github"
  • GitlabCIAdapter: Returns "gitlab"
  • BitbucketAdapter: Returns "bitbucket"
  • HarnessAdapter: Attempts to parse the git service from various Harness/Drone environment variables, falling back to None if unsuccessful.

These changes ensure that for common CI environments, a valid git service is provided, preventing the None value from reaching the URL construction and causing the validation error.

Fixes CLI-H5

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
723 1 722 1
View the full list of 1 ❄️ flaky test(s)
api.temp.calculator.test_calculator::test_divide

Flake rate in main: 100.00% (Passed 0 times, Failed 1726 times)

Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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.

0 participants