Skip to content

ci: add tooling, offline tests and scheduled checks - #2

Merged
RejectModders merged 7 commits into
mainfrom
ci/tooling-and-checks
Nov 29, 2026
Merged

RejectModders merged 7 commits into
mainfrom
ci/tooling-and-checks

Conversation

@RejectModders

Copy link
Copy Markdown
Member

Builds on #1, so merge that one first. The repository had no CI, and its only tests needed a live API key.

  • Python 3.11 or newer, an SPDX licence field, py.typed, requests 2.33.0 or newer (2.32.5 has an advisory), and __version__ read from the package metadata.
  • uv.lock is committed and skips releases younger than three days.
  • ruff and mypy --strict pass. Two changes are visible to callers: Severity is a StrEnum, and the placeholder timestamp is timezone-aware. Both are in the changelog.
  • Offline tests that replace the network and fail if anything tries to connect. The live tests moved to tests/live, run only with pytest -m live and VULNRADAR_TOKEN, and no longer read .env files or a generic API_KEY.
  • CI on pull requests and weekly: lint, types, tests on 3.11 to 3.14 and Windows, build and install with the oldest allowed dependencies, dependency audit, gitleaks over the whole history, CodeQL. The weekly run also lists newer releases.
  • Dependabot for Python, actions and the gitleaks image, with a cooldown of three days (four for Python, so the lockfile can always take the update).

The API client itself is unchanged apart from the above: it still targets the retired v2 API, which is the next piece of work.

Tested locally on Windows with Python 3.11, 3.12 and 3.13: ruff, mypy and the offline tests pass (46 tests), the live tests skip without a token, the package builds and passes twine check --strict, and the dependency audits find nothing. Python 3.14, Linux and the gitleaks step were not run locally.

Move the licence to an SPDX identifier, ship py.typed, raise requests to
2.33.0 to leave out an advisory, and read __version__ from the package
metadata so pyproject.toml is the only place it is written. uv.lock is now
committed and skips releases younger than three days.
Format the package, sort imports and fill in the missing type arguments.
Two changes can be seen by callers: Severity is now a StrEnum, so str()
gives the value, and the placeholder timestamp used when a reply has none
is timezone-aware.
The only tests called the live API, so nothing could run without a key.
The new ones replace the network with a stand-in and fail if anything tries
to connect. The live tests moved to tests/live and run with `pytest -m live`
when VULNRADAR_TOKEN is set. They no longer read .env files or fall back to
a generic API_KEY variable.
Lint, strict types, tests on Python 3.11 to 3.14 and on Windows, a build
that installs the wheel with the oldest allowed dependencies, a dependency
audit, a gitleaks scan of the whole history and CodeQL. The schedule also
reports newer releases. Actions are pinned to commits, and Dependabot waits
three days after a release before proposing it.
Fail the secret scan if it reports no commits, audit the oldest versions the
package allows and import it with warnings as errors, keep pushes from
cancelling scheduled runs, and give Dependabot's Python updates one more day
so the lockfile can always take them. The changelog now covers two behaviour
changes it missed.
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@RejectModders
RejectModders changed the base branch from chore/recover-b2 to main November 29, 2026 02:31
@RejectModders
RejectModders merged commit 77cae05 into main Nov 29, 2026
13 checks passed
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.

2 participants