Child pages
  • [deployment] Swap Deploy & Synchronize buttons
Skip to end of metadata
Go to start of metadata

Right now deployment part of System Tools page looks like this.

Original worflow

At time, when it was developed that in a multi-developer environment workflow looks like this:

  1. developer_a makes a change and commits it
  2. developer_b makes a change, but doesn't commit it
  3. developer_b clicks on Synchronize button, which:
    1. marks all non-executed revisions from project_upgrades.sql file as executed
    2. exports language pack into /system/export/Custom.lang
    3. resets all caches
  4. developer_b updates code from repository
  5. developer_b solves conflicts (if any, including duplicate revision numbers in project_upgrades.sql file)
  6. developer_b clicks on Deploy button, which:
    1. executes revisions from project_upgrades.sql file, that were added after update
    2. imports new phrase/e-mail templates, that were added after update
    3. resets all caches
  7. developer_b makes a commit
  8. return to step 1

This workflow seems awesome and you can't even see a glitch in it, that would cause some revisions from project_upgrades.sql not to be executed without user even knowing that something went wrong. Here is the problem:

  1. developer_a added 5th revision and commited it
  2. developer_b added 5th revision and haven't commited it
  3. after developer_b has pressed Synchronize button he marked his 5th revision as synchronized
  4. in fact what he did is marked developer_b 5th revision as synchronized after it will get it after doing repository update

Proposed workflow

With Deploy and Synchronize buttons swapped it would now look like this:

  1. developer_a makes a change and commits it
  2. developer_b makes a change, but doesn't commit it
  3. developer_b updates code from repository
  4. developer_b solves conflicts (if any, including duplicate revision numbers in project_upgrades.sql file)
  5. developer_b clicks on Deploy button, which:
    1. executes revisions from project_upgrades.sql file, that were added after update
    2. imports new phrase/e-mail templates, that were added after update
    3. resets all caches
  6. developer_b clicks on Synchronize button, which:
    1. marks all non-executed revisions from project_upgrades.sql file as executed
    2. exports language pack into /system/export/Custom.lang
    3. resets all caches
  7. developer_b makes a commit
  8. return to step 1

This workflow fixes the original problem, but reveals another problem: on 5th step not only new revisions (that came from repository update), but also existing revisions that were not commited yet will be executed. This would in 100% create SQL error, because I:

  1. create & execute sql in phpMyAdmin
  2. copy/paste it into project_upgrades.sql file

It however isn't problem if this discussion, but rather of related one: [deployment] Show un-deployed revisions in "System Tools" section

Related Tasks

INP-1273 - Getting issue details... STATUS

2 Comments

  1. Great insides, I think we should have this documented elsewhere too. Please create a task for this particular job (swapping buttons) - 5.3.0 since it's kind of part of bigger changes.

  2. Also "custom/install/english.lang" should be replaced with "[module]/install/english.lang", because language pack is imported for all modules having "[module]/install/project_upgrades.sql" file.