Downloading some specific functions, but not all developed functions, from development to a live server

This is more or less connected with project management, as well as with each developer. How do you guys cope with this situation when you have developed many functions on the development site, and they are all tested by the client and ready to work live.

These functions have some code in shared files, i.e. One PHP file has code for one function, as well as another function.

But the client will ask you to download only 2 functions of 10 or 15. Files are common, if you download this file directly, this will lead to errors because they have code for other functions. If you download all updated files, then the whole function will be live.

A possible way is to go back and comment on this feature, which is not currently required from regular files. But there is an opportunity to forget about commenting somewhere else.

This is also a bad way, and finally, the client will say what is happening on the development server, and why these errors and errors appear on the real server. This will reduce the faith of developers.

I have come across this problem many times and could not find a good way to avoid these problems. So I think that you guys have run into this issue, or run into this issue.

I think a version control system can help here.

How do you guys handle this?

Could you share some ideas?

+6
php deployment project-management
source share
3 answers

The situation you are describing cannot be reasonable. I do not think that it would be possible to make this situation work, but the real question is - why do you want?

There are a number of problems in the scenario you are describing, but the main problem is this. You check one and deploy the other. You confirm in your question the interconnected nature of the changes. Actually it is even more difficult than you describe. You simply cannot know how the system will behave when you try to deploy parts of the test solution. Why test it at all?

The only reasonable solution I see is to have a sandbox environment in which new features are demonstrated. However, keep your test environment only for testing material that will live. Thus, in your example, one or two functions are in the test, ready to be signed for prod, and other functions are locked in the sandbox.

This leads to the following problem that is managing your source code. I do not see a reasonable strategy to control the arbitrary inclusion of functions from the code base. Even in the most flexible system I know, Perforce, any branching fear will require awful merge permissions when you try to move things back and forth.

I saw how this happened, and believe me that it is becoming very ugly.

I suggest you come up with a better solution. Talk with your client and reorder. It will be better for you, and ultimately better for them.

+10
source share

The solution may be to use forks with different versions, as provided by VCS, such as Git or Mercurial. The project will consist of many function branches used to develop these functions and build branches, where function branches will be merged and adhoc fixing will be performed. When the assembly branch is ready for testing, it is checked, fixed if necessary, and then the assembly branch is sent to the production platform. When the functions have been tested, the construction branch can be merged into the remaining function branches, so the developed branches can integrate the β€œofficial” changes. Thus, the application, if necessary, is configured based on existing function branches.

+3
source share

One reasonable sensible way to manage this at the code level is to isolate every function in the plugin. Then you can add / remove functions on demand by simply enabling or disabling the appropriate plugins.

But this solution has certain costs:

  • Plugin development and testing time for your application

  • You need to test each plugin configuration (the set of plugins included and their versions) that will be deployed. Otherwise, there is a risk that this particular set is incompatible, and end users will first see the resulting crash, data loss, or some other horror.

  • Extra time for wirte plugins so that they are minimally dependent on each other.

This is usually only worth it if you have many customers with different needs. In your case, I would recommend explaining the cost of the separately provided features to your client to see if they really need it. Most likely they are not

+2
source share

All Articles