-
-
Couldn't load subscription status.
- Fork 239
Filter out OSVDB and normalize URL references in Metasploit pipeline … #1993
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
base: main
Are you sure you want to change the base?
Filter out OSVDB and normalize URL references in Metasploit pipeline … #1993
Conversation
…boutcode-org#1697 * Skip OSVDB-prefixed references when processing Metasploit data * Strip "URL-" prefix from references and add commit links if present * Ensure commit links are stored in notes in a sorted order * Improves data consistency and avoids invalid aliases Signed-off-by: Sarafaraj Nasardi <[email protected]>
| ref for ref in references if not ref.startswith("OSVDB") and not ref.startswith("URL-") | ||
| ] | ||
| # Regex to allow short commit hashes (6–40 chars) | ||
| commit_pattern = re.compile(r"https://github\.com/.+/commit/[a-f0-9]{6,40}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this function instead and this should not be github-specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, we need tests. Also please avoid AI-generated PR comments, they are annoying and bland.
| }, | ||
| ) | ||
|
|
||
| return 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we return 1 here? This is highly unsual
| source_url = f"https://github.com/rapid7/metasploit-framework/tree/master{path}" | ||
| source_date_published = None | ||
|
|
||
| # Add unique commit links to notes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this comment? The code below looks obvious
What does this PR do?
Why is this needed?
Some references in Metasploit data include OSVDB identifiers and URL-prefixed strings,
which are inconsistent and can cause invalid aliases. This change normalizes references
and ensures proper commit link handling.
How was this tested?
commit_linksRelated issue