Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
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
4 changes: 2 additions & 2 deletions graphql_api/tests/test_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(self):


class MockReport(object):
def get(self, file, _else):
def get(self, filename):
MockLines()
return MockLines()

Expand All @@ -102,7 +102,7 @@ def get_flag_names(self):


class EmptyReport(MockReport):
def get(self, file, _else):
def get(self, filename):
return None


Expand Down
6 changes: 3 additions & 3 deletions graphql_api/types/commit/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def resolve_coverage_flags(commit: Commit, info: GraphQLResolveInfo) -> list[str
@commit_coverage_analytics_bindable.field("coverageFile")
@sync_to_async
def resolve_coverage_file(commit, info, path, flags=None, components=None):
_else, paths = None, []
fallback_file, paths = None, []
if components:
all_components = components_service.commit_components(
commit, info.context["request"].current_owner
Expand All @@ -343,10 +343,10 @@ def resolve_coverage_file(commit, info, path, flags=None, components=None):
)
for fc in filtered_components:
paths.extend(fc.paths)
_else = FilteredReportFile(ReportFile(path), [])
fallback_file = FilteredReportFile(ReportFile(path), [])

commit_report = commit.full_report.filter(flags=flags, paths=paths)
file_report = commit_report.get(path, _else=_else)
file_report = commit_report.get(path) or fallback_file

return {
"commit_report": commit_report,
Expand Down
Loading