Repository navigation
fix(llc): address MVA-820 CR medium-priority findings for GH#8211 - #8456
Merged
Merged
Conversation
- _assert_prefix_unique: add deleted_at IS NULL guard so soft-deleted orgs no longer permanently poison their issue_prefix slot (#5) - CompanyUpdate: remove llc_status field — callers must use dedicated suspend()/archive() methods to enforce transition guards (#6) - API handlers: add session.rollback() in all except branches and a bare Exception fallback to keep the connection pool clean on IntegrityError and other unexpected failures (#7) - delete endpoint: catch CompanyHasChildrenError → 409 with rollback (#7) - suspend()/archive(): add state transition matrix — suspend only from ONBOARDING/ACTIVE, archive only from PAUSED/OFFBOARDING; raises ValueError on invalid transition (#8) - get_ancestry: chain.append + chain.reverse() instead of insert(0), eliminating O(n²) list-copy on deep hierarchies (#9) - _build_tree_node: asyncio.gather children instead of sequential await, reducing tree fetch to O(depth) round-trips (#10) Co-Authored-By: Paperclip <noreply@paperclip.ing>
Contributor
|
| Metric | Count |
|---|---|
| Total Violations | 7 |
| SSOT Violations (high priority) | 7 |
| Other Violations | 0 |
⚠️ 7 values have SSOT config equivalents!
These should be replaced with SSOT config imports:
Python:
from src.config.ssot_config import config
# Use: config.vm.main, config.port.backend, config.backend_urlTypeScript:
import config from '@/config/ssot-config'
// Use: config.vm.main, config.port.backend, config.backendUrl📖 See SSOT_CONFIG_GUIDE.md for documentation.
Closed
9 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Follow-up to #8452. Addresses medium and low-priority findings from the MVA-820 code review that were not covered by the critical-fix squash.
_assert_prefix_unique— addsdeleted_at IS NULLso soft-deleted orgs no longer permanently poison theirissue_prefixslot.CompanyUpdate— removesllc_statusfield; callers must usesuspend()/archive()to enforce transition guards.session.rollback()added in all except branches + bareExceptionfallback;DELETE /{id}now catchesCompanyHasChildrenError→ 409.suspend()/archive()— state transition matrix enforced;suspendonly fromONBOARDING/ACTIVE,archiveonly fromPAUSED/OFFBOARDING.get_ancestry—append+reverse()replacesinsert(0), O(n) instead of O(n²)._build_tree_node—asyncio.gatherfor children, O(depth) DB round-trips instead of O(breadth × depth).Test plan
python -m py_compile llc/services/company.py llc/models/company.py llc/api/companies.py— passespython -m pytest autobot-backend/llc/ -k company -v— existing tests passllc_statusshould be rejected by Pydantic🤖 Generated with Claude Code