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 Oct 31, 2022
1 parent d29a872 commit 7b6db24
Show file tree
Hide file tree
Showing 52 changed files with 747 additions and 372 deletions.
2 changes: 2 additions & 0 deletions src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,8 @@ pub struct JsonSuggestItem {
pub suggested_criteria: Vec<CriteriaName>,
/// The diff (or full version) we recommend auditing
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 @@ -50,7 +50,8 @@ expression: json
"raw": "+25",
"count": 25
}
}
},
"confident": true
},
{
"name": "third-core",
Expand All @@ -65,7 +66,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "thirdA",
Expand All @@ -80,7 +82,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "thirdAB",
Expand All @@ -95,7 +98,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
}
],
"suggest_by_criteria": {
Expand All @@ -113,7 +117,8 @@ expression: json
"raw": "+25",
"count": 25
}
}
},
"confident": true
},
{
"name": "third-core",
Expand All @@ -128,7 +133,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "thirdA",
Expand All @@ -143,7 +149,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "thirdAB",
Expand All @@ -158,7 +165,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "normal",
Expand All @@ -51,7 +52,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
}
],
"suggest_by_criteria": {
Expand All @@ -69,7 +71,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
}
],
"safe-to-run": [
Expand All @@ -86,7 +89,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "dev-cycle-direct",
Expand All @@ -79,7 +80,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "normal",
Expand All @@ -94,7 +96,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "simple-dev",
Expand All @@ -109,7 +112,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "dev-cycle-indirect",
Expand All @@ -124,7 +128,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": false
},
{
"name": "simple-dev-indirect",
Expand All @@ -139,7 +144,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": false
}
],
"suggest_by_criteria": {
Expand All @@ -157,7 +163,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "normal",
Expand All @@ -172,7 +179,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
}
],
"safe-to-run": [
Expand All @@ -189,7 +197,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "simple-dev",
Expand All @@ -204,7 +213,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "dev-cycle-indirect",
Expand All @@ -219,7 +229,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": false
},
{
"name": "simple-dev-indirect",
Expand All @@ -234,7 +245,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": false
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "dev-cycle-direct",
Expand All @@ -65,7 +66,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "normal",
Expand All @@ -80,7 +82,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "simple-dev",
Expand All @@ -95,7 +98,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
}
],
"suggest_by_criteria": {
Expand All @@ -113,7 +117,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "normal",
Expand All @@ -128,7 +133,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
}
],
"safe-to-run": [
Expand All @@ -145,7 +151,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "simple-dev",
Expand All @@ -160,7 +167,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
},
{
"name": "third-normal",
Expand All @@ -51,7 +52,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
}
],
"suggest_by_criteria": {
Expand All @@ -69,7 +71,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
}
],
"safe-to-run": [
Expand All @@ -86,7 +89,8 @@ expression: json
"raw": "+100",
"count": 100
}
}
},
"confident": true
}
]
},
Expand Down
Loading

0 comments on commit 7b6db24

Please sign in to comment.