dxatscale / sfpowerscripts

A build system for modular development in Salesforce
https://dxatscale.io
MIT License
213 stars 96 forks source link

fix(packagediff): fix packages being built when the path to package start with same structure #1423

Closed azlam-abdulsalam closed 1 year ago

azlam-abdulsalam commented 1 year ago

paths are matched with includes rather than checking the directory properly. This can result in packages being built if the directory structure is similar

fixes #1396

Summary generated by Reviewpad on 13 Oct 23 11:41 UTC

This pull request fixes an issue where packages are built incorrectly when the path to the package starts with the same structure. Instead of properly checking the directory, paths were matched using includes, which could result in packages being built even if the directory structure was only similar. The patch modifies the PackageDiffImpl.ts file to properly check the directory structure before building packages. Additionally, a new test case is added in the PackageDiffImpl.test.ts file to verify the fix.

Checklist

All items have to be completed before a PR is merged

codecov[bot] commented 1 year ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (7c5d9d4) 46.80% compared to head (e336f46) 46.86%.

:exclamation: Current head e336f46 differs from pull request most recent head 38fdf45. Consider uploading reports for the commit 38fdf45 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1423 +/- ## ========================================== + Coverage 46.80% 46.86% +0.05% ========================================== Files 70 70 Lines 2662 2665 +3 Branches 302 302 ========================================== + Hits 1246 1249 +3 Misses 1414 1414 Partials 2 2 ``` | [Files](https://app.codecov.io/gh/dxatscale/sfpowerscripts/pull/1423?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dxatscale) | Coverage Δ | | |---|---|---| | [packages/core/src/package/diff/PackageDiffImpl.ts](https://app.codecov.io/gh/dxatscale/sfpowerscripts/pull/1423?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dxatscale#diff-cGFja2FnZXMvY29yZS9zcmMvcGFja2FnZS9kaWZmL1BhY2thZ2VEaWZmSW1wbC50cw==) | `86.66% <100.00%> (+0.55%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.