feat(action-log): Gate activity reads on backfill completion - #123521
Conversation
|
bugbot review |
There was a problem hiding this comment.
✅ 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.
83f2aea to
66b05db
Compare
| project: Project, | ||
| actor: User | RpcUser | AnonymousUser | None = None, | ||
| ) -> bool: | ||
| """Whether the action log can back this project's Activity-shaped responses.""" |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
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-activityon but an incomplete backfill silently serves a truncated activity feed. This PR addsshould_serve_action_log_activity(project, actor)toissues/derived/gate.py, requiring the read flag andderived_should_be_correct()(write flag + the backfill-completedProjectOption).