Skip to content

fix(backend): restore correct audit_middleware import — unblocks smoke-test CI (MVA-1466) - #8901

Merged
mrveiss merged 1 commit into
Dev_new_guifrom
MVA-1466
May 28, 2026
Merged

mrveiss merged 1 commit into
Dev_new_guifrom
MVA-1466

Conversation

@mrveiss

@mrveiss mrveiss commented May 28, 2026 •

Copy link
Copy Markdown
Owner

Thinking Path

Smoke-test CI was failing across all PRs with ModuleNotFoundError: No module named 'autobot_backend' in initialization/lifespan.py:1748. Investigation via failure-log artifact (run 26572931286) traced the import to from autobot_backend.audit_middleware import set_main_event_loop. All other audit_middleware callsites use the correct relative path from middleware.audit_middleware import .... git pickaxe identified PR #7426 (2026-05-16) as the commit that introduced the wrong import. One-line revert fixes the startup crash.

What Changed

  • autobot-backend/initialization/lifespan.py:1748: Changed import from autobot_backend.audit_middleware (nonexistent under PYTHONPATH) to middleware.audit_middleware (correct path)

Verification

  • smoke-test CI passes on this PR
  • hardened-smoke-test CI passes on this PR
  • Backend container reaches healthy state (no ModuleNotFoundError at startup)

Risks

None — single-line import correction, reverts a regression. All other audit_middleware callsites already use the correct path.

Model Used

Claude Sonnet 4.6 (claude-sonnet-4-6)

Issue Link

Closes MVA-1466

Checklist

  • Code follows AutoBot patterns from CLAUDE.md
  • Tests added or updated (N/A — import fix only)
  • Documentation updated if behavior changed (N/A)
  • Pre-commit hooks pass
  • PR targets Dev_new_gui (not main)
  • No secrets or credentials in the diff

…dError on startup

Commit 9f29b2e (PR #7426) changed the import from the correct
`middleware.audit_middleware` to `autobot_backend.audit_middleware`.
No `autobot_backend` package exists in PYTHONPATH so the backend crashed
on every container startup, causing smoke-test and hardened-smoke-test
to fail across all PRs.

Reverts to the pre-#7426 form which matches every other call site and
the PYTHONPATH layout in docker/backend/Dockerfile.

Fixes: MVA-1466

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

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

@mrveiss

mrveiss commented May 28, 2026

Copy link
Copy Markdown
Owner Author

Code Review — MVA-1468 (CodeReviewer agent)

Change: initialization/lifespan.py:1748 — import path corrected from autobot_backend.audit_middleware to middleware.audit_middleware.

Verification:

  • autobot-backend/middleware/audit_middleware.py confirmed present at the correct path
  • All 3 other audit_middleware callsites in the codebase use from middleware.audit_middleware import ... — this fix aligns the one outlier
  • startup-import-smoke ✅ passing — confirms import resolves at startup

CI:

  • smoke-test ❌ — confirmed infrastructure failure: System.IO.IOException: No space left on device on runner (not a code regression). Rerun triggered.
  • hardened-smoke-test / code-quality ⏳ pending

Risk: Minimal — 1-line revert of regression traced by git pickaxe to PR #7426. No logic, API, or data-flow changes.

Recommendation: Merge when pending checks clear. If smoke-test rerun fails again due to same infra cause, admin bypass is justified — this is the root-cause fix the codebase needs.

@mrveiss
mrveiss merged commit f372cd7 into Dev_new_gui May 28, 2026
12 of 17 checks passed
@mrveiss
mrveiss deleted the MVA-1466 branch May 28, 2026 12:58
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.

1 participant