Skip to content

Conversation

@lukasbestle
Copy link
Contributor

About the feature

This PR adds a new --security-advisories argument. This argument is included in --all.

When enabled, it grabs the repository security advisories and dumps them into a security-advisories directory.

This implements #243.

Implementation

I've copied and adapted the existing implementation of backup_milestones to backup_security_advisories as the underlying GitHub API structure is basically identical.

Advisories are indexed by their ghsa_id (GitHub Security Advisory ID), which is used as a primary key in the GitHub web URLs and also the way these advisories are commonly referred to.

Testing

I've tested the code on macOS with a public repo that contains both open and closed advisories.

@josegonzalez
Copy link
Owner

@Iamrodos mind helping @lukasbestle figure out how to fix this/maybe add a test case for this too?

@Iamrodos
Copy link
Contributor

Iamrodos commented Jan 10, 2026

@Iamrodos mind helping @lukasbestle figure out how to fix this/maybe add a test case for this too?

Will do. Can get to it in a few hours later today. @lukasbestle you can give me access to the PR, otherwise I will just attach a patch file you can add which adjusts the tests. I can also add a new test for this.

@Iamrodos
Copy link
Contributor

@lukasbestle here is a patch you can apply which will add the new argument to the tests.
fix-test-for-security-advisories.patch

Download the file and git apply fix-test-for-security-advisories.patch

OR

Edit tests/test_all_starred.py and add this line after line 39 (args.include_milestones = False):

    args.include_security_advisories = False

After this PR is merged, I will submit a new PR that makes the tests less fragile when a new parameter is added. I hit this myself on some of my other PRs and had it as a thing to fix.

I might also submit a PR template that includes

  ## Test plan
  - [ ] Tests pass locally (`pytest`)
  - [ ] Linting passes (`flake8 --ignore=E501`)

@lukasbestle
Copy link
Contributor Author

lukasbestle commented Jan 10, 2026

Thanks for your super quick replies and the patch.

@josegonzalez josegonzalez merged commit 54a9872 into josegonzalez:master Jan 11, 2026
10 checks passed
@lukasbestle lukasbestle deleted the feat/security-advisories branch January 11, 2026 19:53
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.

3 participants