diff --git a/graphql_api/tests/test_branch.py b/graphql_api/tests/test_branch.py index 7d3c628727..338c40effe 100644 --- a/graphql_api/tests/test_branch.py +++ b/graphql_api/tests/test_branch.py @@ -47,9 +47,6 @@ partials lines percentCovered - ... on PathContentFile { - isCriticalFile - } } } ... on MissingHeadReport { @@ -94,9 +91,6 @@ partials lines percentCovered - ... on PathContentFile { - isCriticalFile - } } } totalCount @@ -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", @@ -401,7 +394,6 @@ def test_fetch_path_contents_with_files(self, report_mock): "partials": 0, "lines": 10, "percentCovered": 80.0, - "isCriticalFile": False, }, ], } @@ -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", @@ -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", @@ -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, }, ], } @@ -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", @@ -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", @@ -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", @@ -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", @@ -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, }, ], } @@ -1165,7 +1149,6 @@ def test_fetch_path_contents_deprecated(self, report_mock): "partials": 0, "lines": 10, "percentCovered": 80.0, - "isCriticalFile": False, }, { "__typename": "PathContentFile", @@ -1176,7 +1159,6 @@ def test_fetch_path_contents_deprecated(self, report_mock): "partials": 0, "lines": 10, "percentCovered": 80.0, - "isCriticalFile": False, }, { "__typename": "PathContentDir", @@ -1232,7 +1214,6 @@ def test_fetch_path_contents_deprecated_paginated( "partials": 0, "lines": 10, "percentCovered": 80.0, - "isCriticalFile": False, }, }, { @@ -1246,7 +1227,6 @@ def test_fetch_path_contents_deprecated_paginated( "partials": 0, "lines": 10, "percentCovered": 80.0, - "isCriticalFile": False, }, }, ], @@ -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, }, }, { @@ -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, }, }, { @@ -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, }, }, { @@ -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, }, }, { @@ -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, }, }, ], diff --git a/graphql_api/tests/test_commit.py b/graphql_api/tests/test_commit.py index 8d8836d8ae..a5d945d83c 100644 --- a/graphql_api/tests/test_commit.py +++ b/graphql_api/tests/test_commit.py @@ -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, @@ -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") @@ -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 } } } } @@ -634,7 +633,6 @@ def test_fetch_commit_coverage_file_with_components( {"coverage": "M", "line": 2}, ], "hashedPath": "d6fe1d0be6347b8ef2427fa629c04485", - "isCriticalFile": False, "totals": {"percentCovered": 83.0}, } } @@ -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, @@ -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): @@ -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, @@ -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") @@ -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 } } } } @@ -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}, } } @@ -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, @@ -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): diff --git a/graphql_api/tests/test_repository.py b/graphql_api/tests/test_repository.py index 6f91a1d55f..4f6653c9fb 100644 --- a/graphql_api/tests/test_repository.py +++ b/graphql_api/tests/test_repository.py @@ -60,7 +60,6 @@ uploadToken defaultBranch author { username } - profilingToken graphToken yaml isATSConfigured @@ -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, @@ -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, diff --git a/graphql_api/types/file/file.graphql b/graphql_api/types/file/file.graphql index dc24362c50..bc70e71104 100644 --- a/graphql_api/types/file/file.graphql +++ b/graphql_api/types/file/file.graphql @@ -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! -} \ No newline at end of file diff --git a/graphql_api/types/file/file.py b/graphql_api/types/file/file.py index cc85842947..c8289d6b6a 100644 --- a/graphql_api/types/file/file.py +++ b/graphql_api/types/file/file.py @@ -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") @@ -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") diff --git a/graphql_api/types/path_contents/path_content.graphql b/graphql_api/types/path_contents/path_content.graphql index 1c89916250..88382fa95b 100644 --- a/graphql_api/types/path_contents/path_content.graphql +++ b/graphql_api/types/path_contents/path_content.graphql @@ -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 { @@ -45,14 +44,14 @@ type PathContentConnection { } union PathContentsResult = - PathContents + PathContents | MissingHeadReport | MissingCoverage | UnknownPath | UnknownFlags union DeprecatedPathContentsResult = - PathContentConnection + PathContentConnection | MissingHeadReport | MissingCoverage | UnknownPath diff --git a/graphql_api/types/path_contents/path_content.py b/graphql_api/types/path_contents/path_content.py index 21da93e12d..192fcdf838 100644 --- a/graphql_api/types/path_contents/path_content.py +++ b/graphql_api/types/path_contents/path_content.py @@ -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, @@ -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") diff --git a/graphql_api/types/repository/repository.graphql b/graphql_api/types/repository/repository.graphql index 18301da050..69590e47db 100644 --- a/graphql_api/types/repository/repository.graphql +++ b/graphql_api/types/repository/repository.graphql @@ -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 diff --git a/graphql_api/types/repository/repository.py b/graphql_api/types/repository/repository.py index 230c3c1a60..cf286c7d1f 100644 --- a/graphql_api/types/repository/repository.py +++ b/graphql_api/types/repository/repository.py @@ -165,12 +165,6 @@ def resolve_default_branch(repository: Repository, info: GraphQLResolveInfo) -> return repository.branch -@repository_bindable.field("profilingToken") -def resolve_profiling_token(repository: Repository, info: GraphQLResolveInfo) -> str: - """DEPRECATED""" - return "" - - @repository_bindable.field("staticAnalysisToken") def resolve_static_analysis_token( repository: Repository, info: GraphQLResolveInfo