HACKER Q&A
📣 gregoriol

How do you keep track of actions to perform at next pull?


On some projects, when committing some kind of changes, the next time someone else on the team pulls the code, they will need to perform some actions to adapt to the changes. How do you keep track of those actions? do you document them? do you automate them?

Some examples are: * changes to package.json or composer.json or any other dependencies: the team-mate has to perform an npm/composer/... update on their machine * database migrations: the team-mate has to run the migration on their local database * vm or system configuration: the team-mate has to run some vagrant or docker or ansible or... commands

In some cases with these changes, the team-mate could continue to work without noticing that they need to perform some action, which is not good. In other cases, they will pull the code and have errors everywhere, and will need to figure out what has changed and which actions are needed.

I thought of a changelog obviously, but for code that is not released yet it does not seem practical: how would you write that "after commit xxxxxx you need to ..." since that changelog should be included in the commit itself


  👤 solardev Accepted Answer ✓
Jetbrains will automatically warn you if your package.json is ever out of sync with the actual installed packages (a little dialog pops up). It's not clear to me how VScode handles this (and in fact, one of my colleagues often struggled with this). Closed issue with unclear resolution: https://github.com/microsoft/vscode/issues/66288

It's one of the many, many, many nice little touches that Jetbrains offers over VScode, and I heavily recommend people who have never tried it to give it a shot for a few weeks/months. It's a LOT better than vanilla VSCode, and slightly better than VSCode + a ton of third-party extensions.

--------

Beyond that, I also see npm script chaining. e.g. instead of `npm run dev` to start your server, `npm run pre-dev-scripts` which call a bunch of other updates, style token generations, npm install, whatever. Combine that with git hooks (like pre-commit linting & formatting) and it's often pretty automatic. For external services, you should be able to specify them in some IDE config file that can trigger task runners, monitors, etc. and share that in the repo with your teammates: https://code.visualstudio.com/docs/editor/tasks

That's a bit harder if you work across IDEs (like VScode and Jetbrains), but not always impossible. Our Docker auto-updates in VScode, for example, but doesn't do anything in Jetbrains :(