cancel
Showing results for 
Search instead for 
Did you mean: 

Designer: Pretty JSON when exporting pipelines to assist with external version control systems

omair
Contributor

Use-case: I would like to use version control to store my pipeline assets. Organizational restrictions prevent the use of Github for version control. Right now the dev process is to export pipelines from designer and commit them to version control (Mercurial).

The Designer pipeline export operation, minifies the pipeline JSON to a single line. This makes it impossible to do any diff comparisons or review pipeline changes within a diffing tool.

Feature request: Pretty print JSON when exporting a pipeline from Designer:

image

1 REPLY 1

ForbinCSD
Contributor

I second this request!

And I think what he means by “pretty printing” is not so much “format it nicely” as it is a request that there be an option to export the pipelines in a JSON format with frequent line breaks, and with each JSON property or element sorted in some canonical order.

I do realize that’s far more complicated in practice than it is in theory!

It will probably take quite a bit of experimentation to determine what that “canonical order” ought to be.
I am guessing a good starting place is to sort multiple pipelines by their names in alphanumeric order; snaps within the pipeline might be output in the order they occur. Multiple entry or exit points might have to be arbitrarily sorted by their origin point on the GUI canvas (left to right and top to bottom), or another scheme may need to be developed. Branches and merges within a pipeline will obviously be particularly tricky.

The goal is that I should be able to run something like a Linux diff tool (or a comparison tool like BeyondCompare) on “before” and “after” exports. What I should see is not some confusing mismash of differences due to arbitrary (and changeable) JSON ordering (which is what happens currently). I should instead see only the actual changes I made: a couple of additions and deletions of fields to a mapper snap here, a couple of other snaps added there, and a whole set of snaps replaced by a child pipeline execution somewhere else. Hopefully you get the picture.

Again, I realize this is far more easily said, than done.

But it’s a feature that will have a huge payoff for anyone who is self-hosting a revision control system like Mercurial, Git, or Subversion.