feat(gdd): Add GroupDerivedData.generated_at#120166
Open
kcons wants to merge 1 commit into
Open
Conversation
ceorourke
approved these changes
Jul 21, 2026
|
|
||
| # Column-backed features — promoted from JSON for indexing/querying. | ||
|
|
||
| # This is here just for demonstration purposes. |
wedamija
approved these changes
Jul 21, 2026
Contributor
|
This PR has a migration; here is the generated SQL for for --
-- Add field generated_at to groupderiveddata
--
ALTER TABLE "sentry_groupderiveddata" ADD COLUMN "generated_at" timestamp with time zone DEFAULT (STATEMENT_TIMESTAMP()) NOT NULL; |
|
|
||
| # Timestamp of when the generation that produced this state *started* | ||
| # processing. Defaults to row creation time. | ||
| generated_at = models.DateTimeField(default=timezone.now, db_default=models.functions.Now()) |
Contributor
There was a problem hiding this comment.
models.functions.Now() raises AttributeError on module import
models.functions.Now() fails because django.db.models does not expose functions; every other db_default=Now() usage in the codebase explicitly imports Now from django.db.models.functions.
Evidence
modelsis bound todjango.db.models(line 4:from django.db import models).django.db.modelsdoes not re-export thefunctionssubmodule, somodels.functionsraisesAttributeErrorat class definition time.- Every other
db_default=Now()usage in Sentry uses an explicitfrom django.db.models.functions import Nowimport (e.g.,groupactionlogentry.py,authidentityreplica.py,outbox.py). - Django's own migration autogenerator also emits
import django.db.models.functions.datetimerather thanmodels.functions.Now().
Identified by Warden sentry-backend-bugs · XYU-67D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Knowing when GroupDerivedData generation began allows to roughly track what log entries it had access to, and this in turn allows us to know if an incremental update is unsafe because it is based on an earlier regeneration run.
The plan is to use this for safe in-place regeneration.