Skip to content

feat(BA-4819): add alias filter conditions to ImageConditions#9562

Merged
fregataa merged 7 commits intomainfrom
BA-4819
Mar 3, 2026
Merged

feat(BA-4819): add alias filter conditions to ImageConditions#9562
fregataa merged 7 commits intomainfrom
BA-4819

Conversation

@fregataa
Copy link
Copy Markdown
Member

@fregataa fregataa commented Mar 1, 2026

Summary

  • Add 4 subquery-based alias filter methods (by_alias_contains, by_alias_equals, by_alias_starts_with, by_alias_ends_with) to ImageConditions class
  • Each method uses ImageRow.id.in_(subquery) pattern against ImageAliasRow to filter images by their aliases
  • Supports case_insensitive (ilike vs like) and negated (sa.not_()) flags, consistent with existing name/architecture filters

Test plan

  • Verify all 4 methods follow the same IN subquery pattern
  • Verify case_insensitive flag toggles ilike/like correctly
  • Verify negated flag wraps condition with sa.not_()
  • CI passes (lint, type check, tests)

Resolves BA-4819

Add subquery-based alias filter methods (by_alias_contains,
by_alias_equals, by_alias_starts_with, by_alias_ends_with)
to ImageConditions class for filtering images by their aliases
using IN subquery pattern against ImageAliasRow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 1, 2026 13:38
@github-actions github-actions Bot added size:M 30~100 LoC comp:manager Related to Manager component labels Mar 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds alias-based string filtering capabilities to the image repository query options, enabling filtering ImageRow results by matching against related ImageAliasRow.alias values.

Changes:

  • Added four alias string-match condition factories to ImageConditions: contains/equals/starts_with/ends_with
  • Implemented alias filtering via subqueries against ImageAliasRow.image_id, with support for case_insensitive and negated

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ai/backend/manager/repositories/image/options.py Outdated
Comment thread src/ai/backend/manager/repositories/image/options.py Outdated
@fregataa fregataa added this to the 26.3 milestone Mar 1, 2026
fregataa and others added 2 commits March 1, 2026 23:00
Replace ImageRow.id.in_(subquery) with sa.exists() pattern in all 4
alias filter methods (contains, equals, starts_with, ends_with) to
align with codebase conventions and avoid NULL-related edge cases
with NOT IN subqueries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 12 tests for ImageConditions alias filter methods (by_alias_contains,
by_alias_equals, by_alias_starts_with, by_alias_ends_with). Each method
is tested for basic matching, case_insensitive flag, and negated flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added size:L 100~500 LoC and removed size:M 30~100 LoC labels Mar 1, 2026
…lias

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fregataa fregataa requested a review from a team March 1, 2026 14:17
Comment thread tests/unit/manager/repositories/image/test_image_repository.py Outdated
fregataa and others added 2 commits March 3, 2026 10:48
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fregataa fregataa requested review from a team and seedspirit March 3, 2026 01:54
@fregataa fregataa merged commit e3d9460 into main Mar 3, 2026
21 checks passed
@fregataa fregataa deleted the BA-4819 branch March 3, 2026 05:04
jopemachine pushed a commit that referenced this pull request Mar 3, 2026
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:manager Related to Manager component size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants