Skip to content

Commit 0aabfad

Browse files
author
awstools
committed
feat(client-codeguru-reviewer): Amazon CodeGuru Reviewer now supports suppressing recommendations from being generated on specific files and directories.
1 parent 5bea879 commit 0aabfad

File tree

3 files changed

+94
-12
lines changed

3 files changed

+94
-12
lines changed

clients/client-codeguru-reviewer/src/models/models_0.ts

+43-2
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,12 @@ export namespace CreateCodeReviewRequest {
10201020
});
10211021
}
10221022

1023+
export enum ConfigFileState {
1024+
ABSENT = "Absent",
1025+
PRESENT = "Present",
1026+
PRESENT_WITH_ERRORS = "PresentWithErrors",
1027+
}
1028+
10231029
/**
10241030
* <p>
10251031
* Information about the statistics from the code review.
@@ -1028,12 +1034,22 @@ export namespace CreateCodeReviewRequest {
10281034
export interface Metrics {
10291035
/**
10301036
* <p>
1031-
* <code>MeteredLinesOfCode</code> is the number of lines of code in the repository where the code review happened.
1037+
* <code>MeteredLinesOfCodeCount</code> is the number of lines of code in the repository where the code review happened.
10321038
* This does not include non-code lines such as comments and blank lines.
10331039
* </p>
10341040
*/
10351041
MeteredLinesOfCodeCount?: number;
10361042

1043+
/**
1044+
* <p>
1045+
* <code>SuppressedLinesOfCodeCount</code> is the number of lines of code in the repository
1046+
* where the code review happened that CodeGuru Reviewer did not analyze. The lines suppressed in the
1047+
* analysis is based on the <code>excludeFiles</code> variable in the
1048+
* <code>aws-codeguru-reviewer.yml</code> file. This number does not include non-code lines
1049+
* such as comments and blank lines. </p>
1050+
*/
1051+
SuppressedLinesOfCodeCount?: number;
1052+
10371053
/**
10381054
* <p>
10391055
* Total number of recommendations found in the code review.
@@ -1196,10 +1212,17 @@ export interface CodeReview {
11961212
Metrics?: Metrics;
11971213

11981214
/**
1199-
* <p>They types of analysis performed during a repository analysis or a pull request review. You can specify either
1215+
* <p>The types of analysis performed during a repository analysis or a pull request review. You can specify either
12001216
* <code>Security</code>, <code>CodeQuality</code>, or both.</p>
12011217
*/
12021218
AnalysisTypes?: (AnalysisType | string)[];
1219+
1220+
/**
1221+
* <p>The state of the <code>aws-codeguru-reviewer.yml</code> configuration file that allows
1222+
* the configuration of the CodeGuru Reviewer analysis. The file either exists, doesn't exist, or exists
1223+
* with errors at the root directory of your repository.</p>
1224+
*/
1225+
ConfigFileState?: ConfigFileState | string;
12031226
}
12041227

12051228
export namespace CodeReview {
@@ -1653,6 +1676,24 @@ export interface MetricsSummary {
16531676
*/
16541677
MeteredLinesOfCodeCount?: number;
16551678

1679+
/**
1680+
* <p>Lines of code suppressed in the code review based on the <code>excludeFiles</code>
1681+
* element in the <code>aws-codeguru-reviewer.yml</code> file. For full repository analyses,
1682+
* this number includes all lines of code in the files that are suppressed. For pull requests,
1683+
* this number only includes the <i>changed</i> lines of code that are
1684+
* suppressed. In both cases, this number does not include non-code lines such as comments and
1685+
* import statements. For example, if you initiate a full repository analysis on a repository
1686+
* containing 5 files, each file with 100 lines of code, and 2 files are listed as excluded in
1687+
* the <code>aws-codeguru-reviewer.yml</code> file, then
1688+
* <code>SuppressedLinesOfCodeCount</code> returns 200 (2 * 100) as the total number of
1689+
* lines of code suppressed. However, if you submit a pull request for the same repository,
1690+
* then <code>SuppressedLinesOfCodeCount</code> only includes the lines in the 2 files
1691+
* that changed. If only 1 of the 2 files changed in the pull request, then
1692+
* <code>SuppressedLinesOfCodeCount</code> returns 100 (1 * 100) as the total number of
1693+
* lines of code suppressed.</p>
1694+
*/
1695+
SuppressedLinesOfCodeCount?: number;
1696+
16561697
/**
16571698
* <p>
16581699
* Total number of recommendations found in the code review.

clients/client-codeguru-reviewer/src/protocols/Aws_restJson1.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,7 @@ const deserializeAws_restJson1CodeReview = (output: any, context: __SerdeContext
16911691
: undefined,
16921692
AssociationArn: __expectString(output.AssociationArn),
16931693
CodeReviewArn: __expectString(output.CodeReviewArn),
1694+
ConfigFileState: __expectString(output.ConfigFileState),
16941695
CreatedTimeStamp:
16951696
output.CreatedTimeStamp !== undefined && output.CreatedTimeStamp !== null
16961697
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTimeStamp)))
@@ -1788,13 +1789,15 @@ const deserializeAws_restJson1Metrics = (output: any, context: __SerdeContext):
17881789
return {
17891790
FindingsCount: __expectLong(output.FindingsCount),
17901791
MeteredLinesOfCodeCount: __expectLong(output.MeteredLinesOfCodeCount),
1792+
SuppressedLinesOfCodeCount: __expectLong(output.SuppressedLinesOfCodeCount),
17911793
} as any;
17921794
};
17931795

17941796
const deserializeAws_restJson1MetricsSummary = (output: any, context: __SerdeContext): MetricsSummary => {
17951797
return {
17961798
FindingsCount: __expectLong(output.FindingsCount),
17971799
MeteredLinesOfCodeCount: __expectLong(output.MeteredLinesOfCodeCount),
1800+
SuppressedLinesOfCodeCount: __expectLong(output.SuppressedLinesOfCodeCount),
17981801
} as any;
17991802
};
18001803

codegen/sdk-codegen/aws-models/codeguru-reviewer.json

+48-10
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,13 @@
414414
"AnalysisTypes": {
415415
"target": "com.amazonaws.codegurureviewer#AnalysisTypes",
416416
"traits": {
417-
"smithy.api#documentation": "<p>They types of analysis performed during a repository analysis or a pull request review. You can specify either \n <code>Security</code>, <code>CodeQuality</code>, or both.</p>"
417+
"smithy.api#documentation": "<p>The types of analysis performed during a repository analysis or a pull request review. You can specify either \n <code>Security</code>, <code>CodeQuality</code>, or both.</p>"
418+
}
419+
},
420+
"ConfigFileState": {
421+
"target": "com.amazonaws.codegurureviewer#ConfigFileState",
422+
"traits": {
423+
"smithy.api#documentation": "<p>The state of the <code>aws-codeguru-reviewer.yml</code> configuration file that allows\n the configuration of the CodeGuru Reviewer analysis. The file either exists, doesn't exist, or exists\n with errors at the root directory of your repository.</p>"
418424
}
419425
}
420426
},
@@ -571,6 +577,25 @@
571577
}
572578
}
573579
},
580+
"com.amazonaws.codegurureviewer#ConfigFileState": {
581+
"type": "string",
582+
"traits": {
583+
"smithy.api#enum": [
584+
{
585+
"value": "Present",
586+
"name": "PRESENT"
587+
},
588+
{
589+
"value": "Absent",
590+
"name": "ABSENT"
591+
},
592+
{
593+
"value": "PresentWithErrors",
594+
"name": "PRESENT_WITH_ERRORS"
595+
}
596+
]
597+
}
598+
},
574599
"com.amazonaws.codegurureviewer#ConflictException": {
575600
"type": "structure",
576601
"members": {
@@ -1167,6 +1192,12 @@
11671192
"smithy.api#box": {}
11681193
}
11691194
},
1195+
"com.amazonaws.codegurureviewer#LinesOfCodeCount": {
1196+
"type": "long",
1197+
"traits": {
1198+
"smithy.api#box": {}
1199+
}
1200+
},
11701201
"com.amazonaws.codegurureviewer#ListCodeReviews": {
11711202
"type": "operation",
11721203
"input": {
@@ -1497,6 +1528,7 @@
14971528
"smithy.api#paginated": {
14981529
"inputToken": "NextToken",
14991530
"outputToken": "NextToken",
1531+
"items": "RepositoryAssociationSummaries",
15001532
"pageSize": "MaxResults"
15011533
}
15021534
}
@@ -1637,19 +1669,19 @@
16371669
}
16381670
}
16391671
},
1640-
"com.amazonaws.codegurureviewer#MeteredLinesOfCodeCount": {
1641-
"type": "long",
1642-
"traits": {
1643-
"smithy.api#box": {}
1644-
}
1645-
},
16461672
"com.amazonaws.codegurureviewer#Metrics": {
16471673
"type": "structure",
16481674
"members": {
16491675
"MeteredLinesOfCodeCount": {
1650-
"target": "com.amazonaws.codegurureviewer#MeteredLinesOfCodeCount",
1676+
"target": "com.amazonaws.codegurureviewer#LinesOfCodeCount",
1677+
"traits": {
1678+
"smithy.api#documentation": "<p>\n <code>MeteredLinesOfCodeCount</code> is the number of lines of code in the repository where the code review happened. \n This does not include non-code lines such as comments and blank lines.\n </p>"
1679+
}
1680+
},
1681+
"SuppressedLinesOfCodeCount": {
1682+
"target": "com.amazonaws.codegurureviewer#LinesOfCodeCount",
16511683
"traits": {
1652-
"smithy.api#documentation": "<p>\n <code>MeteredLinesOfCode</code> is the number of lines of code in the repository where the code review happened. \n This does not include non-code lines such as comments and blank lines.\n </p>"
1684+
"smithy.api#documentation": "<p>\n <code>SuppressedLinesOfCodeCount</code> is the number of lines of code in the repository\n where the code review happened that CodeGuru Reviewer did not analyze. The lines suppressed in the\n analysis is based on the <code>excludeFiles</code> variable in the\n <code>aws-codeguru-reviewer.yml</code> file. This number does not include non-code lines\n such as comments and blank lines. </p>"
16531685
}
16541686
},
16551687
"FindingsCount": {
@@ -1667,11 +1699,17 @@
16671699
"type": "structure",
16681700
"members": {
16691701
"MeteredLinesOfCodeCount": {
1670-
"target": "com.amazonaws.codegurureviewer#MeteredLinesOfCodeCount",
1702+
"target": "com.amazonaws.codegurureviewer#LinesOfCodeCount",
16711703
"traits": {
16721704
"smithy.api#documentation": "<p>\n Lines of code metered in the code review. For the initial code review pull request and all subsequent revisions, \n this includes all lines of code in the files added to the pull request. In subsequent revisions, for files that already \n existed in the pull request, this includes only the changed lines of code. In both cases, this does not include non-code lines such as comments \n and import statements. For example, if you submit a pull request containing 5 files, each with 500 lines of code, and in \n a subsequent revision you added a new file with 200 lines of code, and also modified a total of 25 lines across the initial 5 files, \n <code>MeteredLinesOfCodeCount</code> includes the first 5 files (5 * 500 = 2,500 lines), the new file (200 lines) and the 25 changed lines of\n code for a total of 2,725 lines of code.\n </p>"
16731705
}
16741706
},
1707+
"SuppressedLinesOfCodeCount": {
1708+
"target": "com.amazonaws.codegurureviewer#LinesOfCodeCount",
1709+
"traits": {
1710+
"smithy.api#documentation": "<p>Lines of code suppressed in the code review based on the <code>excludeFiles</code>\n element in the <code>aws-codeguru-reviewer.yml</code> file. For full repository analyses,\n this number includes all lines of code in the files that are suppressed. For pull requests,\n this number only includes the <i>changed</i> lines of code that are\n suppressed. In both cases, this number does not include non-code lines such as comments and\n import statements. For example, if you initiate a full repository analysis on a repository\n containing 5 files, each file with 100 lines of code, and 2 files are listed as excluded in\n the <code>aws-codeguru-reviewer.yml</code> file, then\n <code>SuppressedLinesOfCodeCount</code> returns 200 (2 * 100) as the total number of\n lines of code suppressed. However, if you submit a pull request for the same repository,\n then <code>SuppressedLinesOfCodeCount</code> only includes the lines in the 2 files\n that changed. If only 1 of the 2 files changed in the pull request, then\n <code>SuppressedLinesOfCodeCount</code> returns 100 (1 * 100) as the total number of\n lines of code suppressed.</p>"
1711+
}
1712+
},
16751713
"FindingsCount": {
16761714
"target": "com.amazonaws.codegurureviewer#FindingsCount",
16771715
"traits": {

0 commit comments

Comments
 (0)