[BUG] Fix Sentry environment detection for develop branch versioning scheme #3540
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Problem
The Sentry workflow was using outdated logic to detect the environment for develop branch releases. Previously, develop branch versions used a
develop-prefix (e.g.,develop-0.10.0), but the current versioning scheme generates versions in the formatX.Y.Z.N-SNAPSHOTwithout any prefix.This caused develop branch builds to be incorrectly classified with the
featureenvironment instead ofdevelopin Sentry.Solution
Updated the environment detection logic in
.github/workflows/sentry.ymlto match the current versioning scheme:Before:
After:
Version Format Support
The workflow now correctly identifies all version formats:
0.9.1production0.9.1-rc1,0.9.1-ra1pre-release0.10.0.5-SNAPSHOTdevelop✅0.10.0.5-SNAPSHOT-DIRTYfeaturefeature-branch-abc123featureTesting
Created and validated a comprehensive test script covering all version format scenarios to ensure the regex patterns work correctly for production, pre-release, develop, and feature environments.
Fixes the issue where develop branch releases were not being properly tracked in Sentry with the correct environment.
Original prompt
Fixes #3539
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.