Skip to content

Commit d4d5353

Browse files
Vijay IyengarVijay Iyengar
authored andcommitted
feat: Add comprehensive developer tools integration
- Add Codecov configuration for code coverage reporting - Set up Snyk and other security scanning workflows (pip-audit, safety) - Configure comprehensive pre-commit hooks with multiple linters and formatters - Set up Read the Docs configuration with Sphinx documentation - Add documentation dependencies and initial docs structure - Update badges in README for documentation status These integrations provide: - Automated code quality checks - Security vulnerability scanning - Documentation hosting - Code coverage tracking
1 parent 6ae7530 commit d4d5353

File tree

11 files changed

+461
-13
lines changed

11 files changed

+461
-13
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Security Scan
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
schedule:
9+
- cron: '0 0 * * 1' # Weekly on Monday
10+
11+
jobs:
12+
snyk:
13+
name: Snyk Security Scan
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.10'
22+
23+
- name: Run Snyk to check for vulnerabilities
24+
uses: snyk/actions/python@master
25+
env:
26+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
27+
with:
28+
args: --severity-threshold=high --file=pyproject.toml
29+
continue-on-error: true # Don't fail the build on vulnerabilities initially
30+
31+
- name: Upload Snyk results to GitHub Code Scanning
32+
uses: github/codeql-action/upload-sarif@v3
33+
if: always()
34+
with:
35+
sarif_file: snyk.sarif
36+
continue-on-error: true
37+
38+
pip-audit:
39+
name: Pip Audit
40+
runs-on: ubuntu-latest
41+
env:
42+
UV_SYSTEM_PYTHON: 1
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Install uv
47+
uses: astral-sh/setup-uv@v6
48+
with:
49+
enable-cache: true
50+
51+
- name: Set up Python
52+
uses: actions/setup-python@v5
53+
with:
54+
python-version: '3.10'
55+
56+
- name: Install dependencies
57+
run: |
58+
uv pip install -e .
59+
uv pip install pip-audit
60+
61+
- name: Run pip-audit
62+
run: |
63+
pip-audit --desc --fix --dry-run
64+
continue-on-error: true
65+
66+
safety:
67+
name: Safety Check
68+
runs-on: ubuntu-latest
69+
env:
70+
UV_SYSTEM_PYTHON: 1
71+
steps:
72+
- uses: actions/checkout@v4
73+
74+
- name: Install uv
75+
uses: astral-sh/setup-uv@v6
76+
with:
77+
enable-cache: true
78+
79+
- name: Set up Python
80+
uses: actions/setup-python@v5
81+
with:
82+
python-version: '3.10'
83+
84+
- name: Install dependencies
85+
run: |
86+
uv pip install -e .
87+
uv pip install safety
88+
89+
- name: Run Safety check
90+
run: |
91+
safety check --json --output safety-report.json
92+
continue-on-error: true
93+
94+
- name: Upload Safety report
95+
uses: actions/upload-artifact@v4
96+
if: always()
97+
with:
98+
name: safety-report
99+
path: safety-report.json

.pre-commit-config.yaml

Lines changed: 78 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,119 @@
1+
# Pre-commit hooks for code quality
2+
# See https://pre-commit.com for more information
3+
4+
default_language_version:
5+
python: python3.10
6+
17
repos:
8+
# General file checks
29
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
10+
rev: v4.6.0
411
hooks:
512
- id: trailing-whitespace
613
- id: end-of-file-fixer
714
- id: check-yaml
15+
args: ['--allow-multiple-documents']
816
- id: check-added-large-files
17+
args: ['--maxkb=1000']
18+
- id: check-case-conflict
19+
- id: check-merge-conflict
920
- id: check-json
1021
- id: check-toml
11-
- id: check-merge-conflict
22+
- id: check-xml
1223
- id: debug-statements
24+
- id: detect-private-key
1325
- id: mixed-line-ending
1426
args: ['--fix=lf']
27+
- id: name-tests-test
28+
args: ['--pytest-test-first']
1529

30+
# Python code formatting with Ruff
1631
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.1.9
32+
rev: v0.8.6
1833
hooks:
34+
# Run the linter
1935
- id: ruff
2036
args: [--fix]
37+
# Run the formatter
2138
- id: ruff-format
2239

40+
# Additional Python formatting with Black
2341
- repo: https://github.com/psf/black
24-
rev: 23.12.1
42+
rev: 24.11.0
2543
hooks:
2644
- id: black
2745
language_version: python3.10
2846

29-
- repo: https://github.com/pycqa/isort
47+
# Import sorting with isort
48+
- repo: https://github.com/PyCQA/isort
3049
rev: 5.13.2
3150
hooks:
3251
- id: isort
3352
args: ["--profile", "black"]
3453

54+
# Type checking with mypy
3555
- repo: https://github.com/pre-commit/mirrors-mypy
36-
rev: v1.8.0
56+
rev: v1.14.1
3757
hooks:
3858
- id: mypy
39-
additional_dependencies: [types-all]
40-
args: [--ignore-missing-imports]
59+
args: [--ignore-missing-imports, --no-strict-optional]
60+
additional_dependencies: [types-requests, types-PyYAML]
61+
files: ^src/
4162

42-
- repo: https://github.com/pycqa/bandit
43-
rev: 1.7.6
63+
# Security checks with bandit
64+
- repo: https://github.com/PyCQA/bandit
65+
rev: 1.8.0
4466
hooks:
4567
- id: bandit
4668
args: ['-r', 'src/', '-ll']
47-
files: .py$
69+
files: ^src/
70+
71+
# Markdown formatting
72+
- repo: https://github.com/igorshubovych/markdownlint-cli
73+
rev: v0.43.0
74+
hooks:
75+
- id: markdownlint
76+
args: ['--fix', '--disable', 'MD013', 'MD033']
77+
78+
# YAML formatting
79+
- repo: https://github.com/adrienverge/yamllint
80+
rev: v1.35.1
81+
hooks:
82+
- id: yamllint
83+
args: [-d, "{extends: default, rules: {line-length: {max: 120}, truthy: disable}}"]
4884

85+
# Check for secrets
86+
- repo: https://github.com/Yelp/detect-secrets
87+
rev: v1.5.0
88+
hooks:
89+
- id: detect-secrets
90+
args: ['--baseline', '.secrets.baseline']
91+
exclude: .*\.lock$|package-lock\.json$
92+
93+
# Python docstring coverage
94+
- repo: https://github.com/econchick/interrogate
95+
rev: 1.7.0
96+
hooks:
97+
- id: interrogate
98+
args: [--verbose, --fail-under=50, src/]
99+
pass_filenames: false
100+
101+
# Python dependency checks
49102
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
50103
rev: v1.3.3
51104
hooks:
52105
- id: python-safety-dependencies-check
53-
files: pyproject.toml
106+
files: pyproject.toml
107+
108+
# Commit message linting
109+
- repo: https://github.com/commitizen-tools/commitizen
110+
rev: v4.1.0
111+
hooks:
112+
- id: commitizen
113+
stages: [commit-msg]
114+
115+
# CI-specific settings
116+
ci:
117+
autofix_prs: true
118+
autoupdate_schedule: weekly
119+
autoupdate_commit_msg: 'chore: auto-update pre-commit hooks'

.readthedocs.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.10"
12+
13+
# You can also specify other tool versions:
14+
# nodejs: "20"
15+
# rust: "1.70"
16+
# golang: "1.20"
17+
18+
# Build documentation in the "docs/" directory with Sphinx
19+
sphinx:
20+
configuration: docs/conf.py
21+
builder: html
22+
fail_on_warning: false
23+
24+
# Optionally build your docs in additional formats such as PDF and ePub
25+
formats:
26+
- pdf
27+
- epub
28+
- htmlzip
29+
30+
# Optional but recommended, declare the Python requirements required
31+
# to build your documentation
32+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
33+
python:
34+
install:
35+
- method: pip
36+
path: .
37+
extra_requirements:
38+
- docs
39+
- requirements: docs/requirements.txt

.secrets.baseline

Whitespace-only changes.

.snyk

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Snyk (https://snyk.io) policy file
2+
version: v1.25.0
3+
4+
# Ignore specific vulnerabilities
5+
ignore: {}
6+
7+
# Patches to apply
8+
patch: {}
9+
10+
# Language settings
11+
language-settings:
12+
python: '3.10'

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![CI](https://github.com/Vijay-Duke/mcp-gitlab/actions/workflows/ci.yml/badge.svg)](https://github.com/Vijay-Duke/mcp-gitlab/actions/workflows/ci.yml)
44
[![codecov](https://codecov.io/gh/Vijay-Duke/mcp-gitlab/branch/main/graph/badge.svg)](https://codecov.io/gh/Vijay-Duke/mcp-gitlab)
5+
[![Documentation Status](https://readthedocs.org/projects/mcp-gitlab/badge/?version=latest)](https://mcp-gitlab.readthedocs.io/en/latest/?badge=latest)
56
[![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/downloads/)
67
[![License](https://img.shields.io/badge/license-Apache%202.0-green)](https://opensource.org/licenses/Apache-2.0)
78
[![MCP](https://img.shields.io/badge/MCP-Compatible-purple)](https://github.com/anthropics/mcp)

codecov.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Codecov configuration for mcp-gitlab
2+
# https://docs.codecov.io/docs/codecov-yaml
3+
4+
codecov:
5+
require_ci_to_pass: true
6+
notify:
7+
wait_for_ci: true
8+
9+
coverage:
10+
precision: 2
11+
round: down
12+
range: "70...100"
13+
14+
status:
15+
project:
16+
default:
17+
target: 80%
18+
threshold: 1%
19+
paths:
20+
- "src/"
21+
if_not_found: success
22+
informational: false
23+
only_pulls: false
24+
25+
patch:
26+
default:
27+
target: 80%
28+
threshold: 1%
29+
base: auto
30+
if_not_found: success
31+
informational: false
32+
only_pulls: false
33+
34+
parsers:
35+
gcov:
36+
branch_detection:
37+
conditional: true
38+
loop: true
39+
method: false
40+
macro: false
41+
42+
comment:
43+
layout: "reach,diff,flags,files,footer"
44+
behavior: default
45+
require_changes: false
46+
require_base: false
47+
require_head: true
48+
hide_project_coverage: false
49+
50+
ignore:
51+
- "tests/**/*"
52+
- "**/__pycache__/**/*"
53+
- "setup.py"
54+
- "**/test_*.py"
55+
- "**/*_test.py"
56+
- "docs/**/*"
57+
- "examples/**/*"
58+
- ".github/**/*"
59+
60+
flags:
61+
unittests:
62+
paths:
63+
- src/
64+
carryforward: false
65+
target: 80%

0 commit comments

Comments
 (0)