Skip to content

fix: Bulk file query - #338

Merged
yuvrajjsingh0 merged 1 commit into
mainfrom
fix-bulk-file-query
Jul 2, 2026
Merged

yuvrajjsingh0 merged 1 commit into
mainfrom
fix-bulk-file-query

Conversation

@yuvrajjsingh0

@yuvrajjsingh0 yuvrajjsingh0 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor
    • Optimized file lookup query strategy for improved database performance and efficiency.

@semanticdiff-com

semanticdiff-com Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  airborne_server/src/release/utils.rs  45% smaller
  airborne_server/src/utils/db/models.rs  6% smaller
  airborne_dashboard/package-lock.json  0% smaller

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a16b73d9-0cb4-4911-b70d-458a85960701

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

FileEntry gains the QueryableByName derive. get_files_by_file_keys_async is rewritten to replace per-key Diesel OR predicates with a single sql_query that binds versioned and tagged file keys as SQL arrays, uses unnest() joins, and combines results with UNION, scoped by org_id and app_id. Invalid key formats now return a bad-request error.

Changes

File-key lookup rewrite

Layer / File(s) Summary
Add QueryableByName to FileEntry
airborne_server/src/utils/db/models.rs
FileEntry's #[derive(...)] list gains QueryableByName, enabling Diesel to deserialize sql_query results into this struct.
Rewrite get_files_by_file_keys_async with sql_query + unnest()
airborne_server/src/release/utils.rs
Diesel imports are updated from BoxableExpression/Bool to sql_query/Array/Integer/Text; schema DSL imports are removed. get_files_by_file_keys_async now partitions file_paths into versioned and tagged key arrays, rejects invalid formats with ABError::BadRequest, and issues a single sql_query using unnest() joins combined via UNION constrained by org_id and app_id.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 Hop, hop, no more loops of OR,
Arrays and unnest do the chore!
Two key types split with care,
One UNION joins them there.
The rabbit's queries soar! 🚀

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: Bulk file query' directly aligns with the main change: rewriting the bulk file query lookup strategy in get_files_by_file_keys_async from Diesel predicates to SQL unnest/array approach.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-bulk-file-query

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@yuvrajjsingh0
yuvrajjsingh0 force-pushed the fix-bulk-file-query branch 2 times, most recently from ec0579c to d400640 Compare June 29, 2026 08:44
JamesGeorg
JamesGeorg previously approved these changes Jul 2, 2026
@yuvrajjsingh0
yuvrajjsingh0 merged commit 4d6be91 into main Jul 2, 2026
14 checks passed
@yuvrajjsingh0
yuvrajjsingh0 deleted the fix-bulk-file-query branch July 2, 2026 08:54
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