Skip to content

Commit

Permalink
Flip blocking logic and base it on defaults
Browse files Browse the repository at this point in the history
Signed-off-by: Adolfo García Veytia (puerco) <puerco@stacklok.com>
  • Loading branch information
puerco committed May 14, 2024
1 parent edc029c commit eeb2ada
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
18 changes: 12 additions & 6 deletions internal/engine/eval/trusty/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,22 @@ func defaultConfig() *config {
Action: pr_actions.ActionSummary,
EcosystemConfig: []ecosystemConfig{
{
Name: "npm",
Score: 5.0,
Name: "npm",
Score: 5.0,
Provenance: 5.0,
Activity: 5.0,
},
{
Name: "pypi",
Score: 5.0,
Name: "pypi",
Score: 5.0,
Provenance: 5.0,
Activity: 5.0,
},
{
Name: "go",
Score: 5.0,
Name: "go",
Score: 5.0,
Provenance: 5.0,
Activity: 5.0,
},
},
}
Expand Down
6 changes: 3 additions & 3 deletions internal/engine/eval/trusty/trusty.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,14 @@ func classifyDependency(
}
}

if ecoConfig.Score <= packageScore {
if ecoConfig.Score > packageScore {
reasons = append(reasons, TRUSTY_LOW_SCORE)
}
if ecoConfig.Provenance <= descr["provenance"].(float64) {
if ecoConfig.Provenance > descr["provenance"].(float64) {
reasons = append(reasons, TRUSTY_LOW_PROVENANCE)
}

if ecoConfig.Activity <= descr["activity"].(float64) {
if ecoConfig.Activity > descr["activity"].(float64) {
reasons = append(reasons, TRUSTY_LOW_ACTIVITY)
}
if len(reasons) > 0 {
Expand Down

0 comments on commit eeb2ada

Please sign in to comment.