Skip to content

Post live deployment notifications to the "Create/Cut release and deploy" issue instead of the commit-derived issue [1h] #1060

Description

@balagan73

Problem

Currently deployNotify() in robo-components/DeploymentTrait.php (~line 790) determines which GitHub issue to comment on by parsing the deployment commit message (merge-commit or squash-PR patterns) to find an issue number. For live deployments this is the wrong target — live deploys are triggered from a tag push whose commit message doesn't correspond to the originating feature issue. Instead, when deploying to the live Pantheon environment, we want to find the latest open issue titled exactly "Create release and deploy" or "Cut release and deploy" (case-insensitive) and post the deployment comment there.

Agreed design

  1. Add a new protected method deployFindLatestReleaseIssue(string $github_token): ?int in DeploymentTrait.php. It calls GET /repos/{project}/issues?state=open&sort=created&direction=desc&per_page=100 via the existing curl + taskExec pattern already used elsewhere in the file, skips entries that have a pull_request key (the issues endpoint also returns PRs), and returns the first issue whose title (trimmed, lowercased) exactly equals "create release and deploy" or "cut release and deploy". Returns NULL if none found.
  2. In deployNotify(), when $pantheon_environment === 'live', call this new method first. If it returns an issue number, use it as the sole entry in $issue_numbers and skip the commit-message parsing entirely. If it returns NULL, fall through unchanged to the existing commit-message/PR-based logic.
  3. QA and test environments are untouched, keeping today's commit-message-based behavior.
  4. Out of scope: a separate pre-existing bug where deployNotify() reads getenv('GITHUB_COMMIT_MESSAGE') but only TRAVIS_COMMIT_MESSAGE is ever exported by ci-scripts/prepare_deploy.sh — leave that as-is, do not fix here.

No changes needed to .github/workflows/deploy.yml or ci-scripts/*.sh; this is a self-contained change to robo-components/DeploymentTrait.php.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions