Skip to content

Sort generated schema list#31

Merged
renatomassaro merged 1 commit intomainfrom
sort-schema-list
Dec 31, 2025
Merged

Sort generated schema list#31
renatomassaro merged 1 commit intomainfrom
sort-schema-list

Conversation

@renatomassaro
Copy link
Copy Markdown
Owner

@renatomassaro renatomassaro commented Dec 31, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Database schema listings now display in a consistent, deterministic order, improving reliability and predictability of output across multiple executions.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 31, 2025

📝 Walkthrough

Walkthrough

This change modifies the schema listing logic to ensure deterministic ordering by sorting the list of detected schemas from the ETS table before processing, and sorting each context's accumulated module names in lexical order for stable, consistent results.

Changes

Cohort / File(s) Summary
Schema list sorting
lib/mix/task/feeb_db/list_schemas.ex
Added sorting of schemas retrieved from ETS table before reducing to per-context map; module names for each context converted to strings, appended, and sorted to ensure deterministic lexical ordering

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Schemas sorted, deterministic and true,
No more chaos in the listing queue,
Each module lined up, lexical and neat,
Stable order makes the output complete!

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Sort generated schema list' directly summarizes the main change: sorting schema lists for deterministic ordering.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0d0d604 and e39b981.

📒 Files selected for processing (1)
  • lib/mix/task/feeb_db/list_schemas.ex
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-12-17T00:35:18.307Z
Learnt from: renatomassaro
Repo: renatomassaro/FeebDB PR: 16
File: lib/feeb/db/schema.ex:393-401
Timestamp: 2024-12-17T00:35:18.307Z
Learning: In `Feeb.DB.Schema`, prefer to let the system crash if the schema implementation is wrong, rather than handling exceptions in `trigger_after_read_callbacks/2`, to avoid passing around potentially incorrect or invalid data.

Applied to files:

  • lib/mix/task/feeb_db/list_schemas.ex
🔇 Additional comments (1)
lib/mix/task/feeb_db/list_schemas.ex (1)

46-49: LGTM! Deterministic ordering achieved.

Both sorting additions work together to ensure deterministic output:

  • Line 46 sorts the ETS entries (which have undefined order)
  • Line 49 maintains sorted module lists per context

The changes correctly achieve the PR's objective of producing stable, consistent schema output.


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 and usage tips.

@renatomassaro renatomassaro merged commit 2bc76b5 into main Dec 31, 2025
2 of 3 checks passed
@renatomassaro renatomassaro deleted the sort-schema-list branch December 31, 2025 23:13
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