Skip to content

Conversation

@plopesc
Copy link
Contributor

@plopesc plopesc commented Jun 2, 2025

Drainpipe currently uses Terminus 3.2.1, while the current version is 4.0.1. We should upgrade to the current version. This is a simple change in the following file: scaffold/gitlab/Pantheon.gitlab-ci.yml

The line:
curl -L https://github.com/pantheon-systems/terminus/releases/download/3.2.1/terminus.phar --output ~/terminus/terminus

should be changed to:
curl -L https://github.com/pantheon-systems/terminus/releases/download/4.0.1/terminus.phar --output ~/terminus/terminus

Old version also prevents the Drupal 11 migration since D11 requires PHP 8.3 and Terminus 3.2.1 is not fully compatible with PHP 8.3.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @plopesc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

Gemini-code-assist here to provide a summary of this pull request. The primary goal of this PR, authored by @plopesc, is to upgrade the version of Terminus used within the Drainpipe GitLab CI configuration from 3.2.1 to 4.0.1. This update is necessary because the older version (3.2.1) is not fully compatible with PHP 8.3, which is a requirement for migrating to Drupal 11. The change involves modifying a single line in the .gitlab-ci.yml file to point to the new Terminus release download URL.

Highlights

  • Terminus Version Upgrade: The core change is updating the Terminus CLI tool version used in the GitLab CI pipeline from 3.2.1 to 4.0.1.
  • Enable Drupal 11 Migration: The upgrade is motivated by the need for PHP 8.3 compatibility, which is required for Drupal 11 migrations. Terminus 3.2.1 lacks full support for PHP 8.3.
  • GitLab CI Configuration Change: The update is implemented by changing the download URL for the Terminus PHAR file within the scaffold/gitlab/Pantheon.gitlab-ci.yml file.

Changelog

  • scaffold/gitlab/Pantheon.gitlab-ci.yml
    • Updated the curl command to download Terminus version 4.0.1 instead of 3.2.1 (line 7).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


A version old and slow,
PHP 8.3 says 'No'.
Upgrade the tool,
Follow the rule,
Let Drupal 11 flow.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Thanks for this update! Upgrading Terminus to version 4.0.1 is a good step, especially for ensuring compatibility with newer PHP versions like 8.3 and upcoming Drupal 11 migrations, as you've mentioned.

I have two main points of feedback:

  1. Critical: Consistency with GitHub Actions: I noticed that the Terminus version appears to be hardcoded in another CI configuration file: scaffold/github/actions/pantheon/setup-terminus/action.yml. This file still references Terminus 3.2.1 (line 16). To ensure consistent behavior, achieve the full benefits of this upgrade across all CI/CD systems, and fully support the Drupal 11 migration path which relies on PHP 8.3 compatibility, it's crucial that this GitHub Actions workflow also uses Terminus 4.0.1. Could you please check if this file should also be updated as part of this change?

  2. Security Enhancement (Checksum Verification): The GitLab CI script downloads terminus.phar using curl. It's a security best practice to verify the integrity of downloaded executables using checksums to protect against potential supply chain attacks or corrupted downloads. I've added a specific suggestion to the Pantheon.gitlab-ci.yml file to incorporate this.

Summary of Findings

  • Critical: Inconsistent Terminus Version Across CI Configurations: The Terminus version is updated in scaffold/gitlab/Pantheon.gitlab-ci.yml but remains at 3.2.1 in scaffold/github/actions/pantheon/setup-terminus/action.yml. This inconsistency could lead to different behaviors or prevent the full realization of the upgrade's benefits (e.g., PHP 8.3 compatibility for Drupal 11) if the GitHub Action is used.
  • Security Enhancement: PHAR Checksum Verification: The script downloads terminus.phar without verifying its checksum. Adding a checksum verification step (e.g., using SHA512) would improve security by ensuring the integrity of the downloaded executable.

Merge Readiness

This pull request addresses an important version update for Terminus. However, there is a critical issue regarding the Terminus version consistency with the GitHub Actions configuration (scaffold/github/actions/pantheon/setup-terminus/action.yml), which also needs to be updated to 4.0.1 to align with the goals of this PR (especially for Drupal 11 migration and PHP 8.3 compatibility). Additionally, a high-severity security enhancement for checksum verification of the downloaded PHAR is recommended.

Due to these points, particularly the critical version inconsistency, I recommend that these changes be addressed before merging. I am not authorized to approve pull requests; please ensure that other reviewers assess and approve the changes once they are made.

- echo -e "Host *.drush.in\n StrictHostKeyChecking no\n HostkeyAlgorithms +ssh-rsa\n PubkeyAcceptedAlgorithms +ssh-rsa" >> ~/.ssh/config
- mkdir ~/terminus
- curl -L https://github.com/pantheon-systems/terminus/releases/download/3.2.1/terminus.phar --output ~/terminus/terminus
- curl -L https://github.com/pantheon-systems/terminus/releases/download/4.0.1/terminus.phar --output ~/terminus/terminus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

For enhanced security, it's highly recommended to verify the checksum of the downloaded terminus.phar file before making it executable. This ensures the integrity of the file and protects against accidental corruption or malicious replacement during download.

Pantheon's Terminus releases typically provide a .phar.sha512 file for this purpose.

Could we add steps to download this checksum file and verify the PHAR?

    - echo "Downloading Terminus v4.0.1..."
    - curl --fail --silent --show-error -L https://github.com/pantheon-systems/terminus/releases/download/4.0.1/terminus.phar --output ~/terminus/terminus
    - echo "Downloading SHA512 checksum for Terminus v4.0.1..."
    - curl --fail --silent --show-error -L https://github.com/pantheon-systems/terminus/releases/download/4.0.1/terminus.phar.sha512 --output ~/terminus/terminus.phar.sha512
    - echo "Verifying Terminus checksum..."
    - (cd ~/terminus && sha512sum -c terminus.phar.sha512 && echo "Terminus checksum verification successful.") || (echo "ERROR: Terminus checksum verification FAILED!" >&2 && exit 1)

@deviantintegral
Copy link
Member

@plopesc I think Terminus 4 requires PHP 8.2+, which means we'd need to drop support for that in Drainpipe? Or download the right version based on the current PHP version being used?

@plopesc
Copy link
Contributor Author

plopesc commented Jun 2, 2025

Good point @deviantintegral.

Added logic to use 4.0.1 or 3.3.0 depending on the PHP version

@deviantintegral deviantintegral requested a review from mmenavas June 19, 2025 14:38
echo -e "Host *.drush.in\n StrictHostKeyChecking no\n HostkeyAlgorithms +ssh-rsa\n PubkeyAcceptedAlgorithms +ssh-rsa" >> ~/.ssh/config
mkdir ~/terminus
curl -L https://github.com/pantheon-systems/terminus/releases/download/3.2.1/terminus.phar --output ~/terminus/terminus
if [ "$PHP_MAJOR" -gt 8 ] || { [ "$PHP_MAJOR" -eq 8 ] && [ "$PHP_MINOR" -ge 3 ]; }; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plopesc, where are these $PHP_MAJOR and $PHP_MINOR variables coming from? I can not see them anywhere in the code.

@rabbitlair
Copy link
Contributor

Closing as outdated - current Terminus version installed by Drainpipe is 4.1.1

@rabbitlair rabbitlair closed this Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants