Repository navigation
feat: Add Dependabot alerts stream - #611
akashmalbari wants to merge 5 commits into
Conversation
|
Addressed the Python 3.14 CI failure in 340603f.
|
| use_fake_since_parameter = True | ||
| # Dependabot alerts use Link-header cursors instead of page numbers. | ||
| use_cursor_pagination = True | ||
| # Dependabot alerts require an explicit repository permission, so users |
There was a problem hiding this comment.
| # Dependabot alerts require an explicit repository permission, so users | |
| tolerated_http_errors: ClassVar[list[int]] = [404, 403] | |
| # Dependabot alerts require an explicit repository permission, so users |
There was a problem hiding this comment.
Applied in 343a0f7. The stream now tolerates 404/403 responses and the regression test verifies that a missing Dependabot-alerts permission completes without records.\n\nValidated with uv run pytest tests/test_dependabot_alerts.py, Ruff check/format, mypy, and ty.
There was a problem hiding this comment.
Hmm. Actually... could this swallow a 403 that is in fact a rate-limit, which should be retried?
There was a problem hiding this comment.
Confirmed and fixed in 34d74c7. The REST client now lets primary and secondary rate-limit 403s reach the existing retry logic before considering a status tolerated; non-rate-limit 403s and 404s remain tolerated for this stream.\n\nAdded regression coverage for both rate-limit responses plus the missing-permission case. Validated with uv run pytest tests/test_dependabot_alerts.py, Ruff check/format, mypy, and ty.
Signed-off-by: Edgar Ramírez-Mondragón <edgarrm358@gmail.com>
34d74c7 to
a938dbe
Compare
Summary
Adds a selectable
dependabot_alertsrepository stream backed by GitHub’s Dependabot alerts REST endpoint. The stream uses cursor pagination, sorts byupdateddescending, and keeps per-repository incremental state so existing alerts are not replayed unnecessarily.The schema retains alert state, vulnerable dependency details, advisory/CVSS/EPSS/CWE data, remediation versions, and assignees. README permission guidance explains the required Dependabot alerts read access.
Fixes #590
Validation
uv run pytest tests/test_dependabot_alerts.pyuv run pytest -m noconfig tests/test_discover.pyuvx ruff check tap_github/repository_streams.py tap_github/streams.py tests/test_dependabot_alerts.pyuvx ruff format --check tap_github/repository_streams.py tap_github/streams.py tests/test_dependabot_alerts.pyuv run mypy tap_githubuv run ty check tap_githubuv run pytestcompleted with 100 passing tests; 9 existing live-API tests failed because their unauthenticated fixture requests received GitHub 403/rate-limit responses.Compatibility and security
This is additive and does not change existing stream behavior or configuration. Users who select
dependabot_alertsneed a token with Dependabot alerts read permission (security_eventsfor classic PATs, or the fine-grained/GitHub App repository permission). No credentials are logged or stored.