Skip to content

fix(overlay): make sure root updates and array[0] updates work#685

Merged
paulRbr merged 3 commits intobump-sh:mainfrom
paulRbr:fix-overlay
Apr 1, 2025
Merged

fix(overlay): make sure root updates and array[0] updates work#685
paulRbr merged 3 commits intobump-sh:mainfrom
paulRbr:fix-overlay

Conversation

@paulRbr
Copy link
Copy Markdown
Member

@paulRbr paulRbr commented Mar 31, 2025

These two cases (updating the root object, and, updating the first element of an array) was not tested in our unit tests and were both broken by the previous overlay core refactoring (#673). 🤯

Thanks a lot to @lcawl for reporting this issue 🙇

Closes https://github.com/bump-sh/bump/issues/6579

@paulRbr paulRbr self-assigned this Mar 31, 2025
@paulRbr paulRbr requested a review from AurelDbs March 31, 2025 13:51
paulRbr added 3 commits March 31, 2025 15:56
While refactoring the overlay core in 2.9.3, we forgot to return the
resulting object of the merge when the target overlay is the root
object (`$`). Leading to an incorrect overlayed definition.

The fix here is to return the definition object after an update.
This bug was introduced in the refactor of the overlay core lib of
2.9.3.

Javascript default falsy values can be tricky (especially for `0`
which is falsy). In the case of applying an overlay on an array, the
first index (`0`) would never be modified due to this bug.

We now compare the index to the literal `undefined` instead of
checking its “falsyness”.
Copy link
Copy Markdown
Contributor

@AurelDbs AurelDbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@paulRbr paulRbr merged commit e65f10d into bump-sh:main Apr 1, 2025
9 checks passed
@paulRbr paulRbr deleted the fix-overlay branch April 1, 2025 10:25
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.

2 participants