-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Implement Complete Automated Code Quality Enforcement System #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
3a6d321
fix(security): prevent information exposure through exception
d-ulker 2702b33
feat: Add minimal code quality infrastructure
d-ulker f6d3eb9
feat: Add comprehensive monster PR prevention system
d-ulker 4048a0b
feat: Adjust PR size limits for ML/AI project flexibility
d-ulker a66762a
fix: Correct indentation in PR scope checker script
d-ulker 6594ad6
fix: revert fastapi-to-flask migration, keep only code quality tooling
d-ulker 5c0342d
feat: Implement Complete Automated Code Quality Enforcement System
deepsource-autofix[bot] dbede7b
fix console script entry points
d-ulker bbe861a
Merge branch 'feat/dl-minimal-code-quality' of github.com:uelkerd/SAMβ¦
d-ulker 1c4153f
fix: update setup.cfg and pr scope checker for ranges
d-ulker 943567c
fix: add explicit permissions to pr-scope-check workflow
d-ulker c0d6f87
perf: add ruff linter alongside flake8 for better performance and covβ¦
d-ulker cedb9bb
fix: secure subprocess call and remove unused import
d-ulker b134ce9
fix: add missing __init__.py for training module
d-ulker dfe7029
fix: correct console script entry points for src layout package
d-ulker 0351335
refactor: replace FastAPI dependencies with Flask in pyproject.toml
d-ulker 44203b6
Revert "refactor: replace FastAPI dependencies with Flask in pyprojecβ¦
d-ulker 1168e53
docs: update PR description to reflect actual code quality and securiβ¦
d-ulker 6a01c88
feat: Implement Complete Automated Code Quality Enforcement System
deepsource-autofix[bot] 4ce874b
fix: resolve ReDoS vulnerability in branch name regex validation
d-ulker 32be992
fix: address Copilot code review comments
d-ulker 6c44ff2
fix: address code review comments - code quality only
d-ulker 01577c4
fix: address critical packaging and tooling configuration issues
d-ulker ca5e190
fix: replace Path.is_relative_to with Python 3.8 compatible helper
d-ulker 86d98d5
fix: restore critical tool configs in pyproject.toml
d-ulker a627a96
fix: remove sys.path manipulation anti-pattern from cli.py
d-ulker 73767b4
fix: clarify bandit test skipping in Makefile
d-ulker 3ba09ee
fix: eliminate unreachable code in run_command function
d-ulker 1ff282a
fix: remove redundant setup.cfg for single source of truth
d-ulker 473e911
fix: enable duplicate code detection in pylint config
d-ulker 3fd5519
Fix mypy syntax errors and package structure
d-ulker a1c1c84
feat: Comprehensive mypy error resolution - Phase 2
d-ulker 776890c
feat: Surgical mypy architecture recovery - Phase 3
d-ulker 8c0ca3a
fix: Strategic pre-commit configuration for focused mypy checks
d-ulker 27f9016
fix: Critical mypy error resolution in core business logic
d-ulker 0785361
refactor: Automated linter improvements in core business logic
d-ulker 3da7933
refactor: Automated formatting improvements in deployment infrastructure
d-ulker cd135c0
docs: Automated formatting improvements across documentation
d-ulker c3dc29b
config: Automated formatting improvements in configuration files
d-ulker 9a33ff8
ci: Automated formatting improvements in CI and validation scripts
d-ulker caf4cac
test: Automated formatting improvements in test suites
d-ulker a92d459
notebooks: Automated formatting improvements in Jupyter notebooks
d-ulker 3425873
deploy: Automated formatting improvements in deployment scripts
d-ulker ae43182
train: Automated formatting improvements in training scripts
d-ulker 984d91f
test: Automated formatting improvements in testing scripts
d-ulker 30ce9b2
refactor: Automated formatting improvements in legacy and maintenanceβ¦
d-ulker efd3fef
assets: Automated formatting improvements in artifacts and website
d-ulker 6cf18ec
feat: Comprehensive Code Quality System Enhancement
d-ulker ac80328
feat: Mass Code Quality Auto-fixes and Pre-commit Validation
d-ulker ce667db
refactor: Remove 62 obsolete Jupyter notebook-style training files
d-ulker fe2ffa1
fix: Improve critical exception handler patterns in unified API
d-ulker 3e8d655
style: Add @staticmethod decorators to test methods not using self
d-ulker 56b3bac
fix: comprehensive code quality improvements and import fixes
d-ulker c3946ed
feat: Remove all training code - moved to separate repository
d-ulker 6837ab1
docs: Add comprehensive module docstrings to data layer
d-ulker 4427318
feat: Implement Complete Automated Code Quality Enforcement System
deepsource-autofix[bot] 18863b6
fix: resolve all 18 information exposure through exception vulnerabilβ¦
d-ulker bd7be4c
Merge branch 'feat/dl-minimal-code-quality' of github.com:uelkerd/SAMβ¦
d-ulker 509d1bf
fix: resolve final information exposure vulnerability in audio validaβ¦
d-ulker 26f8107
fix: resolve CodeQL URL substring sanitization vulnerabilities
d-ulker 2cd43f7
feat: Refactor unified_ai_api.py to eliminate import-time dependencies
d-ulker b0a3a66
Fix security: replace substring check with exact match for service vaβ¦
d-ulker 650f12a
Fix import-time side effects: move env vars to main block with setdefβ¦
d-ulker f57ba64
Fix multiple security and reliability issues across deployment files
d-ulker e83a690
Fix fp16 configuration to prevent CPU dtype errors
d-ulker cd05a55
Complete security and compatibility fixes
d-ulker aaefbc2
Fix code review issues: health check safety, metrics format, batch keβ¦
d-ulker 25c32ac
fix: console script import and development status
d-ulker e814ef0
Fix undefined name errors (PYL-E0602) across codebase
d-ulker 35f7ff6
Fix line length issues (FLK-E501) in API files
d-ulker 43b367d
fix: prevent clear-text logging of sensitive information
d-ulker d315029
Fix remaining line length violations
d-ulker a9db811
Fix additional line length violations in testing scripts
d-ulker 371595e
Fix more line length violations in maintenance and testing scripts
d-ulker ef60116
Fix line length violations in legacy scripts
d-ulker 020e08e
Fix final line length violations in core files
d-ulker c2ed567
Fix final long line in mega_comprehensive_model_test.py
d-ulker a736dc0
Fix remaining long lines in confidence statistics
d-ulker cc19d14
Fix final stress test results line length violation
d-ulker 9405e64
enhance: add comprehensive sensitive data protection to logging
d-ulker 7f63b59
fix: completely isolate sensitive data from logging path
d-ulker 377e8de
remove: delete obsolete security deployment fix scripts
d-ulker 678897d
feat: optimize code quality configuration for consistency and performβ¦
d-ulker 2c1e88f
Resolve merge conflict in deployment/secure_api_server.py
d-ulker c597eec
fix: apply automatic linting fixes to secure_api_server.py
d-ulker eadb4f2
Test bad code to verify pre-commit hooks
d-ulker 254fc24
clean: remove test file after verifying quality enforcement works
d-ulker 0e2b140
docs: update PR description for minimal code quality enforcement
d-ulker 1a759e5
fix: complete CI blocker resolution
d-ulker 8118b20
docs: update PR description to acknowledge monster PR scope creep
d-ulker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,4 +12,4 @@ LICENSE | |
| dist | ||
| build | ||
| artifacts | ||
| notebooks | ||
| notebooks | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,4 +9,3 @@ updates: | |
| directory: "/" # Location of package manifests | ||
| schedule: | ||
| interval: "weekly" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| name: PR Scope Check | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| jobs: | ||
| scope-check: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 # Get full history for proper diff | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.8' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
|
|
||
| - name: Run PR Scope Check | ||
| run: | | ||
| python scripts/check_pr_scope.py --strict | ||
| continue-on-error: false | ||
|
|
||
| - name: Check branch naming (secure) | ||
| env: | ||
| BRANCH_NAME: ${{ github.head_ref }} | ||
| run: | | ||
| # Validate branch name using environment variable (safer than direct interpolation) | ||
| if [[ ! "$BRANCH_NAME" =~ ^(feat|fix|chore|refactor|docs|test)/[a-z]+(-[a-z]+)*$ ]]; then | ||
| echo "β Branch name must follow pattern: type/short-description" | ||
| echo " Current: $BRANCH_NAME" | ||
| echo " Examples: feat/add-user-auth, fix/validate-input, chore/update-deps" | ||
| exit 1 | ||
| fi | ||
| echo "β Branch name follows convention: $BRANCH_NAME" | ||
|
|
||
| - name: Check PR size limits (secure) | ||
| env: | ||
| BASE_BRANCH: ${{ github.base_ref }} | ||
| HEAD_REF: ${{ github.head_ref }} | ||
| run: | | ||
| # Validate input parameters | ||
| if [[ -z "$BASE_BRANCH" || -z "$HEAD_REF" ]]; then | ||
| echo "β Missing required branch information" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Ensure base branch exists in origin | ||
| if ! git show-ref --verify --quiet "refs/remotes/origin/$BASE_BRANCH"; then | ||
| echo "β Base branch origin/$BASE_BRANCH not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Count files changed using safe git commands | ||
| FILES_CHANGED=$(git diff --name-only "origin/$BASE_BRANCH" | wc -l) | ||
| echo "Files changed: $FILES_CHANGED" | ||
|
|
||
| # Count lines changed using shortstat (more reliable) | ||
| SHORTSTAT=$(git diff --shortstat "origin/$BASE_BRANCH") | ||
| LINES_CHANGED=0 | ||
|
|
||
| if [[ -n "$SHORTSTAT" ]]; then | ||
| # Extract insertions and deletions from shortstat | ||
| INSERTIONS=$(echo "$SHORTSTAT" | grep -o '[0-9]\+ insertion' | head -1 | grep -o '[0-9]\+' || echo "0") | ||
| DELETIONS=$(echo "$SHORTSTAT" | grep -o '[0-9]\+ deletion' | head -1 | grep -o '[0-9]\+' || echo "0") | ||
| LINES_CHANGED=$((INSERTIONS + DELETIONS)) | ||
| fi | ||
|
|
||
| echo "Lines changed: $LINES_CHANGED" | ||
|
|
||
| # Check limits with proper error handling | ||
| if [[ "$FILES_CHANGED" -gt 50 ]]; then | ||
| echo "β Too many files changed: $FILES_CHANGED (max 50)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ "$LINES_CHANGED" -gt 1500 ]]; then | ||
| echo "β Too many lines changed: $LINES_CHANGED (max 1500)" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "β PR size within limits: $FILES_CHANGED files, $LINES_CHANGED lines" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -384,5 +384,4 @@ coverage.xml | |
| # Large generated reports | ||
| bandit-report.json | ||
| ci_pipeline.log | ||
|
|
||
|
|
||
| notebooks/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # SAMO-DL Commit Message Template | ||
| # | ||
| # Format: <type>(<scope>): <subject> | ||
| # | ||
| # Types: | ||
| # feat: A new feature | ||
| # fix: A bug fix | ||
| # chore: Changes to the build process or auxiliary tools/libraries | ||
| # refactor: A code change that neither fixes a bug nor adds a feature | ||
| # docs: Documentation only changes | ||
| # test: Adding missing tests or correcting existing tests | ||
| # | ||
| # Rules: | ||
| # - ONE purpose per commit (no "and", "also", "plus") | ||
| # - Subject line < 50 characters | ||
| # - Use imperative mood ("Add" not "Added") | ||
| # - No period at end of subject line | ||
| # | ||
| # Examples: | ||
| # feat: add user authentication system | ||
| # fix: resolve memory leak in model loading | ||
| # chore: update dependency versions | ||
| # refactor: simplify rate limiter logic | ||
| # docs: update API documentation | ||
| # test: add unit tests for validation functions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4995,4 +4995,4 @@ | |
| "bandit-report.json": [], | ||
| "ci_pipeline.log": [] | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.