Skip to content

fix: infer git service from remote in local adapter for empty upload - #741

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/empty-upload-local-git-service
Open

fix: infer git service from remote in local adapter for empty upload#741
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/empty-upload-local-git-service

Conversation

@sentry

@sentry sentry Bot commented Jul 26, 2026

Copy link
Copy Markdown

This PR addresses an AssertionError occurring during empty-upload when the git_service could not be automatically determined, particularly in local environments without an explicit --git-service flag.

Previously, the LocalAdapter's _get_git_service method returned None, and if the GitVersioningSystem also failed to infer the service (e.g., no configured git remote), the validate_upload_service call would raise a ClickException before the actual upload request was sent. This caused tests to fail and prevented empty-upload from working in such scenarios.

The fix involves:

  • Overriding _get_git_service in codecov_cli/helpers/ci_adapters/local.py to infer the git service from the local git remote URL. This logic mirrors the existing parse_git_service functionality already present in GitVersioningSystem, allowing the CLI to correctly identify the git service (e.g., "github", "gitlab") when a remote is configured.
  • Reverting the redundant early validate_upload_service call in codecov_cli/commands/empty_upload.py to maintain consistency with other CLI commands, which rely on validation within the service layer.

This ensures that empty-upload can successfully determine the git service in common local development setups, allowing the upload process to proceed as expected.

Fixes CLI-FG

@codecov

codecov Bot commented Jul 26, 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 1625 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