Skip to content

Commit

Permalink
Merge branch 'main' into cy/accept_name_tos
Browse files Browse the repository at this point in the history
  • Loading branch information
calvin-codecov authored Jan 17, 2025
2 parents 7f83bd5 + 9f89174 commit 9df3098
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
7 changes: 5 additions & 2 deletions codecov_auth/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ class PlansInline(admin.TabularInline):
"monthly_uploads_limit",
"paid_plan",
"is_active",
"stripe_id",
]
formfield_overrides = {
Plan._meta.get_field("benefits"): {"widget": Textarea(attrs={"rows": 3})},
Expand Down Expand Up @@ -791,12 +792,13 @@ class PlanAdmin(admin.ModelAdmin):
list_display = (
"name",
"marketing_name",
"base_unit_price",
"is_active",
"tier",
"paid_plan",
"billing_rate",
"base_unit_price",
"max_seats",
"monthly_uploads_limit",
"billing_rate",
)
list_filter = ("is_active", "paid_plan", "billing_rate", "tier")
search_fields = ("name__iregex", "marketing_name__iregex")
Expand All @@ -811,6 +813,7 @@ class PlanAdmin(admin.ModelAdmin):
"max_seats",
"monthly_uploads_limit",
"paid_plan",
"stripe_id",
]
formfield_overrides = {
Plan._meta.get_field("benefits"): {"widget": Textarea(attrs={"rows": 3})},
Expand Down
5 changes: 5 additions & 0 deletions graphql_api/tests/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"""

default_fields = """
repoid
name
active
private
Expand Down Expand Up @@ -103,6 +104,7 @@ def setUp(self):
@freeze_time("2021-01-01")
def test_when_repository_has_no_coverage(self):
repo = RepositoryFactory(
repoid=1,
author=self.owner,
active=True,
private=True,
Expand All @@ -122,6 +124,7 @@ def test_when_repository_has_no_coverage(self):
+ "coverageAnalytics { percentCovered commitSha hits misses lines },",
) == {
"__typename": "Repository",
"repoid": 1,
"name": "a",
"active": True,
"private": True,
Expand Down Expand Up @@ -154,6 +157,7 @@ def test_when_repository_has_no_coverage(self):
@freeze_time("2021-01-01")
def test_when_repository_has_coverage(self):
repo = RepositoryFactory(
repoid=1,
author=self.owner,
active=True,
private=True,
Expand Down Expand Up @@ -186,6 +190,7 @@ def test_when_repository_has_coverage(self):
+ "coverageAnalytics { percentCovered commitSha hits misses lines },",
) == {
"__typename": "Repository",
"repoid": 1,
"name": "b",
"active": True,
"latestCommitAt": None,
Expand Down
1 change: 1 addition & 0 deletions graphql_api/types/repository/repository.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Repository is a named collection of files uploaded
"""
type Repository {
isFirstPullRequest: Boolean!
repoid: Int!
name: String!
active: Boolean!
activated: Boolean!
Expand Down
10 changes: 10 additions & 0 deletions graphql_api/types/repository/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@
repository_bindable.set_alias("latestCommitAt", "true_latest_commit_at")


@repository_bindable.field("repoid")
def resolve_repoid(repository: Repository, info: GraphQLResolveInfo) -> int:
return repository.repoid


@repository_bindable.field("name")
def resolve_name(repository: Repository, info: GraphQLResolveInfo) -> str:
return repository.name


@repository_bindable.field("oldestCommitAt")
def resolve_oldest_commit_at(
repository: Repository, info: GraphQLResolveInfo
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ freezegun
google-cloud-pubsub
gunicorn>=22.0.0
https://github.com/codecov/opentelem-python/archive/refs/tags/v0.0.4a1.tar.gz#egg=codecovopentelem
https://github.com/codecov/shared/archive/b38e7f3813d4fc795d0e7cf852eced4660daa4ac.tar.gz#egg=shared
https://github.com/codecov/shared/archive/fe16480b3646a616ff412d5c0a28cafd2c7104c1.tar.gz#egg=shared
https://github.com/photocrowd/django-cursor-pagination/archive/f560902696b0c8509e4d95c10ba0d62700181d84.tar.gz
idna>=3.7
minio
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements.in
Expand Down Expand Up @@ -416,7 +416,7 @@ sentry-sdk[celery]==2.13.0
# shared
setproctitle==1.1.10
# via -r requirements.in
shared @ https://github.com/codecov/shared/archive/b38e7f3813d4fc795d0e7cf852eced4660daa4ac.tar.gz
shared @ https://github.com/codecov/shared/archive/fe16480b3646a616ff412d5c0a28cafd2c7104c1.tar.gz
# via -r requirements.in
simplejson==3.17.2
# via -r requirements.in
Expand Down

0 comments on commit 9df3098

Please sign in to comment.