Skip to content

fix(ci): fix flake8 errors blocking Code Quality check (MVA-3524) - #9584

Closed
mrveiss wants to merge 9 commits into
mainfrom
mva-3524-ci-fix
Closed

mrveiss wants to merge 9 commits into
mainfrom
mva-3524-ci-fix

Conversation

@mrveiss

@mrveiss mrveiss commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes all flake8 errors that are causing the Code Quality CI check to fail since the Dependabot uv bump PR #9512 was merged into main.

Root cause: The Code Quality check runs python3 -m flake8 --config=.flake8 against autobot-backend/, autobot-slm-backend/, and autobot_shared/. Multiple pre-existing flake8 violations were being caught.

Changes (20 files)

  • a2a/capability_verifier.py — removed dead duplicate code block (F821: undefined status_code, _json, body)
  • secure_command_executor.py — removed 131-line duplicate of _check_argument_aware_risk and _check_dangerous_env_var_prefix (F811/F821)
  • rbac_middleware.py — added missing Optional, Union to imports; added Permission import from models; added _get_redis helper; added _fallback_cache alias; added _emit_permission_denied_audit stub; fixed user_id scope in _clear_all_redis_keys
  • marketplace_sources.py — added import socket (F821)
  • Unused imports removed: BatchJobsHealthResponse, VisionHealthResponse, Optional (2 files), Transcript (4 files), Pt, pytest, os (18 test occurrences)
  • Line-too-long fixes: secret.py, agent_secrets_integration.py, external_importer.py
  • F-string without placeholder: gmail_service.py
  • Unused variable exc: transcriber/routes/ai.py

Test plan

  • Flake8 passes: python3 -m flake8 --config=.flake8 autobot-backend/ autobot-slm-backend/ autobot_shared/ → exit 0 (verified locally)
  • Code Quality CI check passes on this PR

Closes MVA-3524

🤖 Generated with Claude Code

Remove dead duplicate code blocks, unused imports, add missing imports/helpers.
Key fixes: duplicate functions in secure_command_executor.py, undefined names
in rbac_middleware.py, unused Transcript/Optional/os imports across 20 files.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@github-actions

github-actions Bot commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

AutoBot Phase Validation Results

System Maturity: 96.5%

Phase Status:

PASS Phase 1: Core Infrastructure: 100.0%
PASS Phase 2: Knowledge Base and Memory: 100.0%
IN PROGRESS Phase 3: LLM Integration: 66.7%
PASS Phase 4: Security and Authentication: 100.0%
PASS Phase 5: Agent Orchestration: 100.0%
PASS Phase 6: Enhanced UI/UX: 100.0%
PASS Phase 7: Testing and Validation: 100.0%
PASS Phase 8: Advanced Features: 100.0%
PASS Phase 9: Multi-Modal AI: 100.0%
PASS Phase 10: Production Readiness: 100.0%

Recommendations:

  • 🟡 MEDIUM: Phase 3: LLM Integration requires attention (66.7% complete): Review and implement
  • ✅ System is production-ready - consider advanced features and scaling: Review and implement

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

AutoBot Phase Validation Results

System Maturity: 96.5%

Phase Status:

PASS Phase 1: Core Infrastructure: 100.0%
PASS Phase 2: Knowledge Base and Memory: 100.0%
IN PROGRESS Phase 3: LLM Integration: 66.7%
PASS Phase 4: Security and Authentication: 100.0%
PASS Phase 5: Agent Orchestration: 100.0%
PASS Phase 6: Enhanced UI/UX: 100.0%
PASS Phase 7: Testing and Validation: 100.0%
PASS Phase 8: Advanced Features: 100.0%
PASS Phase 9: Multi-Modal AI: 100.0%
PASS Phase 10: Production Readiness: 100.0%

Recommendations:

  • 🟡 MEDIUM: Phase 3: LLM Integration requires attention (66.7% complete): Review and implement
  • ✅ System is production-ready - consider advanced features and scaling: Review and implement

mrveiss and others added 3 commits June 5, 2026 04:18
…ract methods (MVA-3524)

- Remove unused pytest import from test_base_exporter.py
- Remove unused asyncio import from test_code_sync_topology.py
- Remove unused os import from monitoring_and_alerts_test.py
- Replace 'pass' with '...' in abstract methods (modern Python convention)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
…2186)

The import was added in core_routers.py but the actual module file was never
created, causing ModuleNotFoundError in startup-import-smoke CI check.

This aggregator module includes all transcriber sub-routers.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

AutoBot Phase Validation Results

System Maturity: 96.5%

Phase Status:

PASS Phase 1: Core Infrastructure: 100.0%
PASS Phase 2: Knowledge Base and Memory: 100.0%
IN PROGRESS Phase 3: LLM Integration: 66.7%
PASS Phase 4: Security and Authentication: 100.0%
PASS Phase 5: Agent Orchestration: 100.0%
PASS Phase 6: Enhanced UI/UX: 100.0%
PASS Phase 7: Testing and Validation: 100.0%
PASS Phase 8: Advanced Features: 100.0%
PASS Phase 9: Multi-Modal AI: 100.0%
PASS Phase 10: Production Readiness: 100.0%

Recommendations:

  • 🟡 MEDIUM: Phase 3: LLM Integration requires attention (66.7% complete): Review and implement
  • ✅ System is production-ready - consider advanced features and scaling: Review and implement

Comment thread autobot-backend/models/secret.py Dismissed
"password" # nosec B105 - secret type enum, not actual password
)
TOKEN = "token" # nosec B105 - secret type enum, not actual token # nosemgrep: autobot-hardcoded-secret-key # nosemgrep
TOKEN = "token" # nosec B105 # nosemgrep: autobot-hardcoded-secret-key
Removed duplicate skill_name, skill_action, skill_resolution_method, and
pending_skill_id field definitions causing mypy no-redef errors.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

AutoBot Phase Validation Results

System Maturity: 96.5%

Phase Status:

PASS Phase 1: Core Infrastructure: 100.0%
PASS Phase 2: Knowledge Base and Memory: 100.0%
IN PROGRESS Phase 3: LLM Integration: 66.7%
PASS Phase 4: Security and Authentication: 100.0%
PASS Phase 5: Agent Orchestration: 100.0%
PASS Phase 6: Enhanced UI/UX: 100.0%
PASS Phase 7: Testing and Validation: 100.0%
PASS Phase 8: Advanced Features: 100.0%
PASS Phase 9: Multi-Modal AI: 100.0%
PASS Phase 10: Production Readiness: 100.0%

Recommendations:

  • 🟡 MEDIUM: Phase 3: LLM Integration requires attention (66.7% complete): Review and implement
  • ✅ System is production-ready - consider advanced features and scaling: Review and implement

… import

- Add transcriber/ai/__init__.py, context.py, prompts.py — files from
  commit 4ae3cbd were absent from the mva-3524 branch, causing
  ModuleNotFoundError: No module named 'transcriber.ai' in startup-
  import-smoke CI
- Remove unused Optional from autobot_shared/workflow/types.py (flake8 F401)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mrveiss

mrveiss commented Jun 5, 2026

Copy link
Copy Markdown
Owner Author

Round 7 fixes — commit e383db7

startup-import-smoke: ModuleNotFoundError: No module named 'transcriber.ai'

  • Added missing transcriber/ai/__init__.py, context.py, prompts.py — these files existed in commit 4ae3cbd72 on Dev_new_gui but were absent from the mva-3524 branch

code-quality flake8 F401:

  • Removed unused Optional from autobot_shared/workflow/types.py:38 (left over after duplicate field removal in round 6)

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

AutoBot Phase Validation Results

System Maturity: 96.5%

Phase Status:

PASS Phase 1: Core Infrastructure: 100.0%
PASS Phase 2: Knowledge Base and Memory: 100.0%
IN PROGRESS Phase 3: LLM Integration: 66.7%
PASS Phase 4: Security and Authentication: 100.0%
PASS Phase 5: Agent Orchestration: 100.0%
PASS Phase 6: Enhanced UI/UX: 100.0%
PASS Phase 7: Testing and Validation: 100.0%
PASS Phase 8: Advanced Features: 100.0%
PASS Phase 9: Multi-Modal AI: 100.0%
PASS Phase 10: Production Readiness: 100.0%

Recommendations:

  • 🟡 MEDIUM: Phase 3: LLM Integration requires attention (66.7% complete): Review and implement
  • ✅ System is production-ready - consider advanced features and scaling: Review and implement

…e import

- Add types.UnionType handling to gen_frontend_types.py — Python 3.10+
  `str | None` syntax creates types.UnionType instead of typing.Union
- Keep Optional import with noqa F401 — needed by type generator's
  get_type_hints() even though not used directly in code
- Add Database = TranscriberDatabase alias in transcriber/database.py
  for backward compatibility with routes/ai.py import
- Regenerated workflow.ts with correct `string | null` types instead
  of `unknown`

Fixes check-drift and startup-import-smoke CI failures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mrveiss

mrveiss commented Jun 5, 2026

Copy link
Copy Markdown
Owner Author

Round 8 fixes — commit ae77ba1

check-drift: autobot-frontend/src/types/_generated/workflow.ts is out of date

  • Fixed type generator to handle Python 3.10+ X | Y union syntax (creates types.UnionType instead of typing.Union)
  • Kept Optional import with # noqa: F401 — needed by get_type_hints() even though not used in code
  • Regenerated workflow.ts with correct string | null types instead of unknown

startup-import-smoke: ImportError: cannot import name 'Database' from 'transcriber.database'

  • Added Database = TranscriberDatabase alias for backward compatibility with routes/ai.py imports

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

AutoBot Phase Validation Results

System Maturity: 96.5%

Phase Status:

PASS Phase 1: Core Infrastructure: 100.0%
PASS Phase 2: Knowledge Base and Memory: 100.0%
IN PROGRESS Phase 3: LLM Integration: 66.7%
PASS Phase 4: Security and Authentication: 100.0%
PASS Phase 5: Agent Orchestration: 100.0%
PASS Phase 6: Enhanced UI/UX: 100.0%
PASS Phase 7: Testing and Validation: 100.0%
PASS Phase 8: Advanced Features: 100.0%
PASS Phase 9: Multi-Modal AI: 100.0%
PASS Phase 10: Production Readiness: 100.0%

Recommendations:

  • 🟡 MEDIUM: Phase 3: LLM Integration requires attention (66.7% complete): Review and implement
  • ✅ System is production-ready - consider advanced features and scaling: Review and implement

- Add transcriber/deps.py with get_db() FastAPI dependency
- File from commit 4ae3cbd was missing from mva-3524 branch
- Fixes ModuleNotFoundError in startup-import-smoke CI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mrveiss

mrveiss commented Jun 5, 2026

Copy link
Copy Markdown
Owner Author

Round 9 fix — commit aaa71ed

startup-import-smoke: ModuleNotFoundError: No module named 'transcriber.deps'

  • Added missing transcriber/deps.py with get_db() FastAPI dependency
  • File from commit 4ae3cbd was absent from the mva-3524 branch

Status after round 8:

  • ✅ check-drift: PASSING
  • ✅ code-quality: PASSING
  • ❌ startup-import-smoke: failing (now fixed in round 9)

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

AutoBot Phase Validation Results

System Maturity: 96.5%

Phase Status:

PASS Phase 1: Core Infrastructure: 100.0%
PASS Phase 2: Knowledge Base and Memory: 100.0%
IN PROGRESS Phase 3: LLM Integration: 66.7%
PASS Phase 4: Security and Authentication: 100.0%
PASS Phase 5: Agent Orchestration: 100.0%
PASS Phase 6: Enhanced UI/UX: 100.0%
PASS Phase 7: Testing and Validation: 100.0%
PASS Phase 8: Advanced Features: 100.0%
PASS Phase 9: Multi-Modal AI: 100.0%
PASS Phase 10: Production Readiness: 100.0%

Recommendations:

  • 🟡 MEDIUM: Phase 3: LLM Integration requires attention (66.7% complete): Review and implement
  • ✅ System is production-ready - consider advanced features and scaling: Review and implement

@mrveiss mrveiss closed this Jun 5, 2026
@mrveiss

mrveiss commented Jun 5, 2026

Copy link
Copy Markdown
Owner Author

Closing due to CI failures (SAST, code-quality, hardened-smoke-test). Part of PR limit enforcement (MVA-3660).

@mrveiss

mrveiss commented Jun 5, 2026

Copy link
Copy Markdown
Owner Author

Round 10 fix — commit caa9939

startup-import-smoke: ImportError: cannot import name 'AiAskRequest' from 'transcriber.models'

  • Added Literal import and AiAskRequest Pydantic model to transcriber/models.py
  • Model defines action field with 4 literal values + optional custom_question

Pattern emerging: The transcriber module files from commit 4ae3cbd are being added incrementally as import errors surface. This is the transcriber/ai functionality from PR #9044.

All rounds so far:

  • Rounds 1-6: Core lint/type errors
  • Round 7: transcriber/ai package
  • Round 8: Type generator + check-drift
  • Round 9: transcriber/deps.py
  • Round 10: AiAskRequest model

@mrveiss

mrveiss commented Jun 5, 2026

Copy link
Copy Markdown
Owner Author

Forcing PR resync - latest commit: e3c74f8

@mrveiss

mrveiss commented Jun 5, 2026

Copy link
Copy Markdown
Owner Author

Closing this PR due to GitHub sync issues. Creating fresh PR #9585 with all 10 rounds of fixes (commits e3c74f8 and earlier).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants