Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-1274

Store deployment log in the database

    XMLWordPrintable

    Details

    • Additional information:
      Hide

      Table ModuleDeploymentLog isn't a log technically, because deleting a record from it would cause this revision to be executed again on next deploy.

      Show
      Table ModuleDeploymentLog isn't a log technically, because deleting a record from it would cause this revision to be executed again on next deploy.
    • Change Log Group:
      Changed
    • Change Log Message:
      The deployment log is now stored in the database instead of "project_upgrades.log" file.
    • Story Points:
      2
    • Patch Instructions:

      Patches must be submitted through Phabricator.

    • BC Break Details:
      Hide

      Property scope reduced (was public, now protected):

      • "kDBConnection::$errorHandler"
      • "kDBLoadBalancer::$errorHandler"
      Show
      Property scope reduced (was public, now protected): "kDBConnection::$errorHandler" "kDBLoadBalancer::$errorHandler"

      Description

      Create new storage/display system

      Create ModuleDeploymentLog database table with following columns:

      • Id
      • Module - name of module, revision belongs to
      • RevisionNumber - deployed revision number
      • RevisionTitle - title of revision from project_upgrades.sql
      • CreatedOn - when revision was deployed
      • IPAddress - who deployed a revision
      • Output - deployment messages
      • ErrorMessage - error message, that happened during deployment process
      • Mode - how revision was processed (automatic, manual)
      • Status - deployment status (successful, error, skipped)

      Add "Deployment" tab in Modules list, that would show contents of ModuleDeploymentLog database table.

      "Mode" would tell if a revision was processed during deploy/synchronize operation (mode=automatic) or developer changed it status by hand (mode=manual).

      Migrate existing data

      For every module, that have "install/project_upgrades.sql" file need to:

      1. parse it to get revision titles VS number associations
      2. keep only revisions, that were listed in AppliedDBRevisions column in Modules table
      3. create record in ModuleDeploymentLog database table for each revision with following fields filled in:
      • Id - automatic
      • Module - module, being processed
      • RevisionNumber - revision number, being processed
      • RevisionTitle - revision title, being processed
      • CreatedOn - IMPORT_DATE
      • IPAddress - 0.0.0.0
      • Output - "IMPORTED" text
      • ErrorMessage - "" (empty)
      • Status - deployed normally (since we don't know actual status)

      Then we can safely drop AppliedDBRevisions column from Module table.

      Update deployment script

      Update deployment script to write information to corresponding columns.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Erik Snarski [Intechnic]
                Reviewer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: