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

Commit ff80060

Browse files
authored
flip default value on upload_token_required_for_public_repos (#965)
1 parent efbf1e7 commit ff80060

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

graphql_api/tests/test_owner.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,11 @@ def test_fetch_repos_ai_features_enabled_all_repos(self, get_config_mock):
982982
assert data["owner"]["aiEnabledRepos"] == ["b", "a"]
983983

984984
def test_fetch_upload_token_required(self):
985-
owner = OwnerFactory(username="sample-owner", service="github")
985+
owner = OwnerFactory(
986+
username="sample-owner",
987+
service="github",
988+
upload_token_required_for_public_repos=True,
989+
)
986990
query = """{
987991
owner(username: "%s") {
988992
uploadTokenRequired

requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ factory-boy
2020
fakeredis
2121
freezegun
2222
https://github.com/codecov/opentelem-python/archive/refs/tags/v0.0.4a1.tar.gz#egg=codecovopentelem
23-
https://github.com/codecov/shared/archive/26f0db073fe2d6355c227d032e1b27c3602a010c.tar.gz#egg=shared
23+
https://github.com/codecov/shared/archive/9c31870de026a8a3f026f0753b1991e8c832fadb.tar.gz#egg=shared
2424
google-cloud-pubsub
2525
gunicorn>=22.0.0
2626
https://github.com/photocrowd/django-cursor-pagination/archive/f560902696b0c8509e4d95c10ba0d62700181d84.tar.gz

requirements.txt

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ aiodataloader==0.4.0
88
# via -r requirements.in
99
amqp==5.2.0
1010
# via kombu
11-
analytics-python==1.3.0b1
12-
# via shared
1311
annotated-types==0.7.0
1412
# via pydantic
1513
anyio==3.6.1
@@ -33,8 +31,6 @@ attrs==20.3.0
3331
# cattrs
3432
# ddtrace
3533
# jsonschema
36-
backoff==1.6.0
37-
# via analytics-python
3834
billiard==4.2.0
3935
# via celery
4036
boto3==1.20.25
@@ -259,8 +255,6 @@ minio==7.1.13
259255
# shared
260256
mmh3==4.0.1
261257
# via shared
262-
monotonic==1.5
263-
# via analytics-python
264258
multidict==4.7.6
265259
# via yarl
266260
nodeenv==1.5.0
@@ -371,7 +365,6 @@ pytest-mock==3.14.0
371365
python-dateutil==2.9.0.post0
372366
# via
373367
# -r requirements.in
374-
# analytics-python
375368
# botocore
376369
# celery
377370
# django-postgres-extra
@@ -384,9 +377,7 @@ python-redis-lock==4.0.0
384377
# -r requirements.in
385378
# shared
386379
pytz==2022.1
387-
# via
388-
# -r requirements.in
389-
# shared
380+
# via -r requirements.in
390381
pyyaml==6.0.1
391382
# via
392383
# drf-spectacular
@@ -403,7 +394,6 @@ regex==2023.12.25
403394
requests==2.32.3
404395
# via
405396
# -r requirements.in
406-
# analytics-python
407397
# codecovopentelem
408398
# google-api-core
409399
# google-cloud-storage
@@ -421,13 +411,12 @@ sentry-sdk[celery]==2.13.0
421411
# shared
422412
setproctitle==1.1.10
423413
# via -r requirements.in
424-
shared @ https://github.com/codecov/shared/archive/26f0db073fe2d6355c227d032e1b27c3602a010c.tar.gz
414+
shared @ https://github.com/codecov/shared/archive/9c31870de026a8a3f026f0753b1991e8c832fadb.tar.gz
425415
# via -r requirements.in
426416
simplejson==3.17.2
427417
# via -r requirements.in
428418
six==1.16.0
429419
# via
430-
# analytics-python
431420
# click-repl
432421
# ddsketch
433422
# ddtrace
@@ -461,8 +450,6 @@ tlslite-ng==0.8.0b1
461450
# via shared
462451
toml==0.10.2
463452
# via pre-commit
464-
typing==3.7.4.3
465-
# via shared
466453
typing-extensions==4.6.2
467454
# via
468455
# aiodataloader
@@ -471,7 +458,6 @@ typing-extensions==4.6.2
471458
# opentelemetry-sdk
472459
# pydantic
473460
# pydantic-core
474-
# shared
475461
# stripe
476462
tzdata==2024.1
477463
# via celery

upload/tests/views/test_bundle_analysis.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,10 @@ def test_upload_bundle_analysis_tokenless_mismatched_branch(
762762
upload = mocker.patch.object(TaskService, "upload")
763763

764764
commit_sha = "6fd5b89357fc8cdf34d6197549ac7c6d7e5977ef"
765-
repository = RepositoryFactory.create(private=False)
765+
repository = RepositoryFactory.create(
766+
private=False,
767+
author__upload_token_required_for_public_repos=True,
768+
)
766769
CommitFactory.create(repository=repository, commitid=commit_sha, branch="main")
767770

768771
client = APIClient()

upload/tests/views/test_commits.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ def test_create_commit_already_exists(db, client, mocker):
234234
@pytest.mark.parametrize("private", [True, False])
235235
def test_commit_tokenless(db, client, mocker, branch, private):
236236
repository = RepositoryFactory.create(
237-
private=private, author__username="codecov", name="the_repo"
237+
private=private,
238+
author__username="codecov",
239+
name="the_repo",
240+
author__upload_token_required_for_public_repos=True,
238241
)
239242
mocked_call = mocker.patch.object(TaskService, "update_commit")
240243

upload/tests/views/test_reports.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ def test_reports_post_tokenless(client, db, mocker, private, branch, branch_sent
161161
name="the_repo",
162162
author__username="codecov",
163163
author__service="github",
164+
author__upload_token_required_for_public_repos=True,
164165
private=private,
165166
)
166167
commit = CommitFactory(repository=repository)

upload/tests/views/test_uploads.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ def test_uploads_post_tokenless(db, mocker, mock_redis, private, branch, branch_
307307
author__username="codecov",
308308
author__service="github",
309309
private=private,
310+
author__upload_token_required_for_public_repos=True,
310311
)
311312
commit = CommitFactory(repository=repository)
312313
commit.branch = branch
@@ -589,6 +590,7 @@ def test_uploads_post_github_oidc_auth(
589590
name="the_repo",
590591
author__username="codecov",
591592
author__service="github",
593+
author__upload_token_required_for_public_repos=True,
592594
private=False,
593595
)
594596
mock_jwt_decode.return_value = {
@@ -861,6 +863,7 @@ def test_uploads_post_github_enterprise_oidc_auth_jwks_url(
861863
name="the_repo",
862864
author__username="codecov",
863865
author__service="github_enterprise",
866+
author__upload_token_required_for_public_repos=True,
864867
private=False,
865868
)
866869
mock_jwt_decode.return_value = {

0 commit comments

Comments
 (0)