Page MenuHomeIn-Portal Phabricator

INP-1930 - Add Command-Line Template Compilation Support
Needs RevisionPublic

Authored by alex on Tue, Nov 25, 5:37 AM.

Details

Reviewers
erik
Test Plan

Preparations

  1. apply the patch of the D552 (if not already applied)
  2. connect to the server/vm via SSH
  3. go to the project root folder
  4. go to the tools folder
  5. run the sudo ./fix_perms.sh command
  6. go to the project root folder
  7. go to the system/cache folder
  8. run the sudo rm -Rf core modules themes command

Part 1 (No Command-Line Compilation)

  1. perform the clean install
  2. login to the Admin Console
  3. go to the ConfigurationWebsiteAdvanced section
  4. scroll to the System Settings subsection
  5. confirm, that:
    • the Compiled Template Permission Mode system setting is present
    • it has a hint
    • it has 3 options in the dropdown
    • the No Command-Line Compilation option is selected
  6. go to the ToolsSystem Tools section
  7. use the Clear Templates Cache functionality
  8. connect to the server/vm via SSH
  9. go to the project root folder
  10. confirm, that system/cache/core/admin_templates/incs folder:
    • is present
    • has drwxr-xr-x permissions
  11. confirm, that system/cache/core/admin_templates/incs/form_blocks.php file:
    • is present
    • has -rw-r--r-- permissions

Part 2 (Command-Line Compilation with Server Configuration)

  1. login to the Admin Console
  2. go to the ConfigurationWebsiteAdvanced section
  3. scroll to the System Settings subsection
  4. change the value of the Compiled Template Permission Mode system setting to the Command-Line Compilation with Server Configuration and save changes
  5. connect to the server/vm via SSH
  6. go to the project root folder
  7. confirm, that system/cache/core/admin_templates/incs folder:
    • is present
    • has drwxrwxr-x permissions
  8. confirm, that system/cache/core/admin_templates/incs/form_blocks.php file:
    • is present
    • has -rw-rw-r-- permissions

Part 3 (Command-Line Compilation without Server Configuration (Security Risk) )

  1. login to the Admin Console
  2. go to the ConfigurationWebsiteAdvanced section
  3. scroll to the System Settings subsection
  4. change the value of the Compiled Template Permission Mode system setting to the Command-Line Compilation without Server Configuration (Security Risk) and save changes
  5. connect to the server/vm via SSH
  6. go to the project root folder
  7. confirm, that system/cache/core/admin_templates/incs folder:
    • is present
    • has drwxr-xrwx permissions
  8. confirm, that system/cache/core/admin_templates/incs/form_blocks.php file:
    • is present
    • has -rw-r--rw- permissions

Part 4 (compiled template removal error propagation)

  1. login to the Admin Console
  2. go to the ConfigurationWebsiteAdvanced section
  3. scroll to the System Settings subsection
  4. connect to the server/vm via SSH
  5. go to the project root folder
  6. run the sudo chown root:root system/cache/core/admin_templates/incs command (type your password if asked for) to change the owner of the folder, where compiled templates are stored
  7. switch back to the Admin Console
  8. change the value of the Compiled Template Permission Mode system setting to anything other, than current and save changes
  9. confirm that you'll see an error message above the system settings list indicating which folders weren't deleted as part of the system setting change

Part 5 (fix_perms.sh script test)

  1. connect to the server/vm via SSH
  2. go to the project root folder
  3. go to the tools folder
  4. run the sudo ./fix_perms.sh command
  5. confirm, that:
    • the system folder has drwxrwxrwx permissions
    • the system/cache folder has drwxrwxrwx permissions

Part 6 - upgrade

  1. repeat Part 1, Part 2, Part 3 and Part 4, but doing an upgrade instead of clean install
  2. confirm that Compiled Template Permission Mode system setting is positioned the same as during clean install

Diff Detail

Repository
rINP In-Portal
Branch
branches/5.2.x
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 11175
Build 3875: arc lint + arc unit

Event Timeline

alex created this revision.Tue, Nov 25, 5:37 AM
alex requested review of this revision.Tue, Nov 25, 5:37 AM
alex edited the test plan for this revision. (Show Details)Tue, Nov 25, 5:40 AM
erik requested changes to this revision.Tue, Nov 25, 10:19 AM

failed parts 1.10, 1.11. (in both clean install and upgrade cases)

after "use the Clear Templates Cache functionality"
system/cache/core/admin_templates folder is present and has drwxr-xr-x permissions, but system/cache/core/admin_templates/config folder is not present, and system/cache/core/admin_templates/config/config_universal.php file is not present.

under system/cache/core/admin_templates folder are present only incs folder and and tools folder

after "Compiled Template Permission Mode" is changed, system/cache/core/admin_templates/tools folder disappears and system/cache/core/admin_templates/config folder is created, so all other test plan checks are passed.

This revision now requires changes to proceed.Tue, Nov 25, 10:19 AM
alex requested review of this revision.Tue, Nov 25, 10:52 AM
alex edited the test plan for this revision. (Show Details)
In D546#11169, @erik wrote:

failed parts 1.10, 1.11. (in both clean install and upgrade cases)

after "use the Clear Templates Cache functionality"
system/cache/core/admin_templates folder is present and has drwxr-xr-x permissions, but system/cache/core/admin_templates/config folder is not present, and system/cache/core/admin_templates/config/config_universal.php file is not present.

under system/cache/core/admin_templates folder are present only incs folder and and tools folder

after "Compiled Template Permission Mode" is changed, system/cache/core/admin_templates/tools folder disappears and system/cache/core/admin_templates/config folder is created, so all other test plan checks are passed.

I've updated the test plan to use folder/file that should be present at all times. Please retest.

erik accepted this revision.Tue, Nov 25, 11:26 AM
This revision is now accepted and ready to land.Tue, Nov 25, 11:26 AM
alex edited the test plan for this revision. (Show Details)Sat, Dec 20, 6:15 AM
alex updated this revision to Diff 1425.Sat, Dec 20, 6:17 AM

Corrected permissions on the system folder itself. Report indirect compiled template removal as part of system setting change.

alex updated this revision to Diff 1426.Sat, Dec 20, 6:19 AM

Restored chages in the TemplatesCache class, that were accidentally removed.

alex requested review of this revision.Sat, Dec 20, 12:43 PM
alex edited the test plan for this revision. (Show Details)
erik requested changes to this revision.Mon, Dec 22, 4:55 AM

After clean install
Part 4.9 - confirm that you'll see an error message above the system settings list indicating which folders weren't deleted as part of the system setting change. - There appears only "Please manually delete paths:" message. No folder names are present in the message.

After upgrade
Part 1.7 use the Clear Templates Cache functionality - shown same "Please manually delete paths:" message in the "System Tools" section, as in Part 4.9 after clean install in the "Configuration->Advanced" section.
Part 2.4 change the value of the Compiled Template Permission Mode system setting to the Command-Line Compilation with Server Configuration and save changes - shown same "Please manually delete paths:" message, as in Part 4.9 after clean install
Part 2.7 confirm, that system/cache/core/admin_templates/incs folder has drwxrwxr-x permissions - no, it has drwxr-xr-x permissions
Part 2.8 confirm, that system/cache/core/admin_templates/incs/form_blocks.php file has -rw-rw-r-- permissions - no, it has -rw-r--r-- permissions
Part 3.4 change the value of the Compiled Template Permission Mode system setting to the Command-Line Compilation without Server Configuration (Security Risk) and save changes - shown same "Please manually delete paths:" message, as in Part 4.9 after clean install
Part 3.7 confirm, that system/cache/core/admin_templates/incs folder has drwxr-xrwx permissions - no, it has drwxr-xr-x permissions
Part 3.8 confirm, that system/cache/core/admin_templates/incs/form_blocks.php file has -rw-r--rw- permissions - no, it has -rw-r--r-- permissions
Part 4.9 - confirm that you'll see an error message above the system settings list indicating which folders weren't deleted as part of the system setting change. - There appears only "Please manually delete paths:" message. No folder names are present in the message.

This revision now requires changes to proceed.Mon, Dec 22, 4:55 AM