Diff Report for LabVIEW files

What about a diff report for LabVIEW files on a webpage?

As all you of know, diff in a graphical language is quite a challenge, with few options, the solution ends up with running locally a script to run over all the code changes. As much as it “works”, it is time consuming and not practical. You need to leave the MR page, go to your machine, checkout the correct branch and so on.

For some time, I’ve been looking for a tool to help with merge reviews. Whether you are working with branches, git flow, in teams or alone, it is always nice to visually see the changes between your current code and the one already committed.

So, recently I was able to put together all the required ingredients and create a small PoC to show what this tool will be capable of. Not without its challenges (was beaten by some html code), this can help teamwork and review at best.

Some questions that may arise.

Where can it run?

It will be focused to run on pipelines, but it may be adapted to run locally too.

Does it use another language?

It uses primarily G (LabVIEW) and it could call some external tools (git) from within the block diagram.

What is the git use?

It uses git for checking out branches and making the diff list so we can find conflict and see the changed files, added files, and so on.

How does it compare the files?

For comparing VIs, it uses LVCompare method and other files, it is essentially using VI Server and scripting methods.

And the report format?

Ah, this is HTML so it can render in Gitlab Pages for example. This posed me quite a challenge, HTML, javascript and CSS are powerful, but they can get quite complicated if you want things to look nice.

Can I comment direct to the report?

Yes, this should be possible using the Gitlab API for example and comment directly to file under review. I am sure other tools also have their own way to do something similar.

What are your ideas about it?

MR Report Link: https://felipe_public.gitlab.io/-/diff-example-poc/-/jobs/7441581398/artifacts/Report/index.html

MR Link: https://gitlab.com/felipe_public/diff-example-poc/-/merge_requests/2

Leave a comment