ci(hosting): fix broken deploy workflow (no build script, missing tests)#2
Open
DDancingDeath wants to merge 1 commit into
Open
ci(hosting): fix broken deploy workflow (no build script, missing tests)#2DDancingDeath wants to merge 1 commit into
DDancingDeath wants to merge 1 commit into
Conversation
The auto-generated firebase-hosting-merge.yml ran pm ci && npm run build but this repo has no �uild script in package.json (it ships static www/ files directly). Every push to main therefore failed at the build step and the prod site has not been redeployed by CI for some time. Changes: - Replace pm ci && npm run build with pm ci --legacy-peer-deps. --legacy-peer-deps is required because canvas@^3 has unresolvable peer deps (canvas is a leftover dep, not actually used by the app). - Add a pm test step before deploy. Today the suite is 100+ tests; this prevents pushing a redbar to prod. - Pin Node 20 explicitly via actions/setup-node so we don't drift with the runner default. - Same fix applied to firebase-hosting-pull-request.yml so PR preview channels also work. This is the "fix prod CI" PR planned in the staging clone's docs/PROMOTION.md and tracked as todo p5-first-pr-fix-prod-ci. The change is intentionally tiny and self-contained so it's safe to land first, before any of the larger walkthrough fixes from the staging clone are cherry-picked over. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Visit the preview URL for this PR (updated for commit 6e27351): https://aadhat-management--pr2-fix-ci-no-build-scri-16ignpz9.web.app (expires Sat, 16 May 2026 10:48:40 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 5ce8f7fac8c1342e16024f8a7cbe810820e89324 |
DDancingDeath
pushed a commit
that referenced
this pull request
Jun 6, 2026
…rphan visibility
The stocks page was showing inflated quantities for items whose legacy sale
records had a slightly-different-cased name (or stale itemId) than the
canonical catalogue entry. Three independent bugs were collaborating to
hide the discrepancy:
1. calculateStock applied stock adjustments in storage order (DESC by
date) instead of chronological order, so a 'set' adjustment used a
stale snapshot of stock and silently overwrote every event recorded
after it. Refactored to a single chronological event timeline that
replays purchases, sales and adjustments in real time order. A 'set'
adjustment now uses adj.quantity (the user-entered target) rather
than the stale adj.newStock snapshot.
2. getItemKey did a case-sensitive name fallback for records without
itemId, so a sale saved as 'Piyar Dana' produced a different bucket
from a purchase saved as 'piyar dana'. Normalised with trim() +
toLowerCase() and added an itemId-fallthrough so stale itemIds also
resolve to the right bucket.
3. renderStock then silently dropped any bucket that had no catalogue
match (if (!item) return;). Orphans are now rendered as red/orange
'Unmatched' warning rows so data-integrity issues are visible
instead of hidden, and console.warn lists the orphan keys.
Also adds a debugItemForName helper (window.debugItem) that dumps the
full event timeline for a named item from the DevTools console — used
during diagnosis.
Tests: 114/114 passing (was 112) — 11 chronological-replay tests in
calculateStock.test.js cover bug fixes #1, #2 (case insensitivity for
both name and hindiName), and the on-demand sale-bucket creation that
prevents the silent-drop bug #3.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The auto-generated firebase-hosting-merge.yml ran
npm ci && npm run buildbut this repo has no build script. Replaces withnpm ci --legacy-peer-deps+npm test+ Node 20 pin. Same fix for the PR preview workflow.Safe to merge - only touches CI YAML, doesn't change app code or rules.