Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update shared #995

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
https://github.com/codecov/test-results-parser/archive/996ecb2aaf7767bf4c2944c75835c1ee1eb2b566.tar.gz#egg=test-results-parser
https://github.com/codecov/shared/archive/b186b3c89fe16a4f9512cf160f39cfd262ba2eb8.tar.gz#egg=shared
https://github.com/codecov/shared/archive/609e56d2aa30b26d44cddaba0e1ebd79ba954ac9.tar.gz#egg=shared
https://github.com/codecov/timestring/archive/d37ceacc5954dff3b5bd2f887936a98a668dda42.tar.gz#egg=timestring
asgiref>=3.7.2
analytics-python==1.3.0b1
Expand Down
9 changes: 5 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,12 @@ pyasn1-modules==0.2.8
# via google-auth
pycparser==2.20
# via cffi
pydantic==2.10.3
pydantic==2.10.4
# via
# -r requirements.in
# openai
pydantic-core==2.27.1
# shared
pydantic-core==2.27.2
# via pydantic
pyjwt==2.10.0
# via
Expand Down Expand Up @@ -334,9 +335,9 @@ sentry-sdk==2.13.0
# via
# -r requirements.in
# shared
setuptools==75.6.0
setuptools==75.7.0
# via nodeenv
shared @ https://github.com/codecov/shared/archive/b186b3c89fe16a4f9512cf160f39cfd262ba2eb8.tar.gz#egg=shared
shared @ https://github.com/codecov/shared/archive/609e56d2aa30b26d44cddaba0e1ebd79ba954ac9.tar.gz#egg=shared
# via -r requirements.in
six==1.16.0
# via
Expand Down
1 change: 1 addition & 0 deletions services/tests/test_owner_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def test_get_owner_provider_service_with_installation(self, dbsession, mocker):
assert res.data == expected_data
assert res.token == {
"key": "integration_token",
"username": "installation_1500",
"entity_name": gh_app_key_name(
installation_id=installation.installation_id, app_id=None
),
Expand Down
1 change: 1 addition & 0 deletions services/tests/test_repository_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def test_get_repo_provider_service_github_with_installations(dbsession, mocker,
assert res._on_token_refresh is None
assert res.token == {
"key": "installation_token",
"username": "installation_1300",
"entity_name": gh_app_key_name(
installation_id=installation_1.installation_id,
app_id=installation_1.app_id,
Expand Down
51 changes: 42 additions & 9 deletions services/tests/unit/test_bots.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ def test_select_owner_single_installation(self, dbsession):
dbsession, with_bot=False, ghapp_installations=installations
)
expected = AdapterAuthInformation(
token=Token(key="installation_token_1200_200", entity_name="200_1200"),
token=Token(
key="installation_token_1200_200",
entity_name="200_1200",
username="installation_1200",
),
token_owner=None,
selected_installation_info=GithubInstallationInfo(
id=installations[0].id,
Expand Down Expand Up @@ -184,6 +188,7 @@ def test_select_owner_deprecated_using_integration(self, dbsession):
entity_name=gh_app_key_name(
installation_id=owner.integration_id, app_id=None
),
username="installation_1500",
),
token_owner=None,
selected_installation_info=GithubInstallationInfo(installation_id=1500),
Expand Down Expand Up @@ -220,7 +225,11 @@ def test_select_owner_multiple_installations_default_name(self, dbsession):
dbsession, with_bot=False, ghapp_installations=installations
)
expected = AdapterAuthInformation(
token=Token(key="installation_token_1200_200", entity_name="200_1200"),
token=Token(
key="installation_token_1200_200",
entity_name="200_1200",
username="installation_1200",
),
token_owner=None,
selected_installation_info=GithubInstallationInfo(
id=installations[0].id,
Expand Down Expand Up @@ -261,7 +270,11 @@ def test_select_owner_multiple_installations_custom_name(self, dbsession):
dbsession, with_bot=False, ghapp_installations=installations
)
expected = AdapterAuthInformation(
token=Token(key="installation_token_1300_300", entity_name="300_1300"),
token=Token(
key="installation_token_1300_300",
entity_name="300_1300",
username="installation_1300",
),
token_owner=None,
selected_installation_info=GithubInstallationInfo(
id=installations[1].id,
Expand Down Expand Up @@ -458,7 +471,11 @@ def test_select_repo_single_installation(self, dbsession):
ghapp_installations=installations,
)
expected = AdapterAuthInformation(
token=Token(key="installation_token_1200_200", entity_name="200_1200"),
token=Token(
key="installation_token_1200_200",
entity_name="200_1200",
username="installation_1200",
),
token_owner=None,
selected_installation_info=GithubInstallationInfo(
id=installations[0].id,
Expand Down Expand Up @@ -487,6 +504,7 @@ def test_select_repo_deprecated_using_integration(self, dbsession):
expected = AdapterAuthInformation(
token=Token(
key="installation_token_1500_None",
username="installation_1500",
entity_name=gh_app_key_name(
installation_id=repo.owner.integration_id, app_id=None
),
Expand Down Expand Up @@ -529,7 +547,11 @@ def test_select_repo_multiple_installations_default_name(self, dbsession):
ghapp_installations=installations,
)
expected = AdapterAuthInformation(
token=Token(key="installation_token_1200_200", entity_name="200_1200"),
token=Token(
key="installation_token_1200_200",
entity_name="200_1200",
username="installation_1200",
),
token_owner=None,
selected_installation_info=GithubInstallationInfo(
id=installations[0].id,
Expand Down Expand Up @@ -573,7 +595,11 @@ def test_select_repo_multiple_installations_custom_name(self, dbsession):
ghapp_installations=installations,
)
expected = AdapterAuthInformation(
token=Token(key="installation_token_1300_300", entity_name="300_1300"),
token=Token(
key="installation_token_1300_300",
entity_name="300_1300",
username="installation_1300",
),
token_owner=None,
selected_installation_info=GithubInstallationInfo(
id=installations[1].id,
Expand Down Expand Up @@ -616,17 +642,24 @@ def test_select_repo_public_with_no_token_no_admin_token_configured(
},
)
expected = AdapterAuthInformation(
token=Token(key="tokenless_bot_token", entity_name="tokenless_bot"),
token=Token(
key="tokenless_bot_token",
entity_name="tokenless",
),
token_owner=None,
selected_installation_info=None,
fallback_installations=None,
token_type_mapping={
TokenType.comment: Token(key="commenter_bot_token"),
TokenType.read: Token(key="reader_bot_token"),
TokenType.read: Token(
key="reader_bot_token",
entity_name="read",
),
TokenType.admin: None,
TokenType.status: Token(key="status_bot_token"),
TokenType.tokenless: Token(
key="tokenless_bot_token", entity_name="tokenless_bot"
key="tokenless_bot_token",
entity_name="tokenless",
),
TokenType.pull: None,
TokenType.commit: None,
Expand Down
Loading