-
Notifications
You must be signed in to change notification settings - Fork 70
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
delta #473
Merged
Merged
delta #473
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #473 +/- ##
==========================================
+ Coverage 83.75% 83.85% +0.10%
==========================================
Files 217 225 +8
Lines 12593 12799 +206
==========================================
+ Hits 10547 10733 +186
- Misses 1668 1683 +15
- Partials 378 383 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
dnighvn
reviewed
Jan 18, 2024
effoeffi
added a commit
to oasdiff/oasdiff
that referenced
this pull request
Feb 1, 2024
* add flag to control colorful output (Tufin#433) * Bump github.com/oasdiff/go-common from 0.2.27 to 0.2.28 (Tufin#444) * color-flag completion (Tufin#447) * Bump cloud.google.com/go from 0.110.10 to 0.111.0 (Tufin#448) * prevent---color-with-non-text-formats (Tufin#449) * upgrade-to-kin-openapi-v0.122.0 (Tufin#450) * diff-add-exclude-elements-options (Tufin#454) * remove-hardcoded-quotes (Tufin#455) * Correct int messages (Tufin#456) * fix test (Tufin#457) * add qr code (Tufin#458) * typo * github-annotations-with-api (Tufin#452) * add source file to github (Tufin#459) * Change sample sunset date to self-explain that it's YYYY-MM-DD format (Tufin#460) * github-avoid-http-files (Tufin#462) * Update ALLOF.md * flatten command - fix wrong Title and Description values (Tufin#464) * flatten command - prune oneOf field on circular references (Tufin#466) * lower-min-go-ver (Tufin#471) * update Breaking Changes to Enum Values * Bump cloud.google.com/go from 0.111.0 to 0.112.0 (Tufin#472) * delta (Tufin#473) * add property name to the response's type/format change message (Tufin#477) * documentation (Tufin#478) * Update DELTA.md (Tufin#480) --------- Co-authored-by: Reuven Harrison <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: effoeffi <[email protected]> Co-authored-by: Maciej Lewiński <[email protected]> Co-authored-by: Omer E <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch implements a new delta function for OpenAPI spec.
The delta function returns a numeric value between 0 and 1 representing the distance between base and revision specs.
For any spec, a:
delta(a, a) = 0
For any two specs, a and b, with no common elements:
delta(a, b) = 1
Delta is symmetric by default:
For any two specs, a and b:
delta(a, b) = delta(b, a)
Delta can also be asymmetric so that it only considers elements of base that are deleted in revision but not elements of base that are added in revision.
For any two specs, a and b:
asymmetricDelta(a, b) + asymmetricDelta(b, a) = 1
In order to implement delta, we need to traverse the diff tree.
We will implement this until all elements are covered.
Each diff element that is supported by delta must have a new
Unchanged
member that allows delta to know how many items were unchanged.Note that the new
Unchanged
member will also appear in theoasdiff diff
output when diff is not empty.We will implement this gradually until all elements are covered.
To test delta:
oasdiff delta data/simple4.yaml data/simple3.yaml
To test asymmetric delta:
oasdiff delta data/simple4.yaml data/simple3.yaml --asymmetric
To see the new Unchanged fields:
oasdiff diff data/simple4.yaml data/simple3.yaml