Skip to content

test(expenses): compare only prior order_items columns in the migration check - #1287

Merged
itsbkm merged 1 commit into
mainfrom
fix/expense-migration-test-order-items
Oct 22, 2026
Merged

itsbkm merged 1 commit into
mainfrom
fix/expense-migration-test-order-items

Conversation

@itsbkm

@itsbkm itsbkm commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Main CI has been red since #1284 merged. tests/expense-records.test.ts snapshots SELECT * FROM order_items before and after upgrading and asserts the rows are identical. Migration 116 (price override) correctly adds five columns to order_items, so the "after" rows carried extra fields and the check read it as the migration rewriting data. test:expenses runs in pretest, so it failed Core shard 1 and all four platform builds in the Full Cross-Platform Matrix.

This compares only the order_items columns that existed before the upgrade, so later additive columns no longer trip the check. The migration itself is unchanged and the check still catches any rewrite of existing columns.

Test plan

  • npm run test:expenses passes.
  • The rest of the pretest chain passes locally: script-coverage, payment-methods-split, diagnostics, reports-export, category-addon-groups, product-variants-db, addon-inventory-db/api, product-variants-api, release-regressions.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated the prior-schema snapshot to compare only columns that existed before the expense migration, keeping preserved-row checks unaffected by later added columns.

@itsbkm
itsbkm enabled auto-merge (squash) October 22, 2026 14:24
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Auto 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

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 0ea6c28 and 835a8bf.

📒 Files selected for processing: 1
  • tests/expense-records.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The expense-records test now selects only pre-migration order_items columns when it snapshots rows for the preservation comparison.

Changes

Expense records preservation test

Layer / File(s) Summary
Prior-schema preservation snapshot
tests/expense-records.test.ts
The test reads column names from PRAGMA table_info and selects those columns explicitly instead of using SELECT *.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Possibly related issues

  • Issue 1281 proposes adding override and audit fields to order_items through a forward-only migration. This test change accounts for additive columns when comparing preserved rows.
Merge Risk: ⚪ Minimal · up to 835a8

No actionable merge-blocking risk remains.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the problem, the fix, and the reported test plan. It omits most required template sections, including related work, scope, compatibility and data safety, cross-cutting surface… Complete the required template sections. State related work, scope, exact verification commands and results, compatibility and data-safety impact, applicable cross-cutting surfaces, documentation status, screenshot applicability, and contri…
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the test change and explains that the comparison now uses only prior order_items columns.
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.
Full details: Description check

Explanation

The description explains the problem, the fix, and the reported test plan. It omits most required template sections, including related work, scope, compatibility and data safety, cross-cutting surfaces, documentation, screenshots, and the contributor checklist.

Resolution

Complete the required template sections. State related work, scope, exact verification commands and results, compatibility and data-safety impact, applicable cross-cutting surfaces, documentation status, screenshot applicability, and contributor checklist items.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@itsbkm

itsbkm commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@khaira777
khaira777 force-pushed the fix/expense-migration-test-order-items branch from 835a8bf to c5099cf Compare October 22, 2026 16:02
@itsbkm
itsbkm merged commit 832037f into main Oct 22, 2026
38 of 41 checks passed
@itsbkm
itsbkm deleted the fix/expense-migration-test-order-items branch October 22, 2026 16:16
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