Skip to content

Conversation

@srest2021
Copy link
Member

@srest2021 srest2021 commented Oct 16, 2025

relates to REPLAY-704
relates to #83696
relates to #68525

Add a new group resolution type in_future_release. Handle resolving in this type, checking for regressions, and clearing expired resolutions on the backend.

This resolution type only applies to semver releases. If we attempt to make a mixed or non-semver comparison, skip and fall back to existing logic.

I still need to add some tests ensuring that the logic stays the same for different packages--since we only care about inferring order from the semver version itself, package shouldn't matter

Next steps: add to frontend

@linear
Copy link

linear bot commented Oct 16, 2025

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 16, 2025
@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 8 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/tasks/clear_expired_resolutions.py 81.08% 7 Missing ⚠️
src/sentry/api/helpers/group_index/update.py 96.15% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #101615      +/-   ##
===========================================
+ Coverage   80.07%    80.98%   +0.91%     
===========================================
  Files        8701      8700       -1     
  Lines      386936    386858      -78     
  Branches    24520     24491      -29     
===========================================
+ Hits       309825    313288    +3463     
+ Misses      76763     73222    -3541     
  Partials      348       348              

Comment on lines 101 to 110
cls.objects.filter(group=group)
.select_related("release")
.values_list(
"type",
"release__id",
"release__version",
"release__date_added",
"current_release_version",
"future_release_version",
)[0]

Choose a reason for hiding this comment

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

High severity vulnerability may affect your project—review required:
Line 101 lists a dependency (django) with a known High severity vulnerability.

ℹ️ Why this matters

Affected versions of Django are vulnerable to Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). SQL injection in Django's ORM column aliases: when using QuerySet.annotate(), QuerySet.alias(), QuerySet.aggregate(), or QuerySet.extra() with dictionary expansion (**kwargs), the dictionary keys are used unescaped as SQL column aliases. On MySQL and MariaDB backends, an attacker who can influence those keys (for example, by passing a crafted dict of annotations) can inject arbitrary SQL into the generated query.

References: GHSA, CVE

To resolve this comment:
Check if you are using Django with MySQL or MariaDB.

  • If you're affected, upgrade this dependency to at least version 5.2.7 at uv.lock.
  • If you're not affected, comment /fp we don't use this [condition]
💬 Ignore this finding

To ignore this, reply with:

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

You can view more details on this finding in the Semgrep AppSec Platform here.

Comment on lines 665 to 667
for i in GroupResolution.objects.filter(group__in=resolved_groups).values_list(
"group", "type", "release__version", "actor_id"
"group", "type", "release__version", "future_release_version", "actor_id"
)

Choose a reason for hiding this comment

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

High severity vulnerability may affect your project—review required:
Line 665 lists a dependency (django) with a known High severity vulnerability.

ℹ️ Why this matters

Affected versions of Django are vulnerable to Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). SQL injection in Django's ORM column aliases: when using QuerySet.annotate(), QuerySet.alias(), QuerySet.aggregate(), or QuerySet.extra() with dictionary expansion (**kwargs), the dictionary keys are used unescaped as SQL column aliases. On MySQL and MariaDB backends, an attacker who can influence those keys (for example, by passing a crafted dict of annotations) can inject arbitrary SQL into the generated query.

References: GHSA, CVE

To resolve this comment:
Check if you are using Django with MySQL or MariaDB.

  • If you're affected, upgrade this dependency to at least version 5.2.7 at uv.lock.
  • If you're not affected, comment /fp we don't use this [condition]
💬 Ignore this finding

To ignore this, reply with:

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

You can view more details on this finding in the Semgrep AppSec Platform here.

if not Release.is_semver_version(resolution.future_release_version):
continue

# If release.version >= future_release_version, clear the resolution
Copy link
Member Author

@srest2021 srest2021 Oct 17, 2025

Choose a reason for hiding this comment

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

We need to parse GroupResolution.in_future_release in order to make the version comparisons. I'm not sure how to make this more efficient (lt/gt probably won't work here, right?). If we just needed to check equality it would be much simpler, but I'm assuming that:

  • We have a group that will be resolved in release 2.0.0
  • We skip over 2.0.0 (never release it) and instead release 2.0.1
  • That group should still be marked as resolved even though 2.0.0 != 2.0.1

@techwmazur
Copy link

Hey it looks like awesome feature.

Would it be possible to add support for a wildcards in the future releases?

In our company the exact release name is not known until is released. Besides known things like the product name and version we're keeping the release date in the name..

The wildcard support would solve the problem for us. E.g if we could specify future release like awesome_game_*12345* that would be just perfect!

@getsantry
Copy link
Contributor

getsantry bot commented Nov 8, 2025

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Nov 8, 2025
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 Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants