Skip to content

Commit

Permalink
indicate whether a suggestion was confident or not in the json schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Gankra committed Jan 21, 2023
1 parent 55b142c commit efc2778
Show file tree
Hide file tree
Showing 52 changed files with 773 additions and 354 deletions.
2 changes: 2 additions & 0 deletions src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,8 @@ pub struct JsonSuggestItem {
/// The diff (or full version) we recommend auditing
// FIXME(SCHEMA): we probably shouldn't expose this internal type
pub suggested_diff: DiffRecommendation,
/// Whether the suggestion is confident or a guess (de-emphasize guesses)
pub confident: bool,
}

/// A string of the form "package:version"
Expand Down
1 change: 1 addition & 0 deletions src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2879,6 +2879,7 @@ impl<'a> ResolveReport<'a> {
.map(|s| s.to_owned())
.collect(),
suggested_diff: item.suggested_diff.clone(),
confident: item.suggested_criteria.is_fully_confident(),
}
};
JsonReportConclusion::FailForVet(JsonReportFailForVet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "third-core",
Expand All @@ -67,7 +68,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "thirdA",
Expand All @@ -83,7 +85,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "thirdAB",
Expand All @@ -99,7 +102,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
}
],
"suggest_by_criteria": {
Expand All @@ -118,7 +122,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "third-core",
Expand All @@ -134,7 +139,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "thirdA",
Expand All @@ -150,7 +156,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "thirdAB",
Expand All @@ -166,7 +173,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "normal",
Expand All @@ -53,7 +54,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
}
],
"suggest_by_criteria": {
Expand All @@ -72,7 +74,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
}
],
"safe-to-run": [
Expand All @@ -90,7 +93,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "dev-cycle-direct",
Expand All @@ -81,7 +82,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "normal",
Expand All @@ -97,7 +99,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "simple-dev",
Expand All @@ -113,7 +116,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "dev-cycle-indirect",
Expand All @@ -129,7 +133,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": false
},
{
"name": "simple-dev-indirect",
Expand All @@ -145,7 +150,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": false
}
],
"suggest_by_criteria": {
Expand All @@ -164,7 +170,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "normal",
Expand All @@ -180,7 +187,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
}
],
"safe-to-run": [
Expand All @@ -198,7 +206,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "simple-dev",
Expand All @@ -214,7 +223,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "dev-cycle-indirect",
Expand All @@ -230,7 +240,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": false
},
{
"name": "simple-dev-indirect",
Expand All @@ -246,7 +257,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": false
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "dev-cycle-direct",
Expand All @@ -67,7 +68,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "normal",
Expand All @@ -83,7 +85,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "simple-dev",
Expand All @@ -99,7 +102,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
}
],
"suggest_by_criteria": {
Expand All @@ -118,7 +122,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "normal",
Expand All @@ -134,7 +139,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
}
],
"safe-to-run": [
Expand All @@ -152,7 +158,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "simple-dev",
Expand All @@ -168,7 +175,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
},
{
"name": "third-normal",
Expand All @@ -53,7 +54,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
}
],
"suggest_by_criteria": {
Expand All @@ -72,7 +74,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
}
],
"safe-to-run": [
Expand All @@ -90,7 +93,8 @@ expression: json
"deletions": 0,
"files_changed": 1
}
}
},
"confident": true
}
]
},
Expand Down
Loading

0 comments on commit efc2778

Please sign in to comment.