Skip to content

Commit 6417ea2

Browse files
committed
ci: add lock-drift, import-smoke, and pip-audit; skip e2e on dependabot
python-tests.yml: - `uv lock --locked` -- fails if uv.lock has drifted from pyproject.toml. Prevents the "forgot to commit the lockfile" class of mistake. - Import smoke step that loads every top-level module touching the upgraded packages (cryptography, gitpython, requests, urllib3, ...). Catches API-removal breaks from minor/patch deprecations that the unit suite alone wouldn't surface. - `uvx pip-audit --strict` against the synced env -- light CVE check on the resolved transitive tree. Runs in seconds via uv's caching. e2e-test.yml: - Skip e2e on Dependabot PRs. They don't have access to the Socket API secret so e2e would always fail on them, polluting the PR check UI. Supply-chain risk for dep bumps is covered by dependabot-review.yml's Socket Firewall smoke jobs, which need no secrets. Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
1 parent 1d8b1f7 commit 6417ea2

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

.github/workflows/e2e-test.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ permissions:
1111

1212
jobs:
1313
e2e:
14-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
14+
# Skip e2e on:
15+
# - PRs from forks (no secrets)
16+
# - Dependabot PRs (no secrets, and dependency-bump risk is already
17+
# covered by dependabot-review.yml's Socket Firewall smoke jobs)
18+
if: >-
19+
(github.event_name != 'pull_request' ||
20+
github.event.pull_request.head.repo.full_name == github.repository) &&
21+
github.event.pull_request.user.login != 'dependabot[bot]'
1522
runs-on: ubuntu-latest
1623
strategy:
1724
fail-fast: false

.github/workflows/python-tests.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,24 @@ jobs:
4848
python -m pip install --upgrade pip
4949
pip install uv
5050
uv sync --extra test
51+
- name: 🔒 verify uv.lock is in sync with pyproject.toml
52+
run: uv lock --locked
5153
- name: 🧪 run tests
5254
run: uv run pytest -q tests/unit/ tests/core/
55+
- name: 💨 import smoke (catches API-removal breaks from upgraded deps)
56+
run: |
57+
uv run python -c "
58+
from socketsecurity.socketcli import cli, build_socket_sdk, _emit_infrastructure_error
59+
from socketsecurity.core import Core
60+
from socketsecurity.core.exceptions import (
61+
APIFailure, RequestTimeoutExceeded, APIResourceNotFound,
62+
)
63+
from socketsecurity.core.git_interface import Git
64+
from socketsecurity.config import CliConfig
65+
print('import smoke OK')
66+
"
67+
- name: 🛡️ pip-audit (known CVEs in the synced env)
68+
run: uvx pip-audit --strict --disable-pip --progress-spinner off
5369

5470
unsupported-python-install:
5571
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)