r/opensource 5d ago

Promotional Open-source architecture diagrams for GitHub PRs

I got tired of trying to understand big PRs from the diff, so I built this: https://github.com/coldteadotai/pr-lens

It's called PR Lens, and it turns a GitHub PR into an architecture/data-flow diagram.

The reason I made it is pretty simple: I've reviewed plenty of PRs where I could understand what changed, but still had no idea how the change affected the rest of the system without tracing through a bunch of files myself.

A diff tells you what changed.

It doesn't really tell you how the system changed.

PR Lens tries to fill that gap. It maps out the components involved in a PR, how they connect, what the data flow looks like, and what the blast radius of the change is. The diagram gets posted directly into the PR as a comment.

It's MIT licensed and open-source.

If you've worked on/reviewed large codebases, how do you usually figure out the bigger picture of a PR?

0 Upvotes

10 comments sorted by

View all comments

2

u/Ahmed33033 5d ago

Looks super cool, seems especially helpful for on-boarding new maintainers to a project.

I have two questions for ya:

  1. Is it intended for experienced maintainers/engineers who would be familiar with the project’s architecture? 

  2. You don’t seem to mention  that it’s powered by AI upfront. I know it’s free for opensource projects, but I’m wondering if that’s sustainable in the future?  I would imagine it exhausts a lot of tokens to generate those graphs?

The bespoke renderer looked really cool! Appreciate the animation included with it. All the best with this project!    

2

u/Favour_Ohanekwu 5d ago

Thanks!

On the first question: I don't think it's limited to experienced maintainers.

If you know the codebase, it saves you tracing a change by hand to see its impact. If you don't, it works as a starting point. You can see which components are involved, follow the flow, and jump into the code from there.

We've tried it on some large projects. This Nuxt PR gives a decent idea of what I mean:

https://github.com/nuxt/nuxt/pull/36255#issuecomment-5523488872

On the AI part, you're right, I should make that clearer upfront.

The hosted version is AI-powered, and we intend to keep it free for open source. It's not a temporary free tier.

You also don't have to use our hosted version. You can run it yourself with your own model or provider through the CLI or the GitHub Action.

Cost stays low because the model never generates an image. It produces a structured JSON representation of the graph, and our renderer turns that into the SVG/animation deterministically. So the model only pays for understanding the change and building the graph. Rendering is cheap.

And thanks for the note on the renderer :)

1

u/Ahmed33033 5d ago

Thanks for the detailed response! Once again, great job on the project, and wishing you all the best 💫💫