How to work with Code Studio Automated Code Updates

  • Last updated
  • 2 minute read

Goal

Configuring Acquia Code Studio to run automated updates

Prerequisites

  • Access to Code Studio

Overview

As a developer, we’ve all experienced the time it takes to maintain a Drupal application, let alone 100s. Pulling the latest code changes, creating a new feature branch, syncing the DB from PROD to grab the latest content, updating composer, exporting configuration and pushing back up. Even if you are already set up with a local or Cloud IDE, this can take some time. Yes, there are tools we can use to speed up this process, drush, hosting CLIs, automated scripts… but again, this is just more to maintain and update to newer versions, when PHP or other software gets released. 

Today, hundreds of Acquia clients take advantage of our Remote Administration service, a fully-managed site administration that lets you view site updates in a private staging environment and deploy them automatically once approved.  With the Remote Administration service, Acquia handles typical and routine Drupal administration tasks so your team can focus on developing new features or on completing other high-value tasks. This has been essential for larger teams to coordinate updates and maintain fleets of sites.

As you know, a CI/CD pipeline is also one of the most valuable tools a team can use to ensure the code is scanned for governance, standards and security. Acquia CI/CD Pipelines has been the solution for many of our clients in order to build better code, fix bugs faster, reduce risk and in general, smoothen the path to production. 

Image
Acquia Code Studio Logo

With Acquia’s recent release of Code Studio, we’ve partnered with GitLab to provide our customers with a fully managed  CI/CD pipeline for Drupal optimized Auto DevOps; and remote administration procedures into Acquia’s Automatic Updates. Acquia hosts and maintains GitLab on our next generation Cloud Platform giving customers best-in-class GitLab plus Acquia-only features that make building and updating Drupal easier than ever. Code Studio comes with a number of pre-built automations to support low-configuration, continuous integration, and continuous delivery of Drupal 9+ projects to Acquia Cloud Platform hosted applications. 

 

Code Studio provides automatic code updates through scheduled CI/CD builds. Simply create a scheduled pipeline and when it runs, Code Studio will:

  • Scan your code for outdated Composer Packages (e.g., Drupal Core) and deprecated code (e.g., your custom module(s))

  • If updates are available, it will create new merge request(s)

  • These merge requests will trigger the AutoDevops pipelines, automatically testing the changes and staging them on an Acquia CDE.

  • Click the `view app` button in the Merge Request to view the CDE on Acquia Cloud. This gives you the ability to test the update prior to merging the changes.

  • Once the build finishes for the newly merged code, you can use your normal release process to get these changes into production, especially if these are security updates.  

  1. Enable automatic code updates

    Automatic Updates will be automatically enabled by default when you follow the Creating/Configuring a Code Studio (GitLab) project for your Cloud Application instructions. 

    However, you can create additional scheduled pipelines and trigger them on demand by following the instructions below.

  2. Create a new scheduled pipeline

    Just click the `New schedule` button to create a new scheduled job. 

    Image

    Set the frequency to whatever you’d like. Once per week is recommended as Drupal.org security releases come out on the first and third Wednesday of each month. 

    Image

     Make sure to change the Target Branch or Tag to fit your internal workflow.

    Image

     

  3. Test your new scheduled build

    You can test this on-demand automated pipeline by clicking the “play” button

    Image

    This will create new merge requests with the updates.

    Image
  4. Review the Merge Request details

    Looking closer into this merge request, the automated workflow will output the release notes as well as the ability to review the diff.

    Image
    Image

You can see with a couple simple steps, you can set up an automated process that can be easily integrated into your current workflow. To learn more about Code Studio and our Drupal optimized Auto DevOps review the resources below.