Skip to content

Commit fb2afa6

Browse files
committed
feat: initial public scaffold (CLI, tests, CI, CodeQL)
0 parents  commit fb2afa6

25 files changed

+1295
-0
lines changed

.github/workflows/build.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: CI / build
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: "ci-${{ github.ref }}"
12+
cancel-in-progress: false
13+
14+
jobs:
15+
python:
16+
name: python (${{ matrix.python-version }})
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 15
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
python-version: [ "3.11", "3.12" ]
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Install Poetry
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install poetry
37+
38+
- name: Cache Poetry
39+
uses: actions/cache@v4
40+
with:
41+
path: ~/.cache/pypoetry
42+
key: poetry-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
43+
restore-keys: |
44+
poetry-${{ runner.os }}-${{ matrix.python-version }}-
45+
46+
- name: Install deps
47+
run: |
48+
poetry install --no-interaction
49+
50+
- name: Lint (ruff)
51+
run: |
52+
mkdir -p _ci_logs
53+
poetry run ruff check . --output-format=github 2>&1 | tee -a _ci_logs/ruff.log
54+
55+
- name: Format (black --check)
56+
run: |
57+
poetry run black --check . 2>&1 | tee -a _ci_logs/black.log
58+
59+
- name: Tests (pytest 100%)
60+
env:
61+
PYTHONPATH: src
62+
run: |
63+
poetry run pytest -q 2>&1 | tee -a _ci_logs/pytest.log
64+
65+
- name: Type check (mypy src)
66+
run: |
67+
poetry run mypy src 2>&1 | tee -a _ci_logs/mypy.log
68+
69+
- name: Upload logs
70+
if: always()
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: logs-${{ matrix.python-version }}
74+
path: _ci_logs
75+
76+
- name: Job summary
77+
if: always()
78+
run: |
79+
echo "### CI logs for Python ${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY
80+
echo "" >> $GITHUB_STEP_SUMMARY
81+
echo "- ruff: See artifact logs-${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY
82+
echo "- black: See artifact logs-${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY
83+
echo "- pytest: See artifact logs-${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY
84+
echo "- mypy: See artifact logs-${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY

.github/workflows/codeql.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CodeQL Analysis
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '43 3 * * 5'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
security-events: write
15+
16+
concurrency:
17+
group: "codeql-${{ github.ref }}"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
analyze:
22+
name: Analyze
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 30
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@v3
30+
with:
31+
languages: python
32+
- name: Autobuild
33+
uses: github/codeql-action/autobuild@v3
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@v3
36+
with:
37+
category: "/language:python"

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
__pycache__/
2+
*.pyc
3+
.venv/
4+
.dist/
5+
build/
6+
dist/
7+
.coverage
8+
.pytest_cache/
9+
.mypy_cache/
10+
.cache/
11+
*.egg-info/
12+
coverage.xml

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 CoderDeltaLAN
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

PREFLIGHT_LOCAL.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Ejecutar desde el repo:
2+
cd /home/user/Proyectos/osv-vuln-bot
3+
4+
# Limpieza
5+
rm -rf .venv dist build .mypy_cache .pytest_cache _ci_logs
6+
7+
# Instalar
8+
poetry install --no-interaction
9+
10+
# Gates Always-Green
11+
poetry run ruff check . --fix
12+
poetry run ruff check .
13+
poetry run black .
14+
poetry run black --check .
15+
16+
# Tests 100%
17+
PYTHONPATH=src poetry run pytest -q
18+
19+
# Type-check
20+
poetry run mypy src
21+
22+
# Smoke CLI
23+
poetry run osv-vuln-bot --help
24+
poetry run osv-vuln-bot scan --deps examples/deps.sample.json --fail-on critical

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# osv-vuln-bot
2+
3+
Automated OSV vulnerability scanner CLI. Scans a dependency manifest and reports findings.
4+
Roadmap: open dependency bump PRs prioritized by severity.
5+
6+
## Quick start
7+
```bash
8+
poetry install --no-interaction
9+
poetry run osv-vuln-bot scan --deps examples/deps.sample.json --out /tmp/osv-report.json --fail-on high
10+
```
11+
12+
## Manifest format
13+
`deps.json` is an array of objects:
14+
```json
15+
[
16+
{"ecosystem":"PyPI","name":"requests","version":"2.32.0"},
17+
{"ecosystem":"npm","name":"lodash","version":"4.17.21"}
18+
]
19+
```
20+
21+
## CI
22+
- Workflow: **CI / build** (Python 3.11/3.12; uploads logs artifacts).
23+
- Code scanning: **CodeQL Analysis**.
24+
25+
License: MIT.

_ci_logs/black_check.log

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
All done! ✨ 🍰 ✨
2+
9 files would be left unchanged.

_ci_logs/black_format.log

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
All done! ✨ 🍰 ✨
2+
9 files left unchanged.

_ci_logs/install.log

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Creating virtualenv osv-vuln-bot in /home/user/Proyectos/osv-vuln-bot/.venv
2+
Installing dependencies from lock file
3+
4+
Package operations: 24 installs, 0 updates, 0 removals
5+
6+
- Installing certifi (2025.8.3)
7+
- Installing h11 (0.16.0)
8+
- Installing idna (3.10)
9+
- Installing packaging (25.0)
10+
- Installing pluggy (1.6.0)
11+
- Installing iniconfig (2.1.0)
12+
- Installing pygments (2.19.2)
13+
- Installing sniffio (1.3.1)
14+
- Installing typing-extensions (4.15.0)
15+
- Installing anyio (4.10.0)
16+
- Installing click (8.2.1)
17+
- Installing coverage (7.10.6)
18+
- Installing httpcore (1.0.9)
19+
- Installing mypy-extensions (1.1.0)
20+
- Installing pathspec (0.12.1)
21+
- Installing platformdirs (4.4.0)
22+
- Installing pytest (8.4.2)
23+
- Installing urllib3 (2.5.0)
24+
- Installing black (24.10.0)
25+
- Installing httpx (0.27.2)
26+
- Installing mypy (1.18.1)
27+
- Installing pytest-cov (5.0.0)
28+
- Installing types-requests (2.32.4.20250809)
29+
- Installing ruff (0.5.7)
30+
31+
Installing the current project: osv-vuln-bot (0.1.0)

_ci_logs/mypy.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Success: no issues found in 3 source files

0 commit comments

Comments
 (0)