Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(data-exploration): remove data exploration from editor filters #15497

Merged
merged 95 commits into from
May 31, 2023

Conversation

thmsobrmlr
Copy link
Contributor

@thmsobrmlr thmsobrmlr commented May 11, 2023

Problem

The "view source" feature aka data exploration is rolled out to 100% of users, but we still have dead code lying around. See PostHog/meta#84 for an overview of outstanding tasks.

Changes

This PR

  • sets all checks for the feature flag to true, so that self-hosted users won't break
  • removes the legacy variant of the "editor filters" components
  • uses cachedInsight as cachedResults of dataNodeLogic in InsightViz
  • removes <AdHocInsight />
  • removes <InsightQuery />
  • removes <LegacyInsightQuery />

How did you test this code?

  • Verified that /insights/new still works for regular insights, "custom" insights and HogQL insights
  • Verified that saved insights still work for regular insights, "custom" insights and HogQL insights
  • Verified that dashboards still work for regular insights, "custom" insights and HogQL insights
  • Verified exports still work
  • Verified shared insights still work

thmsobrmlr added 30 commits May 11, 2023 14:21
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 0 modified, 0 deleted
  • webkit: 0 added, 0 modified, 0 deleted
  • firefox: 0 added, 1 modified, 0 deleted (diff for shard 2)

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 0 modified, 0 deleted
  • webkit: 0 added, 0 modified, 0 deleted
  • firefox: 0 added, 1 modified, 0 deleted (diff for shard 2)

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 0 modified, 0 deleted
  • webkit: 0 added, 0 modified, 0 deleted
  • firefox: 0 added, 1 modified, 0 deleted (diff for shard 2)

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 0 modified, 0 deleted
  • webkit: 0 added, 0 modified, 0 deleted
  • firefox: 0 added, 1 modified, 0 deleted (diff for shard 2)

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 0 modified, 0 deleted
  • webkit: 0 added, 0 modified, 0 deleted
  • firefox: 0 added, 1 modified, 0 deleted (diff for shard 2)

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

51 snapshot changes in total. 0 added, 51 modified, 0 deleted:

  • chromium: 0 added, 26 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 25 modified, 0 deleted (diff for shard 2)
  • firefox: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Member

@Twixes Twixes left a comment

Choose a reason for hiding this comment

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

Looks good to me, though I'm worried about the skipped tests, as they tend to be left that way for longer than intended most of the time

@@ -325,7 +325,8 @@ describe('Dashboard', () => {
savedInsights.checkInsightIsInListView(insightName)
})

it('can delete dashboard and delete the insights', () => {
// TODO: this test works locally, just not in CI
Copy link
Member

Choose a reason for hiding this comment

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

Experience suggests that, with a comment like this, this will be un-skipped never (± 2 months). 😄

component = (
<DataTable query={query} setQuery={setQuery} context={queryContext} cachedResults={props.cachedResults} />
)
} else if (isDataNode(query)) {
component = <DataNode query={query} cachedResults={props.cachedResults} />
} else if (isInsightVizNode(query)) {
component = <InsightViz query={query} setQuery={setQuery} context={queryContext} />
} else if (isInsightQueryNode(query)) {
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't have legacy in the name, is it right to remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot 👀 ! It should be alright to remove this as it was only used by the "ad hoc" insight and I've checked plugins for usage of these components. Your comment led me to check the /debug page though, where the queries still exist and now I'm wondering wether we want to support rendering all source nodes as well. Will re-add this or remove the examples in a separate PR though.

frontend/src/scenes/insights/insightLogic.ts Show resolved Hide resolved
@thmsobrmlr thmsobrmlr merged commit c704cb1 into master May 31, 2023
@thmsobrmlr thmsobrmlr deleted the thomas/remove-data-exploration-editor-filters branch May 31, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants