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

Commit f4333a7

Browse files
committed
Merge branch 'main' into staging
2 parents 13c72aa + b71179e commit f4333a7

File tree

20 files changed

+1164
-2653
lines changed

20 files changed

+1164
-2653
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' }}

core/signals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def update_repository(
1818
log.info(f"Signal triggered for repository {instance.repoid}")
1919
created: bool = kwargs["created"]
2020
changes: Dict[str, Any] = instance.tracker.changed()
21-
tracked_fields: List[str] = ["name", "upload_token"]
21+
tracked_fields: List[str] = ["name", "upload_token", "activated", "active"]
2222

2323
if created or any([field in changes for field in tracked_fields]):
2424
data = {

core/tests/test_signals.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ def test_shelter_repo_sync(mocker):
1010
publish = mocker.patch("google.cloud.pubsub_v1.PublisherClient.publish")
1111

1212
# this triggers the publish via Django signals
13-
repo = RepositoryFactory(repoid=91728376, author=OwnerFactory(ownerid=555))
13+
repo = RepositoryFactory(
14+
repoid=91728376, author=OwnerFactory(ownerid=555), active=False, activated=False
15+
)
1416

1517
# triggers publish on create
1618
publish.assert_has_calls(
@@ -38,13 +40,27 @@ def test_shelter_repo_sync(mocker):
3840
b'{"type": "repo", "sync": "one", "id": 91728376}',
3941
)
4042

43+
# Does not trigger another publish with untracked field
4144
repo.message = "foo"
4245
repo.save()
4346

4447
publish_calls = publish.call_args_list
45-
# does not trigger another publish
4648
assert len(publish_calls) == 3
4749

50+
# Triggers call when active is changed
51+
repo.active = True
52+
repo.save()
53+
54+
publish_calls = publish.call_args_list
55+
assert len(publish_calls) == 4
56+
57+
# Triggers call when activated is changed
58+
repo.activated = True
59+
repo.save()
60+
61+
publish_calls = publish.call_args_list
62+
assert len(publish_calls) == 5
63+
4864

4965
@pytest.mark.django_db
5066
def test_shelter_commit_sync(mocker):

graphql_api/tests/test_flake_aggregates.py

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)