Skip to content

Conversation

cmanallen
Copy link
Member

Tracking the date added would be a helpful debugging aid.

@cmanallen cmanallen requested a review from a team as a code owner October 10, 2025 15:47
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 10, 2025
Copy link
Contributor

github-actions bot commented Oct 10, 2025

This PR has a migration; here is the generated SQL for src/sentry/migrations/0997_add_date_added_to_release_project.py

for 0997_add_date_added_to_release_project in sentry

--
-- Custom state/database change combination
--
ALTER TABLE "sentry_release_project" ADD COLUMN "created_at" timestamp with time zone NULL;

project = FlexibleForeignKey("sentry.Project")
release = FlexibleForeignKey("sentry.Release")
new_groups = BoundedPositiveIntegerField(null=True, default=0)
created_at = models.DateTimeField(default=timezone.now, null=True)
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to not use date_added here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Conflicts with existing queries which want me to explicitly label the column's origin. Changing the name is a cheap fix way to fix this.

I'm only adding this because it might help me debug customer issues. It has no purpose otherwise. So changing several sections of the code base isn't particularly exciting prospect for me. I may end up closing this pull because if its more trouble than its worth I can operate on less than complete information.

Copy link
Member

Choose a reason for hiding this comment

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

I don't really understand what you mean here... what code is going to change because you added a new column?

Copy link
Member Author

Choose a reason for hiding this comment

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

We stringly order by COALESCE(date_released, date_added). Where a join to release_project exists the date_added column is ambiguous.

Copy link
Member

Choose a reason for hiding this comment

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

Ahh, got it... that's annoying. Probably this code can be written in a different way using modern Django so that it's not referencing the sql directly. Anyway, not a huge deal if you want to rename it

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good. I don't need this today or even next week. So I may let this pull sit just because.

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.

3 participants