Layer7-Community / graphman-client

This repository contains a Postman collection, a Node.js CLI application, sample queries for the CLI, and GraphQL schemas for the Graphman API.
Other
6 stars 5 forks source link

diff enhancement : fullDiff option #43

Closed muemi03 closed 4 weeks ago

muemi03 commented 3 months ago

Suggestion for diff enhancement

the new option fullDiff separates differences into updates, inserts and deletes The diff result bundle lists the results in a main structure looking like:

{
    "updates" : { ... },
    "inserts" : { ... },
    "deletes" : { ... }
}

explode , implode functions taking care about this structure

This capability is helpful especially in a rollback situation, when you want to identify what exactly will happen, when doing a rollback. Example: graphman.sh diff --input ToBe-bundle.json --input From-bundle.json --output ToDo-bundle.json --options.fullDiff true

It works best with exported bundles, and not with gateway references, especially in regard to what needs to be deleted. The resources to be deleted are taken from the 2nd input. In case of a gateway reference "@..." only the summary properties will be included. That might not be sufficient data for an actual deletion operation.(e.g. clusterProperty)

muemi03 commented 4 weeks ago

Since graphman-client version 1.3.00 this kind of information can be gathered by the --output-report option of the diff command. Thanks a million for providing an ootb solution !! Closing this request.