flox / flox

Developer environments you can take with you
https://flox.dev
GNU General Public License v2.0
2.49k stars 60 forks source link

flox push with custom changelog message #1259

Open ghudgins opened 6 months ago

ghudgins commented 6 months ago

Acceptance Criteria

New environment pushes Given I have just flox init -n newly-pushed && flox install yarn When I flox push -m "hello world" <-- new option Then I see my push was successful And When I login to FloxHub and view the newly-pushed environment's changelog Then I see three separate change log entries (each with a different timestamp, likely)

Push generation 1

ghudgins: hello world

And

Create generation 1

Add first generation

And

Initialize generations branch for environment '<env-name>'

generation 2+ pushes And When I flox install mkcert And I flox install nodejs And flox push -m "new note" Then I see my push was successful And When I login to FloxHub and refresh the newly-pushed environment's changelog Then I see three new separate change log entries (each with a different timestamp, likely)

Push generations 2-3

ghudgins: new note

And

Create generation 3

Installed packages: [[PackageToInstall { id: "node", pkg_path: "nodejs", version: None, input: None }]

And

Create generation 2

Installed packages: [[PackageToInstall { id: "mkcert", pkg_path: "mkcert", version: None, input: None }]
ghudgins commented 6 months ago

@jennymahmoudi could use a design review on this

mkenigs commented 6 months ago

Probably needs some CLI input as well, because currently we store the changelog in git history which is written at the time of the transaction (i.e. when we do the flox install) Adding a note at push time might require rewriting history or adding another commit which might not be straightforward.

jennymahmoudi commented 6 months ago

-m makes sense. Could we consider adding the username to the beginning of their custom message? or would we want to capture the user for the commit separately, whether they add a custom message or not?

jennymahmoudi commented 4 months ago

AC have been updated. @mkenigs and I met to discuss and decided that the flox push message will be tied to a new type of separate change log entry. This entry will say which generation(s) were pushed, plus the optional change log message.

Why? Each local change to an environment is recorded as a generation, and these git commits have their own message recorded in history. When you flox push, all those commit messages are then shown in the FloxHub change log. That means a flox push message isn't tied to a specific generation commit / change log entry.

One downside to this direction is that it makes the purpose of the change log somewhat inconsistent - it's both a record of what has happened locally to the environment, AND what has happened to the remote environment. It's not a perfect model but I believe it's adding enough value to outweigh this inconsistency.