Skip to content

fix(releases): Prevent false positive regressions when follows_semver flips after resolution#111584

Merged
rodolfoBee merged 1 commit intomasterfrom
shashjar/fix-semver-false-positive-regression-resolved-in-comparison
Mar 26, 2026
Merged

fix(releases): Prevent false positive regressions when follows_semver flips after resolution#111584
rodolfoBee merged 1 commit intomasterfrom
shashjar/fix-semver-false-positive-regression-resolved-in-comparison

Conversation

@shashjar
Copy link
Member

Fixes #111393.

When has_resolution() determines that current_release_version is older than the event's release (semver), also check whether the event's release is older than the resolved-in release before declaring regression.

Fixes false positive regressions when follows_semver flips from False to True between resolution time & event arrival time.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 25, 2026
@shashjar shashjar requested review from a team and scttcper March 25, 2026 22:33
@shashjar shashjar marked this pull request as ready for review March 25, 2026 22:33
@shashjar shashjar requested a review from a team as a code owner March 25, 2026 22:33
@shashjar shashjar removed the request for review from a team March 25, 2026 22:33
res_release_raw = parse_release(
res_release_version, json_loads=orjson.loads
).get("version_raw")
return compare_version_relay(res_release_raw, release_raw) == 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: The fallback version comparison == 1 incorrectly excludes cases where the event release is the same as the resolved-in release for in_next_release resolutions.
Severity: MEDIUM

Suggested Fix

Change the comparison at line 147 to return compare_version_relay(res_release_raw, release_raw) >= 0 or != -1. This will correctly handle the case where the event release is equal to the resolved-in release, marking the resolution as valid.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/sentry/models/groupresolution.py#L147

Potential issue: In the fallback logic for `in_next_release` resolutions, the version
comparison `compare_version_relay(res_release_raw, release_raw) == 1` is used. This
check only returns true if the resolved-in release is strictly greater than the event's
release. It incorrectly returns `False` (indicating a regression) when an event's
release version is the same as the release the issue was resolved in. This bug is
triggered when the `current_release_version` is stale, `follows_semver` is true, and the
event release version exactly matches the resolution release version.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is intentional:

  • resolved_in_release > event_release -> NO regression
  • resolved_in_release <= event_release -> regression

Copy link
Member

@scttcper scttcper left a comment

Choose a reason for hiding this comment

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

looks good, i'd probably also tell that user to make sure their releases are all semver if they want our semver features to work

@rodolfoBee rodolfoBee merged commit ba072b5 into master Mar 26, 2026
74 of 76 checks passed
@rodolfoBee rodolfoBee deleted the shashjar/fix-semver-false-positive-regression-resolved-in-comparison branch March 26, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive regressions triggered when resolving issues via release + semver

3 participants