Skip to content

Commit 7a1dc89

Browse files
authored
ref: Remove isCriticalFile and profilingToken from GQL API (#1188)
1 parent bedea33 commit 7a1dc89

File tree

9 files changed

+14
-77
lines changed

9 files changed

+14
-77
lines changed

graphql_api/tests/test_branch.py

-25
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@
4747
partials
4848
lines
4949
percentCovered
50-
... on PathContentFile {
51-
isCriticalFile
52-
}
5350
}
5451
}
5552
... on MissingHeadReport {
@@ -94,9 +91,6 @@
9491
partials
9592
lines
9693
percentCovered
97-
... on PathContentFile {
98-
isCriticalFile
99-
}
10094
}
10195
}
10296
totalCount
@@ -390,7 +384,6 @@ def test_fetch_path_contents_with_files(self, report_mock):
390384
"partials": 0,
391385
"lines": 10,
392386
"percentCovered": 80.0,
393-
"isCriticalFile": False,
394387
},
395388
{
396389
"__typename": "PathContentFile",
@@ -401,7 +394,6 @@ def test_fetch_path_contents_with_files(self, report_mock):
401394
"partials": 0,
402395
"lines": 10,
403396
"percentCovered": 80.0,
404-
"isCriticalFile": False,
405397
},
406398
],
407399
}
@@ -449,7 +441,6 @@ def test_fetch_path_contents_with_files_and_path_prefix(
449441
"partials": 0,
450442
"lines": 10,
451443
"percentCovered": 80.0,
452-
"isCriticalFile": False,
453444
},
454445
{
455446
"__typename": "PathContentDir",
@@ -504,7 +495,6 @@ def test_fetch_path_contents_with_files_and_search_value_case_insensitive(
504495
"partials": 0,
505496
"lines": 10,
506497
"percentCovered": 80.0,
507-
"isCriticalFile": False,
508498
},
509499
{
510500
"__typename": "PathContentFile",
@@ -515,7 +505,6 @@ def test_fetch_path_contents_with_files_and_search_value_case_insensitive(
515505
"partials": 0,
516506
"lines": 10,
517507
"percentCovered": 80.0,
518-
"isCriticalFile": False,
519508
},
520509
],
521510
}
@@ -557,7 +546,6 @@ def test_fetch_path_contents_with_files_and_list_display_type(self, report_mock)
557546
"partials": 0,
558547
"lines": 10,
559548
"percentCovered": 80.0,
560-
"isCriticalFile": False,
561549
},
562550
{
563551
"__typename": "PathContentFile",
@@ -568,7 +556,6 @@ def test_fetch_path_contents_with_files_and_list_display_type(self, report_mock)
568556
"partials": 0,
569557
"lines": 10,
570558
"percentCovered": 80.0,
571-
"isCriticalFile": False,
572559
},
573560
{
574561
"__typename": "PathContentFile",
@@ -579,7 +566,6 @@ def test_fetch_path_contents_with_files_and_list_display_type(self, report_mock)
579566
"partials": 0,
580567
"lines": 10,
581568
"percentCovered": 80.0,
582-
"isCriticalFile": False,
583569
},
584570
{
585571
"__typename": "PathContentFile",
@@ -590,7 +576,6 @@ def test_fetch_path_contents_with_files_and_list_display_type(self, report_mock)
590576
"partials": 0,
591577
"lines": 10,
592578
"percentCovered": 80.0,
593-
"isCriticalFile": False,
594579
},
595580
{
596581
"__typename": "PathContentFile",
@@ -601,7 +586,6 @@ def test_fetch_path_contents_with_files_and_list_display_type(self, report_mock)
601586
"partials": 0,
602587
"lines": 10,
603588
"percentCovered": 80.0,
604-
"isCriticalFile": False,
605589
},
606590
],
607591
}
@@ -1165,7 +1149,6 @@ def test_fetch_path_contents_deprecated(self, report_mock):
11651149
"partials": 0,
11661150
"lines": 10,
11671151
"percentCovered": 80.0,
1168-
"isCriticalFile": False,
11691152
},
11701153
{
11711154
"__typename": "PathContentFile",
@@ -1176,7 +1159,6 @@ def test_fetch_path_contents_deprecated(self, report_mock):
11761159
"partials": 0,
11771160
"lines": 10,
11781161
"percentCovered": 80.0,
1179-
"isCriticalFile": False,
11801162
},
11811163
{
11821164
"__typename": "PathContentDir",
@@ -1232,7 +1214,6 @@ def test_fetch_path_contents_deprecated_paginated(
12321214
"partials": 0,
12331215
"lines": 10,
12341216
"percentCovered": 80.0,
1235-
"isCriticalFile": False,
12361217
},
12371218
},
12381219
{
@@ -1246,7 +1227,6 @@ def test_fetch_path_contents_deprecated_paginated(
12461227
"partials": 0,
12471228
"lines": 10,
12481229
"percentCovered": 80.0,
1249-
"isCriticalFile": False,
12501230
},
12511231
},
12521232
],
@@ -1492,7 +1472,6 @@ def test_fetch_path_contents_deprecated_with_files_and_list_display_type(
14921472
"partials": 0,
14931473
"lines": 10,
14941474
"percentCovered": 80.0,
1495-
"isCriticalFile": False,
14961475
},
14971476
},
14981477
{
@@ -1506,7 +1485,6 @@ def test_fetch_path_contents_deprecated_with_files_and_list_display_type(
15061485
"partials": 0,
15071486
"lines": 10,
15081487
"percentCovered": 80.0,
1509-
"isCriticalFile": False,
15101488
},
15111489
},
15121490
{
@@ -1520,7 +1498,6 @@ def test_fetch_path_contents_deprecated_with_files_and_list_display_type(
15201498
"partials": 0,
15211499
"lines": 10,
15221500
"percentCovered": 80.0,
1523-
"isCriticalFile": False,
15241501
},
15251502
},
15261503
{
@@ -1534,7 +1511,6 @@ def test_fetch_path_contents_deprecated_with_files_and_list_display_type(
15341511
"partials": 0,
15351512
"lines": 10,
15361513
"percentCovered": 80.0,
1537-
"isCriticalFile": False,
15381514
},
15391515
},
15401516
{
@@ -1548,7 +1524,6 @@ def test_fetch_path_contents_deprecated_with_files_and_list_display_type(
15481524
"partials": 0,
15491525
"lines": 10,
15501526
"percentCovered": 80.0,
1551-
"isCriticalFile": False,
15521527
},
15531528
},
15541529
],

graphql_api/tests/test_commit.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ def test_fetch_commit_coverage_file_call_the_command(
529529
):
530530
query = (
531531
query_commit
532-
% 'coverageAnalytics { coverageFile(path: "path") { hashedPath, content, isCriticalFile, coverage { line,coverage }, totals { percentCovered } } }'
532+
% 'coverageAnalytics { coverageFile(path: "path") { hashedPath, content, coverage { line,coverage }, totals { percentCovered } } }'
533533
)
534534
variables = {
535535
"org": self.org.username,
@@ -556,7 +556,6 @@ def test_fetch_commit_coverage_file_call_the_command(
556556
assert coverageFile["content"] == fake_coverage["content"]
557557
assert coverageFile["coverage"] == fake_coverage["coverage"]
558558
assert coverageFile["totals"] == fake_coverage["totals"]
559-
assert coverageFile["isCriticalFile"] == False
560559
assert coverageFile["hashedPath"] == hashlib.md5("path".encode()).hexdigest()
561560

562561
@patch("services.components.component_filtered_report")
@@ -609,7 +608,7 @@ def test_fetch_commit_coverage_file_with_components(
609608
commit(id: $commit) {
610609
coverageAnalytics {
611610
coverageFile(path: "path", components: $components) {
612-
hashedPath, content, isCriticalFile, coverage { line,coverage }, totals { percentCovered }
611+
hashedPath, content, coverage { line,coverage }, totals { percentCovered }
613612
}
614613
}
615614
}
@@ -634,7 +633,6 @@ def test_fetch_commit_coverage_file_with_components(
634633
{"coverage": "M", "line": 2},
635634
],
636635
"hashedPath": "d6fe1d0be6347b8ef2427fa629c04485",
637-
"isCriticalFile": False,
638636
"totals": {"percentCovered": 83.0},
639637
}
640638
}
@@ -652,7 +650,7 @@ def test_fetch_commit_with_no_coverage_data(
652650
):
653651
query = (
654652
query_commit
655-
% 'coverageAnalytics { coverageFile(path: "path") { content, isCriticalFile, coverage { line,coverage }, totals { percentCovered } } }'
653+
% 'coverageAnalytics { coverageFile(path: "path") { content, coverage { line,coverage }, totals { percentCovered } } }'
656654
)
657655
variables = {
658656
"org": self.org.username,
@@ -671,7 +669,6 @@ def test_fetch_commit_with_no_coverage_data(
671669
assert coverageFile["content"] == fake_coverage["content"]
672670
assert coverageFile["coverage"] == fake_coverage["coverage"]
673671
assert coverageFile["totals"] == fake_coverage["totals"]
674-
assert coverageFile["isCriticalFile"] == False
675672

676673
@patch("shared.reports.api_report_service.build_report_from_commit")
677674
def test_flag_names(self, report_mock):
@@ -2627,7 +2624,7 @@ def test_fetch_commit_coverage_coverage_file(
26272624
):
26282625
query = (
26292626
query_commit
2630-
% 'coverageAnalytics { coverageFile(path: "path") { hashedPath, content, isCriticalFile, coverage { line,coverage }, totals { percentCovered } } }'
2627+
% 'coverageAnalytics { coverageFile(path: "path") { hashedPath, content, coverage { line,coverage }, totals { percentCovered } } }'
26312628
)
26322629
variables = {
26332630
"org": self.org.username,
@@ -2654,7 +2651,6 @@ def test_fetch_commit_coverage_coverage_file(
26542651
assert coverageFile["content"] == fake_coverage["content"]
26552652
assert coverageFile["coverage"] == fake_coverage["coverage"]
26562653
assert coverageFile["totals"] == fake_coverage["totals"]
2657-
assert coverageFile["isCriticalFile"] == False
26582654
assert coverageFile["hashedPath"] == hashlib.md5("path".encode()).hexdigest()
26592655

26602656
@patch("services.components.component_filtered_report")
@@ -2707,7 +2703,7 @@ def test_fetch_commit_coverage_coverage_file_with_components(
27072703
commit(id: $commit) {
27082704
coverageAnalytics {
27092705
coverageFile(path: "path", components: $components) {
2710-
hashedPath, content, isCriticalFile, coverage { line,coverage }, totals { percentCovered }
2706+
hashedPath, content, coverage { line,coverage }, totals { percentCovered }
27112707
}
27122708
}
27132709
}
@@ -2732,7 +2728,6 @@ def test_fetch_commit_coverage_coverage_file_with_components(
27322728
{"coverage": "M", "line": 2},
27332729
],
27342730
"hashedPath": "d6fe1d0be6347b8ef2427fa629c04485",
2735-
"isCriticalFile": False,
27362731
"totals": {"percentCovered": 83.0},
27372732
}
27382733
}
@@ -2750,7 +2745,7 @@ def test_fetch_commit_coverage_with_no_coverage_data(
27502745
):
27512746
query = (
27522747
query_commit
2753-
% 'coverageAnalytics { coverageFile(path: "path") { content, isCriticalFile, coverage { line,coverage }, totals { percentCovered } }}'
2748+
% 'coverageAnalytics { coverageFile(path: "path") { content, coverage { line,coverage }, totals { percentCovered } }}'
27542749
)
27552750
variables = {
27562751
"org": self.org.username,
@@ -2769,7 +2764,6 @@ def test_fetch_commit_coverage_with_no_coverage_data(
27692764
assert coverageFile["content"] == fake_coverage["content"]
27702765
assert coverageFile["coverage"] == fake_coverage["coverage"]
27712766
assert coverageFile["totals"] == fake_coverage["totals"]
2772-
assert coverageFile["isCriticalFile"] == False
27732767

27742768
@patch("shared.reports.api_report_service.build_report_from_commit")
27752769
def test_coverage_flag_names(self, report_mock):

graphql_api/tests/test_repository.py

-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
uploadToken
6161
defaultBranch
6262
author { username }
63-
profilingToken
6463
graphToken
6564
yaml
6665
isATSConfigured
@@ -136,7 +135,6 @@ def test_when_repository_has_no_coverage(self):
136135
"uploadToken": repo.upload_token,
137136
"defaultBranch": "main",
138137
"author": {"username": "codecov-user"},
139-
"profilingToken": "",
140138
"graphToken": graphToken,
141139
"yaml": "test: test\n",
142140
"isATSConfigured": False,
@@ -198,7 +196,6 @@ def test_when_repository_has_coverage(self):
198196
"uploadToken": repo.upload_token,
199197
"defaultBranch": "main",
200198
"author": {"username": "codecov-user"},
201-
"profilingToken": "",
202199
"graphToken": graphToken,
203200
"yaml": "test: test\n",
204201
"isATSConfigured": False,

graphql_api/types/file/file.graphql

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
type File {
2-
content: String
3-
coverage: [CoverageAnnotation]
4-
totals: CoverageTotals
5-
isCriticalFile: Boolean @deprecated(reason: "Impact Analysis is deprecated.")
6-
hashedPath: String!
2+
content: String
3+
coverage: [CoverageAnnotation]
4+
totals: CoverageTotals
5+
hashedPath: String!
76
}
87

98
type CoverageAnnotation {
10-
line: Int
11-
coverage: CoverageLine
9+
line: Int
10+
coverage: CoverageLine
1211
}
13-
14-
type CriticalFile {
15-
name: String!
16-
}

graphql_api/types/file/file.py

-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from ariadne import ObjectType
44
from shared.utils.merge import LineType, line_type
55

6-
from codecov.db import sync_to_async
76
from graphql_api.types.enums import CoverageLine
87

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

4746

48-
@file_bindable.field("isCriticalFile")
49-
@sync_to_async
50-
def resolve_is_critical_file(data, info):
51-
"""DEPRECATED. Returning dummy value"""
52-
return False
53-
54-
5547
@file_bindable.field("hashedPath")
5648
def resolve_hashed_path(data, info):
5749
path = data.get("path")

graphql_api/types/path_contents/path_content.graphql

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ type PathContentFile implements PathContent {
1616
partials: Int!
1717
lines: Int!
1818
percentCovered: Float!
19-
isCriticalFile: Boolean! @deprecated(reason: "Impact Analysis is deprecated.")
2019
}
2120

2221
type PathContentDir implements PathContent {
@@ -45,14 +44,14 @@ type PathContentConnection {
4544
}
4645

4746
union PathContentsResult =
48-
PathContents
47+
PathContents
4948
| MissingHeadReport
5049
| MissingCoverage
5150
| UnknownPath
5251
| UnknownFlags
5352

5453
union DeprecatedPathContentsResult =
55-
PathContentConnection
54+
PathContentConnection
5655
| MissingHeadReport
5756
| MissingCoverage
5857
| UnknownPath

graphql_api/types/path_contents/path_content.py

-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from ariadne import InterfaceType, ObjectType, UnionType
44

5-
from codecov.db import sync_to_async
65
from graphql_api.helpers.connection import (
76
ArrayConnection,
87
Connection,
@@ -59,13 +58,6 @@ def resolve_percent_covered(item: Union[File, Dir], info) -> float:
5958
return item.coverage
6059

6160

62-
@path_content_file_bindable.field("isCriticalFile")
63-
@sync_to_async
64-
def resolve_is_critical_file(item: Union[File, Dir], info) -> bool:
65-
"""DEPRECATED. Returning dummy value"""
66-
return False
67-
68-
6961
path_contents_result_bindable = UnionType("PathContentsResult")
7062

7163

graphql_api/types/repository/repository.graphql

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ type Repository {
3939
before: String
4040
): BranchConnection @cost(complexity: 3, multipliers: ["first", "last"])
4141
defaultBranch: String
42-
profilingToken: String @deprecated(reason: "Impact Analysis is deprecated.")
4342
graphToken: String
4443
yaml: String
4544
bot: Owner

0 commit comments

Comments
 (0)