Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed logging in import runner #1809

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kunalsz
Copy link

@kunalsz kunalsz commented Mar 11, 2025

In reference to the issue #1477

Changes made:

  • In import_runner.py the logging message has been changed from
except ValidationError as e:
        logger.warning(f"Invalid vulnerability reference: {reference!r}: {e}")

to

except ValidationError as e:
        error_message = str(e)
        if "Vulnerability reference with this Url already exists." in error_message:
            logger.debug(f"Duplicate vulnerability reference ignored: {reference!r}")
        else:
            logger.warning(f"Invalid vulnerability reference: {reference!r}: {e}")
  • This ensures that

    • Duplicate reference messages no longer appear as warnings but be logged in debug mode logger.debug
    • Other validation errors should still be logged as warnings
  • Tests created to ensure proper logging of error messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant