slowql 0.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- slowql-0.0.0/.dockerignore +9 -0
- slowql-0.0.0/.github/CODEOWNERS +11 -0
- slowql-0.0.0/.github/ISSUE_TEMPLATE/bug_report.yml +34 -0
- slowql-0.0.0/.github/ISSUE_TEMPLATE/detector_request.yml +24 -0
- slowql-0.0.0/.github/ISSUE_TEMPLATE/feature_request.yml +24 -0
- slowql-0.0.0/.github/dependabot.yml +10 -0
- slowql-0.0.0/.github/pull_request_template.md +15 -0
- slowql-0.0.0/.github/security.md +15 -0
- slowql-0.0.0/.github/workflows/ci.yml +189 -0
- slowql-0.0.0/.github/workflows/dependency-review.yml +17 -0
- slowql-0.0.0/.github/workflows/docs.yml +26 -0
- slowql-0.0.0/.github/workflows/sbom.yml +27 -0
- slowql-0.0.0/.github/workflows/snyk.yml +19 -0
- slowql-0.0.0/.gitignore +29 -0
- slowql-0.0.0/CHANGELOG.md +14 -0
- slowql-0.0.0/CODE_OF_CONDUCT.md +27 -0
- slowql-0.0.0/CONTRIBUTING.md +27 -0
- slowql-0.0.0/Dockerfile +65 -0
- slowql-0.0.0/LICENSE +53 -0
- slowql-0.0.0/MANIFEST.in +12 -0
- slowql-0.0.0/Makefile +53 -0
- slowql-0.0.0/PKG-INFO +239 -0
- slowql-0.0.0/README.md +202 -0
- slowql-0.0.0/SECURITY.md +20 -0
- slowql-0.0.0/assets/demo.gif +0 -0
- slowql-0.0.0/codecov.yml +6 -0
- slowql-0.0.0/docs/CHANGELOG.md +23 -0
- slowql-0.0.0/docs/architecture/detector-system.md +79 -0
- slowql-0.0.0/docs/architecture/export-system.md +94 -0
- slowql-0.0.0/docs/architecture/parser-engine.md +71 -0
- slowql-0.0.0/docs/architecture/system-design.md +84 -0
- slowql-0.0.0/docs/detectors/critical-detectors.md +56 -0
- slowql-0.0.0/docs/detectors/custom-detectors.md +78 -0
- slowql-0.0.0/docs/detectors/high-severity.md +69 -0
- slowql-0.0.0/docs/detectors/low-severity.md +57 -0
- slowql-0.0.0/docs/detectors/medium-severity.md +57 -0
- slowql-0.0.0/docs/detectors/overview.md +60 -0
- slowql-0.0.0/docs/development/adding-detectors.md +99 -0
- slowql-0.0.0/docs/development/contributing.md +90 -0
- slowql-0.0.0/docs/development/release-process.md +99 -0
- slowql-0.0.0/docs/development/setup.md +67 -0
- slowql-0.0.0/docs/development/testing.md +80 -0
- slowql-0.0.0/docs/enterprise/deployment.md +85 -0
- slowql-0.0.0/docs/enterprise/overview.md +51 -0
- slowql-0.0.0/docs/enterprise/support.md +66 -0
- slowql-0.0.0/docs/enterprise/team-features.md +79 -0
- slowql-0.0.0/docs/examples/basic-usage.md +65 -0
- slowql-0.0.0/docs/examples/github-actions.md +64 -0
- slowql-0.0.0/docs/examples/gitlab-ci.md +61 -0
- slowql-0.0.0/docs/examples/jenkins.md +67 -0
- slowql-0.0.0/docs/examples/nasty_queries.sql +85 -0
- slowql-0.0.0/docs/examples/pre-commit-hook.md +75 -0
- slowql-0.0.0/docs/examples/sample.sql +155 -0
- slowql-0.0.0/docs/getting-started/configuration.md +67 -0
- slowql-0.0.0/docs/getting-started/first-analysis.md +69 -0
- slowql-0.0.0/docs/getting-started/installation.md +48 -0
- slowql-0.0.0/docs/getting-started/quick-start.md +57 -0
- slowql-0.0.0/docs/index.md +49 -0
- slowql-0.0.0/docs/license.md +53 -0
- slowql-0.0.0/docs/security/best-practices.md +61 -0
- slowql-0.0.0/docs/security/security-policy.md +59 -0
- slowql-0.0.0/docs/security/vulnerability-reporting.md +59 -0
- slowql-0.0.0/docs/troubleshooting/common-issues.md +80 -0
- slowql-0.0.0/docs/troubleshooting/faq.md +79 -0
- slowql-0.0.0/docs/troubleshooting/performance.md +78 -0
- slowql-0.0.0/docs/tutorials/custom-detector-walkthrough.md +57 -0
- slowql-0.0.0/docs/tutorials/dashboard-integration.md +40 -0
- slowql-0.0.0/docs/tutorials/end-to-end-pipeline.md +54 -0
- slowql-0.0.0/docs/tutorials/team-onboarding-guide.md +55 -0
- slowql-0.0.0/docs/user-guide/ci-cd-integration.md +95 -0
- slowql-0.0.0/docs/user-guide/cli-reference.md +55 -0
- slowql-0.0.0/docs/user-guide/export-formats.md +72 -0
- slowql-0.0.0/docs/user-guide/file-analysis.md +70 -0
- slowql-0.0.0/docs/user-guide/interactive-mode.md +56 -0
- slowql-0.0.0/mkdocs.yml +64 -0
- slowql-0.0.0/mypy.ini +8 -0
- slowql-0.0.0/pyproject.toml +142 -0
- slowql-0.0.0/pytest.ini +6 -0
- slowql-0.0.0/requirements.txt +10 -0
- slowql-0.0.0/setup.cfg +4 -0
- slowql-0.0.0/site/assets/images/favicon.png +0 -0
- slowql-0.0.0/site/assets/javascripts/bundle.e71a0d61.min.js +16 -0
- slowql-0.0.0/site/assets/javascripts/bundle.e71a0d61.min.js.map +7 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.ar.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.da.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.de.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.du.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.el.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.es.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.fi.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.fr.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.he.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.hi.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.hu.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.hy.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.it.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.ja.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.jp.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.kn.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.ko.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.multi.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.nl.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.no.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.pt.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.ro.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.ru.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.sa.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.sv.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.ta.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.te.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.th.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.tr.min.js +18 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.vi.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/min/lunr.zh.min.js +1 -0
- slowql-0.0.0/site/assets/javascripts/lunr/tinyseg.js +206 -0
- slowql-0.0.0/site/assets/javascripts/lunr/wordcut.js +6708 -0
- slowql-0.0.0/site/assets/javascripts/workers/search.7a47a382.min.js +42 -0
- slowql-0.0.0/site/assets/javascripts/workers/search.7a47a382.min.js.map +7 -0
- slowql-0.0.0/site/assets/stylesheets/main.618322db.min.css +1 -0
- slowql-0.0.0/site/assets/stylesheets/main.618322db.min.css.map +1 -0
- slowql-0.0.0/site/assets/stylesheets/palette.ab4e12ef.min.css +1 -0
- slowql-0.0.0/site/assets/stylesheets/palette.ab4e12ef.min.css.map +1 -0
- slowql-0.0.0/site/examples/nasty_queries.sql +85 -0
- slowql-0.0.0/site/examples/sample.sql +155 -0
- slowql-0.0.0/site/sitemap.xml +3 -0
- slowql-0.0.0/site/sitemap.xml.gz +0 -0
- slowql-0.0.0/src/slowql/__init__.py +22 -0
- slowql-0.0.0/src/slowql/cli.py +318 -0
- slowql-0.0.0/src/slowql/cli_help.py +11 -0
- slowql-0.0.0/src/slowql/core/__init__.py +0 -0
- slowql-0.0.0/src/slowql/core/analyzer.py +389 -0
- slowql-0.0.0/src/slowql/core/detector.py +538 -0
- slowql-0.0.0/src/slowql/effects/__init__.py +2 -0
- slowql-0.0.0/src/slowql/effects/animations.py +363 -0
- slowql-0.0.0/src/slowql/formatters/__init__.py +2 -0
- slowql-0.0.0/src/slowql/formatters/console.py +787 -0
- slowql-0.0.0/src/slowql/metrics.py +42 -0
- slowql-0.0.0/src/slowql/telemetry.py +17 -0
- slowql-0.0.0/src/slowql.egg-info/PKG-INFO +239 -0
- slowql-0.0.0/src/slowql.egg-info/SOURCES.txt +156 -0
- slowql-0.0.0/src/slowql.egg-info/dependency_links.txt +1 -0
- slowql-0.0.0/src/slowql.egg-info/entry_points.txt +3 -0
- slowql-0.0.0/src/slowql.egg-info/requires.txt +12 -0
- slowql-0.0.0/src/slowql.egg-info/top_level.txt +1 -0
- slowql-0.0.0/tests/__init__.py +0 -0
- slowql-0.0.0/tests/conftest.py +94 -0
- slowql-0.0.0/tests/integration/__init__.py +0 -0
- slowql-0.0.0/tests/integration/test_cli.py +177 -0
- slowql-0.0.0/tests/performance/__init__.py +0 -0
- slowql-0.0.0/tests/performance/test_bemchmarks.py +68 -0
- slowql-0.0.0/tests/test_demo.py +48 -0
- slowql-0.0.0/tests/unit/__init__.py +0 -0
- slowql-0.0.0/tests/unit/test_analyzer.py +202 -0
- slowql-0.0.0/tests/unit/test_animations.py +95 -0
- slowql-0.0.0/tests/unit/test_console.py +180 -0
- slowql-0.0.0/tests/unit/test_detector.py +115 -0
- slowql-0.0.0/tests/unit/test_init.py +41 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: 🐛 Bug Report
|
|
2
|
+
description: Report a reproducible bug in SlowQL
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: ["bug"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for reporting a bug! Please fill out the details below.
|
|
10
|
+
- type: input
|
|
11
|
+
id: environment
|
|
12
|
+
attributes:
|
|
13
|
+
label: Environment
|
|
14
|
+
description: OS, Python version, SlowQL version
|
|
15
|
+
placeholder: "Ubuntu 22.04, Python 3.11, SlowQL 1.0.4"
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: steps
|
|
18
|
+
attributes:
|
|
19
|
+
label: Steps to Reproduce
|
|
20
|
+
description: What commands or inputs caused the bug?
|
|
21
|
+
- type: textarea
|
|
22
|
+
id: expected
|
|
23
|
+
attributes:
|
|
24
|
+
label: Expected Behavior
|
|
25
|
+
- type: textarea
|
|
26
|
+
id: actual
|
|
27
|
+
attributes:
|
|
28
|
+
label: Actual Behavior
|
|
29
|
+
- type: textarea
|
|
30
|
+
id: logs
|
|
31
|
+
attributes:
|
|
32
|
+
label: Relevant Logs/Output
|
|
33
|
+
render: shell
|
|
34
|
+
description: Please format logs/output as code for readability.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: 🔍 Detector Request
|
|
2
|
+
description: Propose a new SQL detector
|
|
3
|
+
title: "[Detector]: "
|
|
4
|
+
labels: ["detector"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Help us expand SlowQL’s detector library!
|
|
10
|
+
- type: input
|
|
11
|
+
id: name
|
|
12
|
+
attributes:
|
|
13
|
+
label: Detector Name
|
|
14
|
+
placeholder: "Missing WHERE clause detector"
|
|
15
|
+
- type: textarea
|
|
16
|
+
id: description
|
|
17
|
+
attributes:
|
|
18
|
+
label: Detector Description
|
|
19
|
+
description: What issue does this detector catch?
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: example
|
|
22
|
+
attributes:
|
|
23
|
+
label: Example SQL
|
|
24
|
+
description: Provide sample queries that should trigger this detector.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: ✨ Feature Request
|
|
2
|
+
description: Suggest a new feature or enhancement
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels: ["enhancement"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for suggesting a feature! Please describe your idea clearly.
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: description
|
|
12
|
+
attributes:
|
|
13
|
+
label: Feature Description
|
|
14
|
+
description: What should SlowQL do?
|
|
15
|
+
- type: textarea
|
|
16
|
+
id: motivation
|
|
17
|
+
attributes:
|
|
18
|
+
label: Motivation
|
|
19
|
+
description: Why is this feature useful?
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: alternatives
|
|
22
|
+
attributes:
|
|
23
|
+
label: Alternatives
|
|
24
|
+
description: Other ways you considered solving this?
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Pull Request
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
<!-- Describe your changes clearly -->
|
|
5
|
+
|
|
6
|
+
## Related Issue
|
|
7
|
+
<!-- Link to issue if applicable -->
|
|
8
|
+
|
|
9
|
+
## Checklist
|
|
10
|
+
- [ ] Tests added/updated
|
|
11
|
+
- [ ] Linting and type checks pass (`make all`)
|
|
12
|
+
- [ ] Documentation updated
|
|
13
|
+
- [ ] CI pipeline green
|
|
14
|
+
|
|
15
|
+
## Screenshots (if applicable)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# 🔐 Security Policy
|
|
2
|
+
|
|
3
|
+
If you discover a vulnerability in SlowQL, please report it privately.
|
|
4
|
+
|
|
5
|
+
## Reporting
|
|
6
|
+
- Email: elmehdi.makroumi@gmail.com
|
|
7
|
+
- GitHub: [Open a private advisory](https://github.com/makroumi/slowql/security/advisories)
|
|
8
|
+
|
|
9
|
+
We aim to respond within 48 hours and patch within 7 days.
|
|
10
|
+
|
|
11
|
+
## Scope
|
|
12
|
+
This policy covers:
|
|
13
|
+
- SQL parsing and analysis logic
|
|
14
|
+
- CLI behavior and output
|
|
15
|
+
- Containerized builds and published packages
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
name: CI Pipeline
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
tags:
|
|
7
|
+
- 'v*'
|
|
8
|
+
pull_request:
|
|
9
|
+
branches: [ main ]
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
# -------------------------------
|
|
13
|
+
# Linting
|
|
14
|
+
# -------------------------------
|
|
15
|
+
lint:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout repository
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Set up Python 3.12
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.12"
|
|
25
|
+
cache: "pip"
|
|
26
|
+
|
|
27
|
+
- name: Install Ruff
|
|
28
|
+
run: pip install ruff
|
|
29
|
+
|
|
30
|
+
- name: Run Ruff linter
|
|
31
|
+
run: ruff check src tests
|
|
32
|
+
|
|
33
|
+
# -------------------------------
|
|
34
|
+
# Type Checking
|
|
35
|
+
# -------------------------------
|
|
36
|
+
type-check:
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
steps:
|
|
39
|
+
- name: Checkout repository
|
|
40
|
+
uses: actions/checkout@v4
|
|
41
|
+
|
|
42
|
+
- name: Set up Python 3.12
|
|
43
|
+
uses: actions/setup-python@v5
|
|
44
|
+
with:
|
|
45
|
+
python-version: "3.12"
|
|
46
|
+
cache: "pip"
|
|
47
|
+
|
|
48
|
+
- name: Install Mypy
|
|
49
|
+
run: pip install mypy
|
|
50
|
+
|
|
51
|
+
- name: Run Mypy type checker
|
|
52
|
+
run: mypy src
|
|
53
|
+
|
|
54
|
+
# -------------------------------
|
|
55
|
+
# Tests + Coverage
|
|
56
|
+
# -------------------------------
|
|
57
|
+
tests:
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
steps:
|
|
60
|
+
- name: Checkout repository
|
|
61
|
+
uses: actions/checkout@v4
|
|
62
|
+
|
|
63
|
+
- name: Set up Python 3.12
|
|
64
|
+
uses: actions/setup-python@v5
|
|
65
|
+
with:
|
|
66
|
+
python-version: "3.12"
|
|
67
|
+
cache: "pip"
|
|
68
|
+
|
|
69
|
+
- name: Install dependencies
|
|
70
|
+
run: |
|
|
71
|
+
python -m pip install --upgrade pip
|
|
72
|
+
pip install -r requirements.txt
|
|
73
|
+
pip install -e .
|
|
74
|
+
pip install pytest pytest-cov pytest-benchmark
|
|
75
|
+
|
|
76
|
+
- name: Run test suite
|
|
77
|
+
run: |
|
|
78
|
+
pytest --maxfail=1 --disable-warnings --benchmark-disable -v \
|
|
79
|
+
--cov=src --cov-report=xml --cov-report=term-missing \
|
|
80
|
+
--junitxml=junit.xml -o junit_family=legacy
|
|
81
|
+
|
|
82
|
+
- name: Upload coverage to Codecov
|
|
83
|
+
uses: codecov/codecov-action@v4
|
|
84
|
+
with:
|
|
85
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
86
|
+
files: coverage.xml
|
|
87
|
+
flags: unittests
|
|
88
|
+
name: codecov-slowql
|
|
89
|
+
fail_ci_if_error: true
|
|
90
|
+
|
|
91
|
+
- name: Upload test results to Codecov
|
|
92
|
+
if: ${{ !cancelled() }}
|
|
93
|
+
uses: codecov/test-results-action@v1
|
|
94
|
+
with:
|
|
95
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
96
|
+
|
|
97
|
+
- name: Upload coverage report artifact
|
|
98
|
+
uses: actions/upload-artifact@v4
|
|
99
|
+
with:
|
|
100
|
+
name: coverage-report
|
|
101
|
+
path: coverage.xml
|
|
102
|
+
|
|
103
|
+
# -------------------------------
|
|
104
|
+
# Docker Build & Push (DockerHub)
|
|
105
|
+
# -------------------------------
|
|
106
|
+
docker-build-and-push:
|
|
107
|
+
runs-on: ubuntu-latest
|
|
108
|
+
needs: [lint, type-check, tests]
|
|
109
|
+
steps:
|
|
110
|
+
- name: Checkout repository
|
|
111
|
+
uses: actions/checkout@v4
|
|
112
|
+
|
|
113
|
+
- name: Log in to Docker Hub
|
|
114
|
+
uses: docker/login-action@v3
|
|
115
|
+
with:
|
|
116
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
117
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
118
|
+
|
|
119
|
+
- name: Set up Docker Buildx
|
|
120
|
+
uses: docker/setup-buildx-action@v3
|
|
121
|
+
|
|
122
|
+
- name: Build and push Docker image
|
|
123
|
+
uses: docker/build-push-action@v5
|
|
124
|
+
with:
|
|
125
|
+
context: .
|
|
126
|
+
push: true
|
|
127
|
+
tags: |
|
|
128
|
+
makroumi/slowql:latest
|
|
129
|
+
makroumi/slowql:${{ github.ref_name }}
|
|
130
|
+
|
|
131
|
+
# -------------------------------
|
|
132
|
+
# Docker Build & Push (GHCR)
|
|
133
|
+
# -------------------------------
|
|
134
|
+
docker-build-and-push-ghcr:
|
|
135
|
+
runs-on: ubuntu-latest
|
|
136
|
+
needs: [lint, type-check, tests]
|
|
137
|
+
steps:
|
|
138
|
+
- name: Checkout repository
|
|
139
|
+
uses: actions/checkout@v4
|
|
140
|
+
|
|
141
|
+
- name: Log in to GHCR
|
|
142
|
+
uses: docker/login-action@v3
|
|
143
|
+
with:
|
|
144
|
+
registry: ghcr.io
|
|
145
|
+
username: ${{ github.actor }}
|
|
146
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
147
|
+
|
|
148
|
+
- name: Set up Docker Buildx
|
|
149
|
+
uses: docker/setup-buildx-action@v3
|
|
150
|
+
|
|
151
|
+
- name: Build and push GHCR image
|
|
152
|
+
uses: docker/build-push-action@v5
|
|
153
|
+
with:
|
|
154
|
+
context: .
|
|
155
|
+
push: true
|
|
156
|
+
tags: |
|
|
157
|
+
ghcr.io/makroumi/slowql:latest
|
|
158
|
+
ghcr.io/makroumi/slowql:${{ github.ref_name }}
|
|
159
|
+
|
|
160
|
+
# -------------------------------
|
|
161
|
+
# Publish to PyPI
|
|
162
|
+
# -------------------------------
|
|
163
|
+
publish-pypi:
|
|
164
|
+
runs-on: ubuntu-latest
|
|
165
|
+
needs: [lint, type-check, tests]
|
|
166
|
+
permissions:
|
|
167
|
+
id-token: write # Required for OIDC
|
|
168
|
+
contents: read
|
|
169
|
+
steps:
|
|
170
|
+
- name: Checkout
|
|
171
|
+
uses: actions/checkout@v4
|
|
172
|
+
|
|
173
|
+
- name: Set up Python
|
|
174
|
+
uses: actions/setup-python@v5
|
|
175
|
+
with:
|
|
176
|
+
python-version: "3.12"
|
|
177
|
+
|
|
178
|
+
- name: Install build tools
|
|
179
|
+
run: |
|
|
180
|
+
python -m pip install --upgrade pip
|
|
181
|
+
pip install build
|
|
182
|
+
|
|
183
|
+
- name: Build package
|
|
184
|
+
run: python -m build
|
|
185
|
+
|
|
186
|
+
- name: Publish to PyPI
|
|
187
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
188
|
+
with:
|
|
189
|
+
skip-existing: true
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: Dependency Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
dependency-review:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- name: Checkout
|
|
12
|
+
uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Dependency Review
|
|
15
|
+
uses: actions/dependency-review-action@v4
|
|
16
|
+
with:
|
|
17
|
+
fail-on-severity: high
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Deploy Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write # <-- critical: allows github-actions[bot] to push to gh-pages
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
deploy:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 0 # <-- ensures full history for git-revision-date-localized plugin
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.12"
|
|
20
|
+
- run: pip install mkdocs mkdocs-material mkdocstrings[python] mkdocs-git-revision-date-localized-plugin
|
|
21
|
+
- run: mkdocs build --strict
|
|
22
|
+
- name: Deploy to GitHub Pages
|
|
23
|
+
uses: peaceiris/actions-gh-pages@v4
|
|
24
|
+
with:
|
|
25
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
26
|
+
publish_dir: ./site
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: SBOM
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main" ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
sbom:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Generate SBOM
|
|
17
|
+
uses: anchore/sbom-action@v0
|
|
18
|
+
with:
|
|
19
|
+
path: .
|
|
20
|
+
format: spdx-json
|
|
21
|
+
output-file: sbom.spdx.json
|
|
22
|
+
|
|
23
|
+
- name: Upload SBOM artifact
|
|
24
|
+
uses: actions/upload-artifact@v4
|
|
25
|
+
with:
|
|
26
|
+
name: sbom
|
|
27
|
+
path: sbom.spdx.json
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Security Scan
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
security:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: actions/setup-python@v5
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.11"
|
|
16
|
+
- run: pip install -e .
|
|
17
|
+
- uses: snyk/actions/python@main
|
|
18
|
+
env:
|
|
19
|
+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
slowql-0.0.0/.gitignore
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.venv
|
|
2
|
+
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.pyc
|
|
5
|
+
.coverage
|
|
6
|
+
*.egg-info/
|
|
7
|
+
sql_analysis_*.json
|
|
8
|
+
.pytest_cache/
|
|
9
|
+
|
|
10
|
+
# Generated files
|
|
11
|
+
htmlcov/
|
|
12
|
+
dist/
|
|
13
|
+
build/
|
|
14
|
+
*.egg-info/
|
|
15
|
+
.coverage
|
|
16
|
+
.pytest_cache/
|
|
17
|
+
reports/
|
|
18
|
+
*.html
|
|
19
|
+
*.json
|
|
20
|
+
*.csv
|
|
21
|
+
|
|
22
|
+
# Generated
|
|
23
|
+
htmlcov/
|
|
24
|
+
report/
|
|
25
|
+
reports/
|
|
26
|
+
.coverage
|
|
27
|
+
*.egg-info/
|
|
28
|
+
__pycache__/
|
|
29
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented here.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## [1.0.3] - 2025-12-03
|
|
8
|
+
### Added
|
|
9
|
+
- Initial release of SlowQL
|
|
10
|
+
- Critical and High severity detectors
|
|
11
|
+
- CI/CD examples (GitHub, GitLab, Jenkins, Pre-Commit)
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- MkDocs strict build errors
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We pledge to make participation in SlowQL a harassment-free experience for everyone.
|
|
6
|
+
|
|
7
|
+
## Standards
|
|
8
|
+
|
|
9
|
+
**Positive behavior:**
|
|
10
|
+
- Welcoming and inclusive language
|
|
11
|
+
- Respectful of differing viewpoints
|
|
12
|
+
- Gracefully accepting constructive criticism
|
|
13
|
+
|
|
14
|
+
**Unacceptable behavior:**
|
|
15
|
+
- Harassment, trolling, insulting comments
|
|
16
|
+
- Publishing others' private information
|
|
17
|
+
- Unprofessional conduct
|
|
18
|
+
|
|
19
|
+
## Enforcement
|
|
20
|
+
|
|
21
|
+
Report violations to: elmehdi.makroumi@gmail.com
|
|
22
|
+
|
|
23
|
+
Consequences: Warning → Temporary ban → Permanent ban
|
|
24
|
+
|
|
25
|
+
## Attribution
|
|
26
|
+
|
|
27
|
+
Adapted from [Contributor Covenant](https://www.contributor-covenant.org/).
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Contributing to SlowQL
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing!
|
|
4
|
+
|
|
5
|
+
## How to Contribute
|
|
6
|
+
- Fork the repository
|
|
7
|
+
- Create a feature branch (`git checkout -b feat/my-feature`)
|
|
8
|
+
- Write tests for new code
|
|
9
|
+
- Run `make all` to ensure lint, type checks, and tests pass
|
|
10
|
+
- Submit a pull request
|
|
11
|
+
|
|
12
|
+
## Code Style
|
|
13
|
+
- Use `black` for formatting
|
|
14
|
+
- Use `ruff` for linting
|
|
15
|
+
- Type hints required (`mypy`)
|
|
16
|
+
|
|
17
|
+
## Commit Messages
|
|
18
|
+
Follow [Conventional Commits](https://www.conventionalcommits.org/):
|
|
19
|
+
- `feat:` new feature
|
|
20
|
+
- `fix:` bug fix
|
|
21
|
+
- `docs:` documentation
|
|
22
|
+
- `chore:` maintenance
|
|
23
|
+
|
|
24
|
+
## Pull Requests
|
|
25
|
+
- Include a clear description
|
|
26
|
+
- Reference related issues
|
|
27
|
+
- Ensure CI passes before requesting review
|
slowql-0.0.0/Dockerfile
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1.5
|
|
2
|
+
####################################
|
|
3
|
+
# Builder: create wheel from source
|
|
4
|
+
####################################
|
|
5
|
+
FROM python:3.12-slim AS builder
|
|
6
|
+
|
|
7
|
+
ENV PYTHONUNBUFFERED=1 \
|
|
8
|
+
PIP_NO_CACHE_DIR=1 \
|
|
9
|
+
LC_ALL=C.UTF-8 \
|
|
10
|
+
LANG=C.UTF-8
|
|
11
|
+
|
|
12
|
+
WORKDIR /src
|
|
13
|
+
|
|
14
|
+
# Install build-time system deps. Keep small and explicit.
|
|
15
|
+
RUN apt-get update \
|
|
16
|
+
&& apt-get install -y --no-install-recommends \
|
|
17
|
+
build-essential \
|
|
18
|
+
ca-certificates \
|
|
19
|
+
curl \
|
|
20
|
+
git \
|
|
21
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
22
|
+
|
|
23
|
+
# Install pip tooling used to build wheel
|
|
24
|
+
RUN python -m pip install --upgrade pip build setuptools wheel
|
|
25
|
+
|
|
26
|
+
# Copy project metadata and source code
|
|
27
|
+
# Include README.md and LICENSE so setuptools can find them
|
|
28
|
+
COPY pyproject.toml README.md LICENSE /src/
|
|
29
|
+
COPY src/ /src/src/
|
|
30
|
+
|
|
31
|
+
# Build wheel into /out
|
|
32
|
+
RUN python -m build --wheel --outdir /out
|
|
33
|
+
|
|
34
|
+
####################################
|
|
35
|
+
# Runtime image: minimal, only runtime deps
|
|
36
|
+
####################################
|
|
37
|
+
FROM python:3.12-slim AS runtime
|
|
38
|
+
|
|
39
|
+
ENV PYTHONUNBUFFERED=1 \
|
|
40
|
+
PIP_NO_CACHE_DIR=1 \
|
|
41
|
+
LC_ALL=C.UTF-8 \
|
|
42
|
+
LANG=C.UTF-8
|
|
43
|
+
|
|
44
|
+
WORKDIR /app
|
|
45
|
+
|
|
46
|
+
# Runtime system deps (keep ca-certificates for HTTPS)
|
|
47
|
+
RUN apt-get update \
|
|
48
|
+
&& apt-get install -y --no-install-recommends \
|
|
49
|
+
ca-certificates \
|
|
50
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
51
|
+
|
|
52
|
+
# Copy built wheel from builder stage and install it
|
|
53
|
+
COPY --from=builder /out /out
|
|
54
|
+
RUN python -m pip install --upgrade pip setuptools wheel \
|
|
55
|
+
&& python -m pip install /out/slowql-*.whl \
|
|
56
|
+
&& rm -rf /root/.cache/pip /out
|
|
57
|
+
|
|
58
|
+
# Use a non-root user for better security
|
|
59
|
+
RUN groupadd --gid 1000 slowql && useradd --uid 1000 --gid slowql --create-home slowql
|
|
60
|
+
USER slowql
|
|
61
|
+
WORKDIR /home/slowql
|
|
62
|
+
|
|
63
|
+
# Default CLI entrypoint
|
|
64
|
+
ENTRYPOINT ["slowql"]
|
|
65
|
+
CMD ["--help"]
|
slowql-0.0.0/LICENSE
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# License
|
|
2
|
+
|
|
3
|
+
SlowQL is released under the Apache License, Version 2.0.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Apache License
|
|
8
|
+
Version 2.0, January 2004
|
|
9
|
+
http://www.apache.org/licenses/
|
|
10
|
+
|
|
11
|
+
### TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
12
|
+
|
|
13
|
+
**1. Definitions.**
|
|
14
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
15
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner.
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity.
|
|
17
|
+
"Source" form shall mean the preferred form for making modifications.
|
|
18
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form.
|
|
19
|
+
|
|
20
|
+
**2. Grant of Copyright License.**
|
|
21
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants You a perpetual, worldwide, non‑exclusive, no‑charge, royalty‑free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute the Work and Derivative Works in Source or Object form.
|
|
22
|
+
|
|
23
|
+
**3. Grant of Patent License.**
|
|
24
|
+
Each Contributor grants You a perpetual, worldwide, non‑exclusive, no‑charge, royalty‑free, irrevocable patent license to make, use, sell, offer to sell, import, and otherwise transfer the Work.
|
|
25
|
+
|
|
26
|
+
**4. Redistribution.**
|
|
27
|
+
You may reproduce and distribute copies of the Work or Derivative Works in any medium, with or without modifications, provided that You meet the following conditions:
|
|
28
|
+
- Include a copy of this License in each copy.
|
|
29
|
+
- Provide prominent notices stating that You have changed the files if modifications were made.
|
|
30
|
+
- Retain all copyright, patent, trademark, and attribution notices.
|
|
31
|
+
- Include a NOTICE file with attribution if applicable.
|
|
32
|
+
|
|
33
|
+
**5. Disclaimer of Warranty.**
|
|
34
|
+
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
|
|
35
|
+
|
|
36
|
+
**6. Limitation of Liability.**
|
|
37
|
+
In no event shall the Licensor or Contributors be liable for damages arising in any way out of the use of the Work.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## NOTICE
|
|
42
|
+
|
|
43
|
+
Copyright © 2025 El Mehdi Makroumi
|
|
44
|
+
|
|
45
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
46
|
+
you may not use this file except in compliance with the License.
|
|
47
|
+
You may obtain a copy of the License at:
|
|
48
|
+
|
|
49
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
50
|
+
|
|
51
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
|
|
52
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
53
|
+
See the License for the specific language governing permissions and limitations under the License.
|
slowql-0.0.0/MANIFEST.in
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
|
|
4
|
+
# create or ensure entries exist
|
|
5
|
+
if [ -f MANIFEST.in ]; then
|
|
6
|
+
grep -q "^include LICENSE$" MANIFEST.in || echo "include LICENSE" >> MANIFEST.in
|
|
7
|
+
grep -q "^include NOTICE$" MANIFEST.in || echo "include NOTICE" >> MANIFEST.in
|
|
8
|
+
git add MANIFEST.in && git commit -m "Ensure LICENSE and NOTICE are included in source distribution" || true
|
|
9
|
+
else
|
|
10
|
+
printf "include LICENSE\ninclude NOTICE\n" > MANIFEST.in
|
|
11
|
+
git add MANIFEST.in && git commit -m "Add MANIFEST.in to include LICENSE and NOTICE"
|
|
12
|
+
fi
|