Skip to content

Fix Pantheon Review App multidev name truncation mismatch #1046

@mrdavidburns

Description

@mrdavidburns

Problem

The "Deploy Pantheon Review App" GitHub Action fails when the branch/multidev name exceeds Pantheon's 11-character limit for environment names.

Error Example

Notice: ] Created Multidev environment "pr-testdepl"
Error: ]  Could not find an environment identified by pr-testdeploy. 
Failed to execute command `terminus env:clone-content ***.live pr-testdeploy --yes`: exit status 1
Pantheon puts an 11 character limit on env names. Your name has been truncated to: pr-testdepl
Error: Process completed with exit code 1.

Root Cause

The workflow in scaffold/github/actions/pantheon/review/action.yml uses pr-$DRAINPIPE_PR_NUMBER as both:

  • The multidev environment name (created via terminus multidev:create)
  • The git branch name to push code to

When PR numbers have many digits (e.g., PR #testdeploy or PR #12345678), the resulting name exceeds 11 characters. Pantheon automatically truncates the multidev environment name to 11 characters, but subsequent commands still reference the untruncated name, causing failures.

Proposed Solution

Standardize on the pr-### naming pattern that's already used in other workflows (see GitLab CI implementation in scaffold/gitlab/PantheonReviewApps.gitlab-ci.yml which uses mr-$CI_MERGE_REQUEST_IID).

Options:

  1. Truncate the PR number in the branch name generation to ensure it fits within the limit
  2. Pre-calculate the truncated name and use it consistently throughout the workflow
  3. Query Pantheon for the actual environment name after creation and use that

The most reliable approach would be to query the created multidev environment name from Pantheon immediately after creation and store it in an environment variable for use in subsequent steps.

Files Affected

  • scaffold/github/actions/pantheon/review/action.yml (lines 105-122 specifically)
    • Line 105-106: Checking if environment exists
    • Line 108: Wiping existing environment
    • Line 110: Creating multidev
    • Line 113: Cloning content
    • Line 121: Setting connection
    • Line 122: Pushing to git branch
    • Line 130: Waiting for workflow
    • Line 132-138: Running updates
    • Line 140: Constructing environment URL
    • Line 143: Locking environment

All references to pr-$DRAINPIPE_PR_NUMBER need to use the truncated name consistently.

Testing

Test with PR numbers that would create names exceeding 11 characters:

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions