Skip to content

feat(action-log): Gate activity reads on backfill completion - #123521

Open
shashjar wants to merge 1 commit into
shashjar/serialize-comments-by-their-Activity-idfrom
shashjar/gate-activity-reads-from-action-log-on-backfill-completion
Open

feat(action-log): Gate activity reads on backfill completion#123521
shashjar wants to merge 1 commit into
shashjar/serialize-comments-by-their-Activity-idfrom
shashjar/gate-activity-reads-from-action-log-on-backfill-completion

Conversation

@shashjar

@shashjar shashjar commented Sep 2, 2026

Copy link
Copy Markdown
Member

Resolves https://linear.app/getsentry/issue/ISWF-3414/gate-gale-activity-reads-on-backfill-completion-not-just-the-feature.

A project with projects:issue-action-log-activity on but an incomplete backfill silently serves a truncated activity feed. This PR adds should_serve_action_log_activity(project, actor) to issues/derived/gate.py, requiring the read flag and derived_should_be_correct() (write flag + the backfill-completed ProjectOption).

@linear-code

linear-code Bot commented Sep 2, 2026

Copy link
Copy Markdown

ISWF-3414

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 2, 2026
@shashjar

shashjar commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

bugbot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 83f2aea. Configure here.

@shashjar
shashjar marked this pull request as ready for review September 2, 2026 23:09
@shashjar
shashjar requested review from a team as code owners September 2, 2026 23:09
@shashjar
shashjar removed request for a team September 2, 2026 23:09
@shashjar
shashjar force-pushed the shashjar/gate-activity-reads-from-action-log-on-backfill-completion branch from 83f2aea to 66b05db Compare September 2, 2026 23:10
project: Project,
actor: User | RpcUser | AnonymousUser | None = None,
) -> bool:
"""Whether the action log can back this project's Activity-shaped responses."""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I spent too long debating can vs should vs must here, and decided nevermind.

return features.has("projects:issue-action-log-write-to-db", project) and is_backfilled(project)


def should_serve_action_log_activity(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not a request for change, but a note: derived_should_be_correct answers "should we expect derived data to be generally accurate", which is derived data specific. This predicate is not derived data specific, but action log specific, and as such this file isn't the most obvious place for it.

I think this is fine, but we may want to revisit later if these don't get deleted in weeks; I don't think we need two gate modules on principle, but conceptually precise things always seem to evolve better, so I thought I should flag.

def test_resolve_in_next_release_activity_from_action_log(self) -> None:
self.create_release(project=self.project, version="test@1.0.0.0")
group = self.create_group(status=GroupStatus.UNRESOLVED)
self.project.update_option(GROUP_ACTION_LOG_BACKFILL_COMPLETED_OPTION, True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

API tests should just mock the gate function and not bother testing the internals. How we gate isn't their business. If we want to test the gate function, we should test it directly.
If mocking that function end up feeling cumbersome, we can expose a "with action_log_activity_enabled_in_test(bool):" helper.

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.

2 participants