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

sous chef return deep copies of cached objects #484

Merged
merged 2 commits into from
Oct 25, 2024
Merged

Conversation

rboston628
Copy link
Contributor

@rboston628 rboston628 commented Oct 25, 2024

Description of work

It was possible for code in SNAPRed to edit the cached ingredients objects in SousChef, resulting in globally different sets of parameters.

This fixes that.

Explanation of work

Used deepcopy of the cached objects to prevent the original being overwritten.

Shallow copies cannot work here, as it is still possible to change things in a shallow copy that reflect in the original.

There are new tests to ensure the cached objects cannot be changed.

To test

Dev testing

Run diffcal, save, continue, run again same run, at tweak peak stage make sure the same peaks are there and same settings.

Run normal, make sure the tweak peak stage appears. If so, should be good.

Double check the unit tests.

CIS testing

N/A, but will be apparent in testing of PR #480

Link to EWM item

No ticket, but arose in development:

EWM#7388

Was discovered during testing of PR #480

Verification

N/A

Acceptance Criteria

N/A

Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.39%. Comparing base (523b781) to head (b9d4834).
Report is 1 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next     #484   +/-   ##
=======================================
  Coverage   96.39%   96.39%           
=======================================
  Files          65       65           
  Lines        4740     4741    +1     
=======================================
+ Hits         4569     4570    +1     
  Misses        171      171           

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

@rboston628 rboston628 marked this pull request as ready for review October 25, 2024 15:35
@rboston628 rboston628 enabled auto-merge (squash) October 25, 2024 15:39
Copy link
Collaborator

@dlcaballero16 dlcaballero16 left a comment

Choose a reason for hiding this comment

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

Tested diffcal and parameters stay on 2nd run through. Normalization also works.

@rboston628 rboston628 merged commit cd43cc7 into next Oct 25, 2024
8 checks passed
@rboston628 rboston628 deleted the patch-sous-chef branch October 25, 2024 19:27
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