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
25 changes: 0 additions & 25 deletions graphql_api/tests/test_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
partials
lines
percentCovered
... on PathContentFile {
isCriticalFile
}
}
}
... on MissingHeadReport {
Expand Down Expand Up @@ -94,9 +91,6 @@
partials
lines
percentCovered
... on PathContentFile {
isCriticalFile
}
}
}
totalCount
Expand Down Expand Up @@ -390,7 +384,6 @@ def test_fetch_path_contents_with_files(self, report_mock):
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
{
"__typename": "PathContentFile",
Expand All @@ -401,7 +394,6 @@ def test_fetch_path_contents_with_files(self, report_mock):
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
],
}
Expand Down Expand Up @@ -449,7 +441,6 @@ def test_fetch_path_contents_with_files_and_path_prefix(
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
{
"__typename": "PathContentDir",
Expand Down Expand Up @@ -504,7 +495,6 @@ def test_fetch_path_contents_with_files_and_search_value_case_insensitive(
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
{
"__typename": "PathContentFile",
Expand All @@ -515,7 +505,6 @@ def test_fetch_path_contents_with_files_and_search_value_case_insensitive(
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
],
}
Expand Down Expand Up @@ -557,7 +546,6 @@ def test_fetch_path_contents_with_files_and_list_display_type(self, report_mock)
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
{
"__typename": "PathContentFile",
Expand All @@ -568,7 +556,6 @@ def test_fetch_path_contents_with_files_and_list_display_type(self, report_mock)
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
{
"__typename": "PathContentFile",
Expand All @@ -579,7 +566,6 @@ def test_fetch_path_contents_with_files_and_list_display_type(self, report_mock)
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
{
"__typename": "PathContentFile",
Expand All @@ -590,7 +576,6 @@ def test_fetch_path_contents_with_files_and_list_display_type(self, report_mock)
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
{
"__typename": "PathContentFile",
Expand All @@ -601,7 +586,6 @@ def test_fetch_path_contents_with_files_and_list_display_type(self, report_mock)
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
],
}
Expand Down Expand Up @@ -1165,7 +1149,6 @@ def test_fetch_path_contents_deprecated(self, report_mock):
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
{
"__typename": "PathContentFile",
Expand All @@ -1176,7 +1159,6 @@ def test_fetch_path_contents_deprecated(self, report_mock):
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
{
"__typename": "PathContentDir",
Expand Down Expand Up @@ -1232,7 +1214,6 @@ def test_fetch_path_contents_deprecated_paginated(
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
},
{
Expand All @@ -1246,7 +1227,6 @@ def test_fetch_path_contents_deprecated_paginated(
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
},
],
Expand Down Expand Up @@ -1492,7 +1472,6 @@ def test_fetch_path_contents_deprecated_with_files_and_list_display_type(
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
},
{
Expand All @@ -1506,7 +1485,6 @@ def test_fetch_path_contents_deprecated_with_files_and_list_display_type(
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
},
{
Expand All @@ -1520,7 +1498,6 @@ def test_fetch_path_contents_deprecated_with_files_and_list_display_type(
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
},
{
Expand All @@ -1534,7 +1511,6 @@ def test_fetch_path_contents_deprecated_with_files_and_list_display_type(
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
},
{
Expand All @@ -1548,7 +1524,6 @@ def test_fetch_path_contents_deprecated_with_files_and_list_display_type(
"partials": 0,
"lines": 10,
"percentCovered": 80.0,
"isCriticalFile": False,
},
},
],
Expand Down
18 changes: 6 additions & 12 deletions graphql_api/tests/test_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def test_fetch_commit_coverage_file_call_the_command(
):
query = (
query_commit
% 'coverageAnalytics { coverageFile(path: "path") { hashedPath, content, isCriticalFile, coverage { line,coverage }, totals { percentCovered } } }'
% 'coverageAnalytics { coverageFile(path: "path") { hashedPath, content, coverage { line,coverage }, totals { percentCovered } } }'
)
variables = {
"org": self.org.username,
Expand All @@ -556,7 +556,6 @@ def test_fetch_commit_coverage_file_call_the_command(
assert coverageFile["content"] == fake_coverage["content"]
assert coverageFile["coverage"] == fake_coverage["coverage"]
assert coverageFile["totals"] == fake_coverage["totals"]
assert coverageFile["isCriticalFile"] == False
assert coverageFile["hashedPath"] == hashlib.md5("path".encode()).hexdigest()

@patch("services.components.component_filtered_report")
Expand Down Expand Up @@ -609,7 +608,7 @@ def test_fetch_commit_coverage_file_with_components(
commit(id: $commit) {
coverageAnalytics {
coverageFile(path: "path", components: $components) {
hashedPath, content, isCriticalFile, coverage { line,coverage }, totals { percentCovered }
hashedPath, content, coverage { line,coverage }, totals { percentCovered }
}
}
}
Expand All @@ -634,7 +633,6 @@ def test_fetch_commit_coverage_file_with_components(
{"coverage": "M", "line": 2},
],
"hashedPath": "d6fe1d0be6347b8ef2427fa629c04485",
"isCriticalFile": False,
"totals": {"percentCovered": 83.0},
}
}
Expand All @@ -652,7 +650,7 @@ def test_fetch_commit_with_no_coverage_data(
):
query = (
query_commit
% 'coverageAnalytics { coverageFile(path: "path") { content, isCriticalFile, coverage { line,coverage }, totals { percentCovered } } }'
% 'coverageAnalytics { coverageFile(path: "path") { content, coverage { line,coverage }, totals { percentCovered } } }'
)
variables = {
"org": self.org.username,
Expand All @@ -671,7 +669,6 @@ def test_fetch_commit_with_no_coverage_data(
assert coverageFile["content"] == fake_coverage["content"]
assert coverageFile["coverage"] == fake_coverage["coverage"]
assert coverageFile["totals"] == fake_coverage["totals"]
assert coverageFile["isCriticalFile"] == False

@patch("shared.reports.api_report_service.build_report_from_commit")
def test_flag_names(self, report_mock):
Expand Down Expand Up @@ -2627,7 +2624,7 @@ def test_fetch_commit_coverage_coverage_file(
):
query = (
query_commit
% 'coverageAnalytics { coverageFile(path: "path") { hashedPath, content, isCriticalFile, coverage { line,coverage }, totals { percentCovered } } }'
% 'coverageAnalytics { coverageFile(path: "path") { hashedPath, content, coverage { line,coverage }, totals { percentCovered } } }'
)
variables = {
"org": self.org.username,
Expand All @@ -2654,7 +2651,6 @@ def test_fetch_commit_coverage_coverage_file(
assert coverageFile["content"] == fake_coverage["content"]
assert coverageFile["coverage"] == fake_coverage["coverage"]
assert coverageFile["totals"] == fake_coverage["totals"]
assert coverageFile["isCriticalFile"] == False
assert coverageFile["hashedPath"] == hashlib.md5("path".encode()).hexdigest()

@patch("services.components.component_filtered_report")
Expand Down Expand Up @@ -2707,7 +2703,7 @@ def test_fetch_commit_coverage_coverage_file_with_components(
commit(id: $commit) {
coverageAnalytics {
coverageFile(path: "path", components: $components) {
hashedPath, content, isCriticalFile, coverage { line,coverage }, totals { percentCovered }
hashedPath, content, coverage { line,coverage }, totals { percentCovered }
}
}
}
Expand All @@ -2732,7 +2728,6 @@ def test_fetch_commit_coverage_coverage_file_with_components(
{"coverage": "M", "line": 2},
],
"hashedPath": "d6fe1d0be6347b8ef2427fa629c04485",
"isCriticalFile": False,
"totals": {"percentCovered": 83.0},
}
}
Expand All @@ -2750,7 +2745,7 @@ def test_fetch_commit_coverage_with_no_coverage_data(
):
query = (
query_commit
% 'coverageAnalytics { coverageFile(path: "path") { content, isCriticalFile, coverage { line,coverage }, totals { percentCovered } }}'
% 'coverageAnalytics { coverageFile(path: "path") { content, coverage { line,coverage }, totals { percentCovered } }}'
)
variables = {
"org": self.org.username,
Expand All @@ -2769,7 +2764,6 @@ def test_fetch_commit_coverage_with_no_coverage_data(
assert coverageFile["content"] == fake_coverage["content"]
assert coverageFile["coverage"] == fake_coverage["coverage"]
assert coverageFile["totals"] == fake_coverage["totals"]
assert coverageFile["isCriticalFile"] == False

@patch("shared.reports.api_report_service.build_report_from_commit")
def test_coverage_flag_names(self, report_mock):
Expand Down
3 changes: 0 additions & 3 deletions graphql_api/tests/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
uploadToken
defaultBranch
author { username }
profilingToken
graphToken
yaml
isATSConfigured
Expand Down Expand Up @@ -136,7 +135,6 @@ def test_when_repository_has_no_coverage(self):
"uploadToken": repo.upload_token,
"defaultBranch": "main",
"author": {"username": "codecov-user"},
"profilingToken": "",
"graphToken": graphToken,
"yaml": "test: test\n",
"isATSConfigured": False,
Expand Down Expand Up @@ -198,7 +196,6 @@ def test_when_repository_has_coverage(self):
"uploadToken": repo.upload_token,
"defaultBranch": "main",
"author": {"username": "codecov-user"},
"profilingToken": "",
"graphToken": graphToken,
"yaml": "test: test\n",
"isATSConfigured": False,
Expand Down
17 changes: 6 additions & 11 deletions graphql_api/types/file/file.graphql
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
type File {
content: String
coverage: [CoverageAnnotation]
totals: CoverageTotals
isCriticalFile: Boolean @deprecated(reason: "Impact Analysis is deprecated.")
hashedPath: String!
content: String
coverage: [CoverageAnnotation]
totals: CoverageTotals
hashedPath: String!
}

type CoverageAnnotation {
line: Int
coverage: CoverageLine
line: Int
coverage: CoverageLine
}

type CriticalFile {
name: String!
}
8 changes: 0 additions & 8 deletions graphql_api/types/file/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from ariadne import ObjectType
from shared.utils.merge import LineType, line_type

from codecov.db import sync_to_async
from graphql_api.types.enums import CoverageLine

file_bindable = ObjectType("File")
Expand Down Expand Up @@ -45,13 +44,6 @@ def resolve_totals(data, info):
return file_report.totals if file_report else None


@file_bindable.field("isCriticalFile")
@sync_to_async
def resolve_is_critical_file(data, info):
"""DEPRECATED. Returning dummy value"""
return False


@file_bindable.field("hashedPath")
def resolve_hashed_path(data, info):
path = data.get("path")
Expand Down
5 changes: 2 additions & 3 deletions graphql_api/types/path_contents/path_content.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ type PathContentFile implements PathContent {
partials: Int!
lines: Int!
percentCovered: Float!
isCriticalFile: Boolean! @deprecated(reason: "Impact Analysis is deprecated.")
}

type PathContentDir implements PathContent {
Expand Down Expand Up @@ -45,14 +44,14 @@ type PathContentConnection {
}

union PathContentsResult =
PathContents
PathContents
| MissingHeadReport
| MissingCoverage
| UnknownPath
| UnknownFlags

union DeprecatedPathContentsResult =
PathContentConnection
PathContentConnection
| MissingHeadReport
| MissingCoverage
| UnknownPath
Expand Down
8 changes: 0 additions & 8 deletions graphql_api/types/path_contents/path_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from ariadne import InterfaceType, ObjectType, UnionType

from codecov.db import sync_to_async
from graphql_api.helpers.connection import (
ArrayConnection,
Connection,
Expand Down Expand Up @@ -59,13 +58,6 @@ def resolve_percent_covered(item: Union[File, Dir], info) -> float:
return item.coverage


@path_content_file_bindable.field("isCriticalFile")
@sync_to_async
def resolve_is_critical_file(item: Union[File, Dir], info) -> bool:
"""DEPRECATED. Returning dummy value"""
return False


path_contents_result_bindable = UnionType("PathContentsResult")


Expand Down
1 change: 0 additions & 1 deletion graphql_api/types/repository/repository.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ type Repository {
before: String
): BranchConnection @cost(complexity: 3, multipliers: ["first", "last"])
defaultBranch: String
profilingToken: String @deprecated(reason: "Impact Analysis is deprecated.")
graphToken: String
yaml: String
bot: Owner
Expand Down
Loading
Loading