Which is more important in a web application code promotion hierarchy? production environment to repo equivalence or unidirectional propagation?

Posted by ghbarratt on Programmers See other posts from Programmers or by ghbarratt
Published on 2012-06-19T22:36:12Z Indexed on 2012/06/20 3:23 UTC
Read the original article Hit count: 308

Lets say you have a code promotion hierarchy consisting of several environments, (the polar end) two of which are development (dev) and production (prod).

Lets say you also have a web application where important (but not developer controlled) files are created (and perhaps altered) in the production environment.

Lets say that you (or someone above you) decided that the files which are controlled/created/altered/deleted in the production environment needed to go into the repository.

Which of the following two sets of practice / approaches do you find best:

  1. Committing these non-developed file modifications made in the production environment so that the repository reflects the production environment as closely and as often as possible.

  2. Generally ignoring the non-developed production environment alterations, placing confidence in backups to restore the production environment should it be harmed, and keeping a resolution to avoid pushing developments through the promotion hierarchy in the reverse direction (avoiding pushing from prod to dev), only committing the files found in the production environment if they were absolutely necessary in other environments for development.

So, 1 or 2, and why?

PS - I am currently slightly biased toward maintaining production environment to repository equivalence (option 1), but I keep an open mind and would accept an answer supporting either.

© Programmers or respective owner

Related posts about programming-practices

Related posts about development-environment