ansible / ansible-content-parser

Apache License 2.0
3 stars 4 forks source link

ValueError occurs with ansible-risk-insights >= 0.2.2 #26

Closed TamiTakamiya closed 10 months ago

TamiTakamiya commented 10 months ago

Issue: AAP-18283

Description

ansible-content-parser 0.0.7 using ansible-lint:6.22.0 ansible-core:2.15.6

ValueError: <class 'ansible_risk_insight.models.File'> is not a supported type for Sage objects

Steps to Reproduce

ansible-content-parser --skip-ansible-lint https://github.com/IBM/Ansible-OpenShift-Provisioning.git /tmp/y

Analysis

The class 'ansible_risk_insight.models.File' was introduced in ansible-risk-insight 0.2.2 and sage library (sage-scan) does not support the class yet.

This PR is for forcing ansible-content-parser to use ansible-risk-insight 0.2.1. Once sage-scan is updated to support the latest version of ansible-risk-insight, ansible-content-parser will be updated accordingly.

Testing

Steps to test

  1. Pull down the PR
  2. Run tox command to build a wheel (.whl) file
  3. Prepare a venv and install the wheel file built on the step 2
  4. Execute ansible-content-parser --skip-ansible-lint https://github.com/IBM/Ansible-OpenShift-Provisioning.git /tmp/y to make sure no error is displayed.

Scenarios tested

I have run the steps described in the Steps to test section

hirokuni-kitahara commented 10 months ago

Hi @TamiTakamiya , Thank you for reporting this issue! I could reproduce the error in my env. This was caused by the outdated version of Sage (sage-scan) on PyPI. I have confirmed that ansible-content-parser works without any issues when the latest main branch of Sage and the newer ansible-risk-insight 0.2.4 are used. I will update sage-scan version to 0.0.2 and let you know here once it is ready. Thank you.

hirokuni-kitahara commented 10 months ago

@TamiTakamiya I have released sage-scan 0.0.2 now and confirmed ansible-content-parser works correctly with it. Could you please try sage-scan 0.0.2 and ansible-risk-insight 0.2.4 ? Thank you!

TamiTakamiya commented 10 months ago

@hirokuni-kitahara Thank you very much for your quick response! I have verified that sage-scan 0.0.2 fixed the problem. I am closing this PR .