Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
|
Size Change: +448 B (0%) Total Size: 123 MB ℹ️ View Unchanged
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR separates “Logs saved views” from the existing “logs-tabbed-view” rollout by introducing a dedicated feature flag and enforcing it consistently across the frontend UI entrypoint and the backend API.
Changes:
- Added
logs-saved-viewsfeature flag to the frontendFEATURE_FLAGSmap. - Introduced a feature-flagged
SavedViewsButtoncomponent and integrated it into both tabbed and non-tabbed Logs scene headers. - Protected the Logs Views API (
LogsViewViewSet) behindPostHogFeatureFlagPermissionand updated tests to account for flag gating.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| products/logs/frontend/components/LogsViews/SavedViewsButton.tsx | New feature-flagged button wrapper that conditionally exposes the saved views modal. |
| products/logs/frontend/LogsScene.tsx | Replaces inline saved-views UI wiring with the new SavedViewsButton in both scene variants. |
| products/logs/backend/views_api.py | Gates the Logs Views ViewSet behind logs-saved-views via PostHogFeatureFlagPermission. |
| products/logs/backend/test/test_views_api.py | Patches feature flag evaluation for tests and adds explicit 403 coverage when disabled. |
| frontend/src/lib/constants.tsx | Registers LOGS_SAVED_VIEWS: 'logs-saved-views' in FEATURE_FLAGS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Prompt To Fix All With AIThis is a comment left during a code review.
Path: products/logs/backend/test/test_views_api.py
Line: 204-207
Comment:
**Prefer a named parameter over `*args` for the injected mock**
`@patch` injects the mock as a positional argument following `self`. Using `*args` to discard it silently makes the intent less obvious and could swallow unexpected extra arguments in the future. A named parameter (even a throwaway one) is clearer:
```suggestion
@patch("posthoganalytics.feature_enabled", return_value=False)
def test_returns_403_when_feature_flag_disabled(self, _mock_feature_enabled):
response = self.client.get(self.base_url)
assert response.status_code == status.HTTP_403_FORBIDDEN
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat(logs): add logs-saved-views feature..." | Re-trigger Greptile |
ac42861 to
f69ca6c
Compare
f69ca6c to
650ac2e
Compare
frankh
approved these changes
Mar 25, 2026
kyleswank
pushed a commit
that referenced
this pull request
Mar 25, 2026
…and frontend (#52232) ## Problem <!-- Who are we building for, what are their needs, why is this important? --> <!-- Does this fix an issue? Uncomment the line below with the issue ID to automatically close it when merged --> <!-- Closes #ISSUE_ID --> Saved views were gated behind the logs-tabbed-view feature flag meaning it couldn't be rolled out seperately. ## Changes Gates the saved views feature behind it's own feature flag so it can be rolled out independently of the tabbed view feature. - adds a feature flag - protects frontend and api with the feature flag <!-- If there are frontend changes, please include screenshots. --> <!-- If a reference design was involved, include a link to the relevant Figma frame! --> ## How did you test this code? - updated unit tests & manual ui testing <!-- Briefly describe the steps you took. --> <!-- Include automated tests if possible, otherwise describe the manual testing routine. --> <!-- If you are an agent writing this, do NOT include manual tasks you have NOT completed. You can clearly outline you're simply an agent and you haven't tested this manually except for code-based unit/integration tests --> 👉 _Stay up-to-date with_ [_PostHog coding conventions_](https://posthog.com/docs/contribute/coding-conventions) _for a smoother review._ ## Publish to changelog? no <!-- Add the `skip-inkeep-docs` label if this PR should not trigger an automatic docs update from the Inkeep agent. --> <!-- ## 🤖 LLM context --> <!-- If an LLM agent co-authored or authored this PR, uncomment this section and leave any relevant context about the session, tools used, link to the session, or anything else that may help reviewers. -->
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.

Problem
Saved views were gated behind the logs-tabbed-view feature flag meaning it couldn't be rolled out seperately.
Changes
Gates the saved views feature behind it's own feature flag so it can be rolled out independently of the tabbed view feature.
How did you test this code?
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Publish to changelog?
no