Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 38d9c56

Browse files
committed
merge conflicts
2 parents 2264ee4 + b62fc87 commit 38d9c56

File tree

305 files changed

+4785
-9012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+4785
-9012
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,25 @@ concurrency:
1515
permissions:
1616
contents: "read"
1717
id-token: "write"
18+
issues: "write"
19+
pull-requests: "write"
1820

1921
jobs:
2022
lint:
2123
name: Run Lint
22-
uses: codecov/gha-workflows/.github/workflows/[email protected].24
24+
uses: codecov/gha-workflows/.github/workflows/[email protected].26
2325

2426
build:
2527
name: Build API
26-
uses: codecov/gha-workflows/.github/workflows/[email protected].24
28+
uses: codecov/gha-workflows/.github/workflows/[email protected].26
2729
secrets: inherit
2830
with:
2931
repo: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-api' }}
3032

3133
codecovstartup:
3234
name: Codecov Startup
3335
needs: build
34-
uses: codecov/gha-workflows/.github/workflows/[email protected].24
36+
uses: codecov/gha-workflows/.github/workflows/[email protected].26
3537
secrets: inherit
3638

3739
# ats:
@@ -47,15 +49,15 @@ jobs:
4749
test:
4850
name: Test
4951
needs: [build]
50-
uses: codecov/gha-workflows/.github/workflows/[email protected].24
52+
uses: codecov/gha-workflows/.github/workflows/[email protected].26
5153
secrets: inherit
5254
with:
5355
repo: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-api' }}
5456

5557
build-self-hosted:
5658
name: Build Self Hosted API
5759
needs: [build, test]
58-
uses: codecov/gha-workflows/.github/workflows/[email protected].24
60+
uses: codecov/gha-workflows/.github/workflows/[email protected].26
5961
secrets: inherit
6062
with:
6163
repo: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-api' }}
@@ -64,7 +66,7 @@ jobs:
6466
name: Push Staging Image
6567
needs: [build, test]
6668
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/staging' && github.repository_owner == 'codecov' }}
67-
uses: codecov/gha-workflows/.github/workflows/[email protected].24
69+
uses: codecov/gha-workflows/.github/workflows/[email protected].26
6870
secrets: inherit
6971
with:
7072
environment: staging
@@ -74,7 +76,7 @@ jobs:
7476
name: Push Production Image
7577
needs: [build, test]
7678
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'codecov' }}
77-
uses: codecov/gha-workflows/.github/workflows/[email protected].24
79+
uses: codecov/gha-workflows/.github/workflows/[email protected].26
7880
secrets: inherit
7981
with:
8082
environment: production
@@ -85,7 +87,7 @@ jobs:
8587
needs: [build-self-hosted, test]
8688
secrets: inherit
8789
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'codecov' }}
88-
uses: codecov/gha-workflows/.github/workflows/[email protected].24
90+
uses: codecov/gha-workflows/.github/workflows/[email protected].26
8991
with:
9092
push_rolling: true
9193
repo: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-api' }}

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ check-for-migration-conflicts:
3131
python manage.py check_for_migration_conflicts
3232

3333
test:
34-
COVERAGE_CORE=sysmon python -m pytest --cov=./ --junitxml=junit.xml
34+
COVERAGE_CORE=sysmon python -m pytest --cov=./ --junitxml=junit.xml -o junit_family=legacy
3535

3636
test.unit:
37-
COVERAGE_CORE=sysmon python -m pytest --cov=./ -m "not integration" --cov-report=xml:unit.coverage.xml --junitxml=unit.junit.xml
37+
COVERAGE_CORE=sysmon python -m pytest --cov=./ -m "not integration" --cov-report=xml:unit.coverage.xml --junitxml=unit.junit.xml -o junit_family=legacy
3838

3939
test.integration:
40-
COVERAGE_CORE=sysmon python -m pytest --cov=./ -m "integration" --cov-report=xml:integration.coverage.xml --junitxml=integration.junit.xml
40+
COVERAGE_CORE=sysmon python -m pytest --cov=./ -m "integration" --cov-report=xml:integration.coverage.xml --junitxml=integration.junit.xml -o junit_family=legacy
4141

4242
lint:
4343
make lint.install
@@ -178,6 +178,9 @@ push.self-hosted-rolling:
178178
docker push ${DOCKERHUB_REPO}:rolling_no_dependencies
179179
docker push ${DOCKERHUB_REPO}:rolling
180180

181+
shell:
182+
docker-compose exec api bash
183+
181184
test_env.up:
182185
env | grep GITHUB > .testenv; true
183186
TIMESERIES_ENABLED=${TIMESERIES_ENABLED} docker-compose up -d

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
24.10.1
1+
24.11.1

api/internal/commit/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import logging
22

3+
import shared.reports.api_report_service as report_service
34
from rest_framework import serializers
45
from shared.reports.types import TOTALS_MAP
56

6-
import services.report as report_service
77
from api.internal.owner.serializers import OwnerSerializer
88
from api.shared.commit.serializers import CommitTotalsSerializer
99
from core.models import Commit

api/internal/tests/test_charts.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from pytz import UTC
1414
from rest_framework.exceptions import ValidationError
1515
from rest_framework.reverse import reverse
16+
from shared.django_apps.core.tests.factories import OwnerFactory, RepositoryFactory
1617

1718
from api.internal.chart.filters import apply_default_filters, apply_simple_filters
1819
from api.internal.chart.helpers import (
@@ -23,7 +24,6 @@
2324
)
2425
from codecov.tests.base_test import InternalAPITest
2526
from core.models import Commit
26-
from core.tests.factories import OwnerFactory, RepositoryFactory
2727
from utils.test_utils import Client
2828

2929
fake = faker.Faker()
@@ -56,7 +56,7 @@ def generate_random_totals(
5656
def setup_commits(
5757
repo,
5858
num_commits,
59-
branch="master",
59+
branch="main",
6060
start_date=None,
6161
meets_default_filters=True,
6262
**kwargs,
@@ -251,7 +251,7 @@ def test_apply_simple_filters(self):
251251
end_date = datetime.now()
252252
data = {
253253
"owner_username": self.org1.username,
254-
"branch": "master",
254+
"branch": "main",
255255
"start_date": start_date.isoformat(),
256256
"end_date": end_date.isoformat(),
257257
"repositories": [self.repo1_org1.name, self.repo2_org1.name],
@@ -318,7 +318,7 @@ def test_apply_simple_filters_branch_filtering(self):
318318
for commit in queryset:
319319
assert (
320320
commit.repository.name == self.repo1_org1.name
321-
and commit.branch == "master"
321+
and commit.branch == "main"
322322
) or (
323323
commit.repository.name == branch_test.name and commit.branch == "main"
324324
)
@@ -860,7 +860,7 @@ def setUp(self):
860860

861861
def test_no_permissions(self, mocked_get_permissions):
862862
data = {
863-
"branch": "master",
863+
"branch": "main",
864864
"start_date": timezone.now() - timedelta(7),
865865
"end_date": timezone.now(),
866866
"grouping_unit": "commit",
@@ -879,7 +879,7 @@ def test_no_permissions(self, mocked_get_permissions):
879879
@pytest.mark.skip(reason="flaky, skipping until re write")
880880
def test_get_commits_no_time_grouping(self, mocked_get_permissions):
881881
data = {
882-
"branch": "master",
882+
"branch": "main",
883883
"start_date": timezone.now() - timedelta(7),
884884
"end_date": timezone.now(),
885885
"grouping_unit": "commit",
@@ -897,7 +897,7 @@ def test_get_commits_no_time_grouping(self, mocked_get_permissions):
897897

898898
def test_get_commits_with_time_grouping(self, mocked_get_permissions):
899899
data = {
900-
"branch": "master",
900+
"branch": "main",
901901
"start_date": timezone.now() - timedelta(7),
902902
"end_date": timezone.now(),
903903
"grouping_unit": "day",
@@ -917,7 +917,7 @@ def test_get_commits_with_time_grouping(self, mocked_get_permissions):
917917

918918
def test_get_commits_with_coverage_change(self, mocked_get_permissions):
919919
data = {
920-
"branch": "master",
920+
"branch": "main",
921921
"start_date": timezone.now() - timedelta(7),
922922
"end_date": timezone.now(),
923923
"grouping_unit": "day",

api/internal/tests/test_feature.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
import pytest
44
from django.urls import reverse
55
from rest_framework.test import APITestCase
6+
from shared.django_apps.core.tests.factories import OwnerFactory
67
from shared.django_apps.rollouts.models import (
78
FeatureFlag,
89
FeatureFlagVariant,
910
RolloutUniverse,
1011
)
1112

12-
from codecov_auth.tests.factories import OwnerFactory
1313
from utils.test_utils import Client
1414

1515

api/internal/tests/test_pagination.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from rest_framework.reverse import reverse
22
from rest_framework.test import APITestCase
3+
from shared.django_apps.core.tests.factories import OwnerFactory
34

4-
from codecov_auth.tests.factories import OwnerFactory
55
from utils.test_utils import Client
66

77

api/internal/tests/test_permissions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
from django.test import TestCase, override_settings
44
from rest_framework.exceptions import APIException
5+
from shared.django_apps.core.tests.factories import OwnerFactory, RepositoryFactory
56

67
from api.internal.tests.test_utils import (
78
GetAdminErrorProviderAdapter,
89
GetAdminProviderAdapter,
910
)
1011
from api.shared.permissions import RepositoryPermissionsService, UserIsAdminPermissions
11-
from codecov_auth.tests.factories import OwnerFactory
12-
from core.tests.factories import RepositoryFactory
1312

1413

1514
class MockedPermissionsAdapter:

api/internal/tests/test_repo_accessors.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
from unittest.mock import patch
22

33
from django.test import TestCase
4+
from shared.django_apps.core.tests.factories import OwnerFactory, RepositoryFactory
45
from shared.torngit.exceptions import TorngitClientError, TorngitClientGeneralError
56

67
from api.shared.repo.repository_accessors import RepoAccessors
7-
from codecov_auth.tests.factories import OwnerFactory
8-
from core.tests.factories import RepositoryFactory
98

109

1110
class RepositoryAccessorsTestCase(TestCase):

api/internal/tests/test_views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
from rest_framework import status
55
from rest_framework.reverse import reverse
6-
7-
from codecov.tests.base_test import InternalAPITest
8-
from codecov_auth.tests.factories import OwnerFactory
9-
from core.tests.factories import (
6+
from shared.django_apps.core.tests.factories import (
107
BranchFactory,
118
CommitFactory,
9+
OwnerFactory,
1210
PullFactory,
1311
RepositoryFactory,
1412
)
13+
14+
from codecov.tests.base_test import InternalAPITest
1515
from utils.test_utils import Client
1616

1717
get_permissions_method = (

0 commit comments

Comments
 (0)