Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The struggle I have with project generators is that you can only run them once.

If you didn't think you needed the billing module when you ran it but later you find that you need it, the generator is of little use. You end up running it again to create a new project and manually copying in the billing pieces.

Or, if the generator is upgraded after you used it, it's to late for you.

I wonder if this tool tries to mitigate those issues at all.



We went down this path on a project I worked on at Netflix and, in hindsight, I consider it a mistake. The result was a massive number of services with dashboards, metrics, code bases, etc. all stuck in a snapshot of time. Upgrades were manual, tedious, and error prone. As a central team, that work scaled linearly with the number of services that used our generator.

Pulling all of that down into a module that is managed and versioned allows you to upgrade your users. I now consider that almost table stakes for anything I build/manage as a platform team.


Have you found good examples of this in other languages/frameworks? I'd be very interested in links/references.


Exactly. Generation of anything without round-tripping is going to be a problem. Libraries > frameworks :D


Yeah, you can re-run it, but then you have to merge the code. It's often not too bad, but can be tedious and complicated to figure out the first time around.

What I recommend people do is immediately commit the "clean" generated project to a new branch. Then you can apply an upgrade directly onto that branch, so it only has the "pure" diff. Then you can merge that to your main branch.

There's more info here, and a video walkthrough if you're curious: https://docs.saaspegasus.com/upgrading.html#using-branches-r...

I've dreamed of automating it more, but would have to build an entire github integration to manage other people's compiled projects...


Have you ever looked into Rails generators? They’re meant to be run over the lifetime of the project, and many libraries (specifically thinking of Devise, since it’s a large feature) have “install me” generators.


Interesting, thanks for the tip! I think what grandparent may have been referring to is if you run a generator with one set of arguments, make changes to the generated code, then you want to rerun the generator to regenerate the code with a different set of arguments.

For example if you have a generator that has an argument for which logging library to use, you might want to change the logging library later. Maybe a bad example.

I think this is where LLMs can thrive. Has anyone investigated using LLMs for resolving merge conflicts?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: