Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mutable remote refs #171

Merged
merged 2 commits into from
Apr 4, 2024
Merged

fix: mutable remote refs #171

merged 2 commits into from
Apr 4, 2024

Conversation

nadilas
Copy link
Member

@nadilas nadilas commented Apr 4, 2024

TL;DR

Fix a bug in restoring from history in the Ogre repository.

What changed?

Added a test for restoring from history and a test for remoteRefs not changing on commit. Also added utility functions immutableMapCopy and mutableMapCopy.

How to test?

Run the new tests added and verify the correct behavior.

Why make this change?

Since maps store objects by reference, remoteRefs were mutated during commits so they became unusable.


https://macarthur.me/posts/maps-store-objects-by-reference/

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @dotinc/[email protected]
npm install @dotinc/[email protected]
# or 
yarn add @dotinc/[email protected]
yarn add @dotinc/[email protected]

Copy link

vercel bot commented Apr 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
ogre ⬜️ Ignored (Inspect) Visit Preview Apr 4, 2024 6:50pm

Copy link
Member Author

nadilas commented Apr 4, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @nadilas and the rest of your teammates on Graphite Graphite

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 77.59%. Comparing base (5a08e4b) to head (7a45731).
Report is 2 commits behind head on main.

❗ Current head 7a45731 differs from pull request most recent head 5f575db. Consider uploading reports for the commit 5f575db to get more accurate results

Files Patch % Lines
packages/ogre/src/repository.ts 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
+ Coverage   76.83%   77.59%   +0.75%     
==========================================
  Files           6        6              
  Lines         354      366      +12     
  Branches       78       80       +2     
==========================================
+ Hits          272      284      +12     
+ Misses         55       54       -1     
- Partials       27       28       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nadilas nadilas merged commit 4b65485 into main Apr 4, 2024
8 checks passed
@nadilas nadilas deleted the fix/mutable_remote_refs branch April 4, 2024 18:53
Copy link

github-actions bot commented Apr 4, 2024

@github-actions github-actions bot added the released This issue/pull request has been released. label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant