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

Commit afd37c6

Browse files
committed
flip default value on upload_token_required_for_public_repos
1 parent efbf1e7 commit afd37c6

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
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

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)