GitLab: Slack thread continuity for staging/production
Preview deploys reply into a single Slack thread per branch, using SLACK_THREAD_FILE persisted through a per-branch cache (slack-thread-$CI_COMMIT_REF_SLUG). Staging and production deploys post a fresh top-level message every time, so a run of deploys to one environment scatters across the channel instead of threading.
Open questions
- The cache key needs to be stable across branches: staging and production deploy from tags and the default branch, so a branch-scoped key would break the thread. Key by environment name (e.g.
slack-thread-$ENVIRONMENT) instead, and confirm that survives the tag/default-branch mix. - Thread TTL for long-lived environments: preview uses 4 h; decide whether staging/production want a longer window or none.