Following version 0.9.7 release, which contains this PR, there is a bug when a project doesn't have "meta.latest_issue_counts` property.
The following line change is missing handling the missing property case.
Therefore the entire call raises an exception, and all projects, even valid ones with the expected property, don't get returned.
To fix this issue, adding default values and two places is necessary.
The second default value is needed because Project.issueCountsBySeverity.low, Project.issueCountsBySeverity.medium, and Project.issueCountsBySeverity.high are mandatory fields.
Steps To Reproduce
import snyk
snyk_client = snyk.SnykClient("<put-snyk-api-token-here>")
orgs = snyk_client.organizations.all()
for org in orgs:
org.projects.all() # exception here
Is there an existing issue for this?
Description of the bug
Following version 0.9.7 release, which contains this PR, there is a bug when a project doesn't have "meta.latest_issue_counts` property. The following line change is missing handling the missing property case. Therefore the entire call raises an exception, and all projects, even valid ones with the expected property, don't get returned.
To fix this issue, adding default values and two places is necessary.
The following is a fix suggestion:
The second default value is needed because
Project.issueCountsBySeverity.low
,Project.issueCountsBySeverity.medium
, andProject.issueCountsBySeverity.high
are mandatory fields.Steps To Reproduce
Additional Information
No response