Mapping SAFE repository dependencies

Awesome work @tfa! I had a play around with it locally yesterday and was considering going down the route of making it a gh-pages branch of the QA repo which is then pushed to every time a crate is published, but the auto regeneration every night saves the need for that IMO.

My thinking is that we’ll fork it - will have a look again later today :slight_smile:

12 Likes

Created a fork here.
Added 3 extra repos (mobile) and published here.

Finishing up for the day now so I’ll add a README tomorrow and have a think about how best to link to it from other repos - perhaps displaying the image in READMEs is OTT, or maybe I should but only in select repos. Feels like it belongs in a much larger overview document/wiki that should be linked to from each README…

Suggestions welcome & I should get time to come back to it tomorrow.

16 Likes

Quick update on dependencies - I’ve added the README as promised. Still not decided exactly how/where to link to this SVG.

Inspired by this, I went off on a tangent after some inception-like subliminal messages overnight from @danda, and spent time today looking into adding dependency trees or graphs on a per repository basis (as opposed to a general overview of all main Maidsafe repos).

I’ve raised a PR proposing adding a dependency graph to the safe_vault repo.
Will see what the feedback is for that and perhaps this can be rolled out across the main repositories.

15 Likes

Nice! There’s also the diagram on this page although it’s out of date at this point:

https://github.com/maidsafe/safe_client_libs/wiki

The command that was used to generate that is included under “More info”, with some tweaking it should be possible to update the diagram

13 Likes

Hey @marcin! I came across your cargo-deps yesterday after hitting a bug with cargo-graph. Based my vault graph off of your SCL example & it works like a charm :smile:

9 Likes

With my latest commit JavaScript repositories are not hardcoded anymore (safe_browser and safe-nodejs). You can merge it if you want.

Rust repositories are analyzed automatically from their Cargo.toml files and Javascript repositories from their package.json file. Note that safe-nodejs is in fact a Rust repository because it is its main language (Rust 72.7%, JavaScript 26.6%, Other 0.7%).

I will see what I can do for C# repositories. I guess that internal links can be derived from their csproj files. But I have not the faintest idea on how to get their external links (like safe_app_csharp depending on safe-ffi).

10 Likes

Have merged the latest so back in sync :tada:
Tagging @ravinderjangra who may be able to offer some insight into C# repos

6 Likes

Finally, I don’t think I will automate C# repos:

  • in addition to the csproj files there is the sln file which doesn’t have a standard format
  • there are many sub-projects to filter out (tests projects and IOs or Android specific projects)
  • it’s not very useful because after filtering there remains only one sub-project for 2 of them
  • external links seem difficult to retrieve

I have added sub-projects on safe_app_csharp repo (of course manually):

Here is the result:

I haven’t delivered it yet, because I think it could be improved by setting the right source sub-project on the link to safe-ffi. @ravinderjangra , which one is it?

  • SafeApp
  • SafeApp.AppBindings
  • SafeApp.Core

Also, is safe-ffi the right destination for the link? I find it strange that it is not the same one as for safe-nodejs (which is safe-api).

11 Likes

Might be worth moving these posts to a dedicated thread such as Mapping SAFE repository dependencies to make it easier to find in the future. Thoughts?

7 Likes

hey @tfa, @StephenC,

For the C# repos, we can put a check on the csproj file will and see if the file contains MaidSafe.SafeApp. If that exists then the repo is using safe_app_csharp. To simplify the graph, we can simply show safe_app_csharp (since the graph is representing repo dependencies). In case we want to be more transparent then the we can point SafeApp.AppBindings to the safe-ffi.

6 Likes

Thanks. I prefer to add inner dependencies of safe_app_csharp like I did for safe-api and safe_client_libs. This gives a more accurate picture of the whole system.

I have delivered this, and result is:

Visible at : Inter repository dependencies

Edit : I have also replaced hard coded branch names by usage of current default branch.

7 Likes

I now use d3-graphviz to interpret dot file client-side. This allows to compute some elements dynamically:

  • Displaying or hiding sub-components

  • Using splines or polylines

Note: the static svg file is still generated but isn’t used anymore in my github page.

Hiding sub-components:

Showing sub-components:

21 Likes

Rebased and I must say this looks mighty fine Inter repository dependencies :tada: :muscle:

11 Likes

Very nice. I must say seeing it all laid out so clearly disturbs my inner pedant though re. the use of hyphens and underlines: safe-mobile-browser, safe_browser etc.

12 Likes

True, these need standardised for sure.

11 Likes

phew! My OCD rash just got a little less itchy.

9 Likes

Ha yeah this disparity has been nibbling at me for a while as well, guess this graph is the nudge I need to get them updated. I’ll be suggesting to the team that all is standardised separated by -, which seems to be most common these days, 1 less keystroke

11 Likes

Looking good. So on chrome, double clicking anywhere inside the svg causes it to zoom in, but I don’t see how to zoom out. anyone know?

btw, it is different from the regular browser text/page zoom, i already tried that.

2 Likes

For me (macOS) the scroll up on the mouse zooms out, scroll downwards zooms in

1 Like

ahh, I see. It can be zoomed out with the mouse scroll wheel. dunno if there is a keyboard alternative.

2 Likes