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

Add tags for added and removed content in jsondiff #770

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Mar 31, 2022

It is not clear what is added and removed in jsondiff introduced in #743.

Add +/- tags before content added or removed as indication of the reason
to appear in the diff.

Changes appear now like this:

Added:

{
    "expected": [
        {
            ...skipped 5 object properties...,
            "source": {
                + "address": "127.0.0.1",
                ...skipped 1 object property...
            },
            ...skipped 4 object properties...
        },
        ...skipped 8 array elements...
    ]
}

Removed:

{
    "expected": [
        {
            ...skipped 5 object properties...,
            "source": {
                ...skipped 2 object properties...,
                - "port": "33456"
            },
            ...skipped 4 object properties...
        },
        ...skipped 8 array elements...
    ]
}

Changed:

{
    "expected": [
        {
            ...skipped 5 object properties...,
            "source": {
                "address": "127.0.0.2" => "127.0.0.1",
                ...skipped 1 object property...
            },
            ...skipped 4 object properties...
        },
        ...skipped 8 array elements...
    ]
}

An object is renamed:

{
    "expected": [
        {
            ...skipped 5 object properties...,
            + "source": {
                + "address": "127.0.0.1",
                + "ip": "127.0.0.1"
            + },
            - "sources": {
                - "address": "127.0.0.1",
                - "ip": "127.0.0.1"
            - },
            ...skipped 4 object properties...
        },
        ...skipped 8 array elements...
    ]
}

Reported in #743 (comment).

@jsoriano jsoriano requested a review from a team March 31, 2022 12:00
@jsoriano jsoriano self-assigned this Mar 31, 2022
@jsoriano jsoriano added the Team:Ecosystem Label for the Packages Ecosystem team label Mar 31, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Mar 31, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-03-31T12:00:41.741+0000

  • Duration: 31 min 16 sec

Test stats 🧪

Test Results
Failed 0
Passed 622
Skipped 0
Total 622

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@jsoriano jsoriano merged commit d1a1203 into elastic:main Mar 31, 2022
@jsoriano jsoriano deleted the tags-jsondiff branch March 31, 2022 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Ecosystem Label for the Packages Ecosystem team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants