This repository was archived by the owner on Jun 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1111from rest_framework .views import APIView
1212from shared .api_archive .archive import ArchiveService
1313from shared .bundle_analysis .storage import StoragePaths , get_bucket_name
14- from shared .events .amplitude import AmplitudeEventPublisher
14+ from shared .events .amplitude import UNKNOWN_USER_OWNERID , AmplitudeEventPublisher
1515from shared .metrics import Counter , inc_counter
1616
1717from codecov_auth .authentication .repo_auth import (
@@ -224,7 +224,9 @@ def post(self, request: HttpRequest) -> Response:
224224 AmplitudeEventPublisher ().publish (
225225 "Upload Sent" ,
226226 {
227- "user_ownerid" : commit .author .ownerid if commit .author else - 1 ,
227+ "user_ownerid" : commit .author .ownerid
228+ if commit .author
229+ else UNKNOWN_USER_OWNERID ,
228230 "ownerid" : repo .author .ownerid ,
229231 "repoid" : repo .repoid ,
230232 "commitid" : commit .id , # Not commit.commitid, we do not want a commit SHA here!
Original file line number Diff line number Diff line change 88from rest_framework .response import Response
99from rest_framework .views import APIView
1010from shared .api_archive .archive import ArchiveService , MinioEndpoints
11- from shared .events .amplitude import AmplitudeEventPublisher
11+ from shared .events .amplitude import UNKNOWN_USER_OWNERID , AmplitudeEventPublisher
1212from shared .metrics import inc_counter
1313
1414from codecov_auth .authentication .repo_auth import (
@@ -191,7 +191,9 @@ def post(self, request):
191191 AmplitudeEventPublisher ().publish (
192192 "Upload Sent" ,
193193 {
194- "user_ownerid" : commit .author .ownerid if commit .author else - 1 ,
194+ "user_ownerid" : commit .author .ownerid
195+ if commit .author
196+ else UNKNOWN_USER_OWNERID ,
195197 "ownerid" : repo .author .ownerid ,
196198 "repoid" : repo .repoid ,
197199 "commitid" : commit .id , # Not commit.commitid, we do not want a commit SHA here!
You can’t perform that action at this time.
0 commit comments