Skip to content

fix(backend): validate apportionBasisPoints sum, pin node engines and fix dockerignore (#169, #173, #176) - #179

Open
ghzhost wants to merge 1 commit into
MergeFi:mainfrom
ghzhost:fix/backend-maintenance-hardening-169-173-176
Open

fix(backend): validate apportionBasisPoints sum, pin node engines and fix dockerignore (#169, #173, #176)#179
ghzhost wants to merge 1 commit into
MergeFi:mainfrom
ghzhost:fix/backend-maintenance-hardening-169-173-176

Conversation

@ghzhost

@ghzhost ghzhost commented Aug 21, 2026

Copy link
Copy Markdown

Summary of Changes

  1. Defensive validation in apportionBasisPoints (apportionBasisPoints doesn't validate that its own input sums to ~100 before force-normalizing the output — and has no test for that scenario #169):

    • Added validation at the start of apportionBasisPoints(percentages: number[]) to ensure Math.abs(sum(percentages) - 100) <= 0.01, throwing a clear BadRequestException when violated.
    • Added unit test cases verifying invalid sums are rejected as expected.
  2. Pin Node.js version in package.json engines (package.json has no engines field pinning a Node.js version, despite CI hardcoding Node 24 #173):

    • Added "engines": { "node": ">=24" } to package.json matching CI's node-version: 24 and Docker's node:24-alpine.
  3. Restore Docker build configuration files in .dockerignore ([Verified by reproduction] .dockerignore excludes tsconfig.json/tsconfig.build.json/nest-cli.json, breaking npm run build inside every Docker stage #176):

    • Removed tsconfig.json, tsconfig.build.json, and nest-cli.json from .dockerignore so standalone Docker image builds (docker build --target runner) succeed without missing configuration.

Validation

  • npm run test -- src/escrow/split-math.util.spec.ts passes with 100% success.
  • npm run build completed cleanly without errors.

… fix dockerignore (MergeFi#169, MergeFi#173, MergeFi#176)

- Validate that apportionBasisPoints percentage input sums to 100 within tolerance, failing fast with BadRequestException and O(1) error handling (MergeFi#169)
- Pin Node.js >=24 in package.json engines field matching CI and Dockerfile (MergeFi#173)
- Remove tsconfig/nest-cli files from .dockerignore so docker runner/dev builds find TS configs (MergeFi#176)
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

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