fix(backend): validate apportionBasisPoints sum, pin node engines and fix dockerignore (#169, #173, #176) - #179
Open
ghzhost wants to merge 1 commit into
Conversation
… 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)
|
Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary of Changes
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):apportionBasisPoints(percentages: number[])to ensureMath.abs(sum(percentages) - 100) <= 0.01, throwing a clearBadRequestExceptionwhen violated.Pin Node.js version in
package.jsonengines (package.json has no engines field pinning a Node.js version, despite CI hardcoding Node 24 #173):"engines": { "node": ">=24" }topackage.jsonmatching CI'snode-version: 24and Docker'snode:24-alpine.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):tsconfig.json,tsconfig.build.json, andnest-cli.jsonfrom.dockerignoreso standalone Docker image builds (docker build --target runner) succeed without missing configuration.Validation
npm run test -- src/escrow/split-math.util.spec.tspasses with 100% success.npm run buildcompleted cleanly without errors.