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

Seal dies to enable diff and patch operations #142

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

scothis
Copy link
Collaborator

@scothis scothis commented May 6, 2024

DieSeal stashes the current value of the die for later use in DieDiff and DiePatch operations. DieDiff use cmp.Diff to generate a textual diff of changes made to the die since it was seeled. DiePatch generates patch bytes to go from the seeled to current value.

@scothis
Copy link
Collaborator Author

scothis commented May 6, 2024

Need to add tests and attempt to minimize new packages introduced.

Copy link

codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 67.18750% with 21 lines in your changes missing coverage. Please review.

Project coverage is 10.78%. Comparing base (b4c0177) to head (f715874).

Files Patch % Lines
patch/patch.go 72.00% 6 Missing and 1 partial ⚠️
patch/json/json.go 53.84% 3 Missing and 3 partials ⚠️
patch/merge/merge.go 60.00% 2 Missing and 2 partials ⚠️
patch/strategicmerge/strategicmerge.go 60.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##            main     #142      +/-   ##
=========================================
+ Coverage   9.71%   10.78%   +1.06%     
=========================================
  Files         69       74       +5     
  Lines       3221     3283      +62     
=========================================
+ Hits         313      354      +41     
- Misses      2905     2918      +13     
- Partials       3       11       +8     

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

@mamachanko
Copy link
Collaborator

@scothis shouldn't it be DieSeal? Unless you actually mean to say "seel", which would make sense as well. https://www.merriam-webster.com/dictionary/seel

DieSeal stashes the current value of the die for later use in DieDiff
and DiePatch operations. DieDiff use cmp.Diff to generate a textual diff
of changes made to the die since it was seeled. DiePatch generates patch
bytes to go from the sealed to current value.

Note: diff and patch operations are only meaningful from the root die.
Dies used while stamping do not contain the original sealed value.

Individual patch implementation must be dynamically registered before
use. For the known patch types, this can be done by importing the
respective package. A meaningful error is provided if the type is not
imported. Users may implement additional or alternative patch types.

Signed-off-by: Scott Andrews <[email protected]>
@scothis scothis marked this pull request as ready for review June 19, 2024 18:21
@scothis scothis changed the title Seel dies to enable diff and patch operations Seal dies to enable diff and patch operations Jun 19, 2024
@scothis scothis merged commit 04fcf15 into reconcilerio:main Jun 19, 2024
4 checks passed
@scothis scothis deleted the seel branch June 19, 2024 18:23
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.

None yet

2 participants