Skip to content

bug/9664-road-user-assignment-highlighting-is-not-correct-when-loading-ottrk-before-otflow#832

Merged
randy-seng merged 7 commits into
mainfrom
bug/9664-road-user-assignment-highlighting-is-not-correct-when-loading-ottrk-before-otflow
May 29, 2026
Merged

bug/9664-road-user-assignment-highlighting-is-not-correct-when-loading-ottrk-before-otflow#832
randy-seng merged 7 commits into
mainfrom
bug/9664-road-user-assignment-highlighting-is-not-correct-when-loading-ottrk-before-otflow

Conversation

@randy-seng

Copy link
Copy Markdown
Member

Fix flow highlighting and exclude shared rules from version control

Summary

This pull request addresses two improvements:

  1. Flow Highlighting Fix for .ottrk and .otflow:

    • Resolves an issue where road user assignment highlighting was not applied correctly when .ottrk files were loaded before .otflow files.
    • Refactors AddAllFlows to validate all flows at once before insertion, ensuring consistency and avoiding duplicates.
    • Introduces helper functions for validation and updates batch processing to be atomic.
    • Updates flow-loading logic and expands test coverage.
  2. Exclude Shared AI Coding Rules from Version Control:

    • Updates .claude/rules/shared to use symlinks rather than committing shared code style markdown files individually across repositories.
    • This ensures consistent propagation of updates to shared rules without duplication.

OP#9664

randy-seng added 3 commits May 8, 2026 10:58
Shared code style markdown files — used as reference rules for AI coding agents — that apply across multiple projects are now managed via symlinks in .claude/rules/shared rather than being committed to each repository individually.

This avoids duplication and ensures changes to shared AI coding rules propagate consistently without requiring updates across all repos.
When .ottrk files are loaded before .otflow files, road user assignment
highlighting is not correctly applied to all flows. The issue is that
AddAllFlows was adding flows one-by-one (via AddFlow) without ensuring
validation happens against all flows being added together.

- Refactor AddAllFlows.add() to validate all flows upfront before adding
- Validate flows against existing repository AND against other flows being added
- Extract validation helpers (check_flow_already_exists, is_flow_name_valid,
  is_flow_id_valid, flow_with_same_start_end_section_exists) as module functions
- Remove circular AddFlow dependency from AddAllFlows
- Use repository.add_all() for batch insertion to ensure atomic operation
- Add flows_are_unique() check to prevent duplicate flows in same batch
- Update LoadOtflow to use AddAllFlows for batch loading
- Expand test coverage for uniqueness and repository conflicts
@dahelb dahelb self-requested a review May 11, 2026 12:48
dahelb
dahelb previously approved these changes May 11, 2026

@dahelb dahelb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor typing things. Rest looks good to me!

Comment thread OTAnalytics/application/use_cases/flow_repository.py Outdated
Comment thread OTAnalytics/application/use_cases/flow_repository.py
@randy-seng randy-seng merged commit 33eb122 into main May 29, 2026
13 checks passed
@randy-seng randy-seng deleted the bug/9664-road-user-assignment-highlighting-is-not-correct-when-loading-ottrk-before-otflow branch May 29, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants