You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are sometimes running into issues with project config and git, and I was wondering if the problem lies with our workflow, or is caused by project config somehow and if something can be done to prevent this.
The following happens quite often:
Colleague A is working on a bit of code (in a git feature branch) and is making some new fields and sections. The corresponding config files get submitted to git and a pull-request is made. After the pull-request is approved, the feature is merged into develop (but not yet released to the staging server).
Colleague B has to do some work on the same project the next day. He pulls the latest code from the development branch and downloads a database from the staging server, so he has a nice starting point. The problem here is that the downloaded database does not yet contain the latest changes from colleague A, since they haven't been rolled out yet. (Not every project of ours has continuous integration and immediately deploys to staging after code has been merged)
Colleague B then makes some changes to a field and saves the changes, and the result is that Craft sees there's a mismatch between project config and the database. There are sections and fields from colleague A present in project config, but missing from the database and what Craft does is it will remove the project config files corresponding to those sections and fields. If colleague B then does not manually check the project config files he's about to commit, he will remove precious work from another colleague, shame on him.
I guess the issue is with colleague B not running project-config/apply after downloading the database and before he begins development, but as far as he knows he has the latest development code and the latest database....
How do you guys manage this? Thanks in advance
Additional info
Craft version: 3.5.18
PHP version: 7.4
The text was updated successfully, but these errors were encountered:
@thijskaspers This is a scenario which sometimes happens on projects I work with. I've not found the perfect solution and it has bit me a couple of times. I have thought of either enforcing some rules to follow, or creating a script to get the latest database from an environment and run some commands to help automate the process.
It would be interesting to see how others deal with this
This is why the control panel presents a big nag alert when there are pending project config changes:
Each of your developers should be instructed to pay attention to that, click “Review”, and then click the “Apply changes only” button, before making any additional changes that will affect the project config.
We are sometimes running into issues with project config and git, and I was wondering if the problem lies with our workflow, or is caused by project config somehow and if something can be done to prevent this.
The following happens quite often:
Colleague A is working on a bit of code (in a git feature branch) and is making some new fields and sections. The corresponding config files get submitted to git and a pull-request is made. After the pull-request is approved, the feature is merged into develop (but not yet released to the staging server).
Colleague B has to do some work on the same project the next day. He pulls the latest code from the development branch and downloads a database from the staging server, so he has a nice starting point. The problem here is that the downloaded database does not yet contain the latest changes from colleague A, since they haven't been rolled out yet. (Not every project of ours has continuous integration and immediately deploys to staging after code has been merged)
Colleague B then makes some changes to a field and saves the changes, and the result is that Craft sees there's a mismatch between project config and the database. There are sections and fields from colleague A present in project config, but missing from the database and what Craft does is it will remove the project config files corresponding to those sections and fields. If colleague B then does not manually check the project config files he's about to commit, he will remove precious work from another colleague, shame on him.
I guess the issue is with colleague B not running
project-config/apply
after downloading the database and before he begins development, but as far as he knows he has the latest development code and the latest database....How do you guys manage this? Thanks in advance
Additional info
The text was updated successfully, but these errors were encountered: