Skip to content

Commit

Permalink
feat(hogql): remove feature flag (#15936)
Browse files Browse the repository at this point in the history
mariusandra authored Jun 29, 2023
1 parent 055776d commit 7355359
Showing 101 changed files with 1,474 additions and 7,829 deletions.
20 changes: 10 additions & 10 deletions cypress/e2e/events.cy.ts
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ const interceptPropertyDefinitions = (): void => {
}

const selectNewTimestampPropertyFilter = (): void => {
cy.get('[data-attr=new-prop-filter-EventsTable]').click()
cy.get('[data-attr="new-prop-filter-EventPropertyFilters.0"]').click()
cy.get('[data-attr=taxonomic-filter-searchfield]').type('$time')
cy.get('.taxonomic-list-row').should('have.length', 1)
cy.get('[data-attr=prop-filter-event_properties-0]').click({ force: true })
@@ -58,25 +58,25 @@ describe('Events', () => {
})

it('Events loaded', () => {
cy.get('[data-attr=events-table]').should('exist')
cy.get('.DataTable').should('exist')
})

it('Click on an event', () => {
cy.get('[data-attr=events-table] .event-row:nth-child(2) td:first-child').click()
cy.get('.DataTable [data-row-key]:nth-child(2) td:first-child').click()
cy.get('[data-attr=event-details]').should('exist')
})

it('Apply 1 overall filter', () => {
cy.get('[data-attr=new-prop-filter-EventsTable]').click()
cy.get('[data-attr="new-prop-filter-EventPropertyFilters.0"]').click()
cy.get('[data-attr=taxonomic-filter-searchfield]').click()
cy.get('[data-attr=prop-filter-event_properties-0]').click()
cy.get('[data-attr=prop-val] .ant-select-selector').click({ force: true })
cy.get('[data-attr=prop-val-0]').click()
cy.get('[data-attr=events-table]').should('exist')
cy.get('.DataTable').should('exist')
})

it('separates feature flag properties into their own tab', () => {
cy.get('[data-attr=new-prop-filter-EventsTable]').click()
cy.get('[data-attr="new-prop-filter-EventPropertyFilters.0"]').click()
cy.get('[data-attr="taxonomic-tab-event_feature_flags"]').should('contain.text', 'Feature flags: 2').click()
// some virtualized rows remain in the dom, but hidden
cy.get('.taxonomic-list-row:visible').should('have.length', 2)
@@ -91,7 +91,7 @@ describe('Events', () => {
})

it('use less than and greater than with a numeric property', () => {
cy.get('[data-attr=new-prop-filter-EventsTable]').click()
cy.get('[data-attr="new-prop-filter-EventPropertyFilters.0"]').click()
cy.get('[data-attr=taxonomic-filter-searchfield]').type('$browser_version')
cy.get('.taxonomic-list-row').should('have.length', 1).click()

@@ -105,13 +105,13 @@ describe('Events', () => {
cy.get('[data-attr=events-table-column-selector]').click()
cy.get('[data-attr=taxonomic-filter-searchfield]').type('$browser_version')
cy.get('.taxonomic-list-row').should('have.length', 1).click()
cy.get('.column-display-item').should('have.length', 5)
cy.get('.SelectedColumn').should('have.length', 7)
cy.get('[data-attr=column-display-item-remove-icon').last().click()
cy.get('.column-display-item').should('have.length', 4)
cy.get('.SelectedColumn').should('have.length', 6)
})

it('keeps the popop open after selecting an option', () => {
cy.get('[data-attr=new-prop-filter-EventsTable]').click()
cy.get('[data-attr="new-prop-filter-EventPropertyFilters.0"]').click()
cy.get('[data-attr=taxonomic-filter-searchfield]').type('$browser_version')
cy.get('.taxonomic-list-row').should('have.length', 1).click()

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-insights--lifecycle-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-insights--retention-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-insights--stickiness-edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-area-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-bar-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-line-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-number-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-pie-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-table-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--trends-value-edit.png
Binary file modified frontend/__snapshots__/scenes-app-insights--user-paths-edit.png
2 changes: 1 addition & 1 deletion frontend/src/layout/navigation/SideBar/SideBar.tsx
Original file line number Diff line number Diff line change
@@ -206,7 +206,7 @@ function Pages(): JSX.Element {
icon={<IconLive />}
identifier={Scene.Events}
to={urls.events()}
title={featureFlags[FEATURE_FLAGS.HOGQL] ? 'Event Explorer' : 'Live Events'}
title={'Event Explorer'}
/>
<PageButton
icon={<IconUnverifiedEvent />}
6 changes: 2 additions & 4 deletions frontend/src/lib/components/Cards/InsightCard/InsightCard.tsx
Original file line number Diff line number Diff line change
@@ -273,9 +273,7 @@ function InsightCardInternal(
doNotLoad: true,
}

const { timedOutQueryId, erroredQueryId, insightLoading, isUsingDashboardQueries } = useValues(
insightLogic(insightLogicProps)
)
const { timedOutQueryId, erroredQueryId, insightLoading } = useValues(insightLogic(insightLogicProps))
const { isFunnelWithEnoughSteps, hasFunnelResults, areExclusionFiltersValid } = useValues(
funnelDataLogic(insightLogicProps)
)
@@ -352,7 +350,7 @@ function InsightCardInternal(
>
{!!insight.result ? (
<Query query={insight.query} cachedResults={insight.result} readOnly />
) : isUsingDashboardQueries && canMakeQueryAPICalls ? (
) : canMakeQueryAPICalls ? (
<Query query={insight.query} readOnly />
) : (
<QueriesUnsupportedHere />
Original file line number Diff line number Diff line change
@@ -18,10 +18,9 @@ import { mathsLogic } from 'scenes/trends/mathsLogic'
import { UserActivityIndicator } from '../../UserActivityIndicator/UserActivityIndicator'
import { ExportButton } from 'lib/components/ExportButton/ExportButton'
import { CardMeta } from 'lib/components/Cards/CardMeta'
import { DashboardPrivilegeLevel, FEATURE_FLAGS } from 'lib/constants'
import { DashboardPrivilegeLevel } from 'lib/constants'
import { PieChartFilled } from '@ant-design/icons'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { TopHeading } from 'lib/components/Cards/InsightCard/TopHeading'
import { summarizeInsight } from 'scenes/insights/summarizeInsight'
import { InsightCardProps } from './InsightCard'
@@ -77,7 +76,6 @@ export function InsightMeta({
const { cohortsById } = useValues(cohortsModel)
const { nameSortedDashboards } = useValues(dashboardsModel)
const { mathDefinitions } = useValues(mathsLogic)
const { featureFlags } = useValues(featureFlagLogic)

const otherDashboards = nameSortedDashboards.filter((d) => !dashboards?.includes(d.id))
const editable = insight.effective_privilege_level >= DashboardPrivilegeLevel.CanEdit
@@ -89,7 +87,6 @@ export function InsightMeta({
aggregationLabel,
cohortsById,
mathDefinitions,
isUsingDashboardQueries: !!featureFlags[FEATURE_FLAGS.HOGQL],
})

return (
1 change: 0 additions & 1 deletion frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
@@ -136,7 +136,6 @@ export const FEATURE_FLAGS = {
ENABLE_PROMPTS: 'enable-prompts', // owner: @lharries
FEEDBACK_SCENE: 'feedback-scene', // owner: @lharries
RECORDINGS_LIST_V2: 'recordings-list-v2-enabled', // owner: #team-session-recordings
HOGQL: 'hogql', // owner: #team-product-analytics
NOTEBOOKS: 'notebooks', // owner: #team-session-recordings
EARLY_ACCESS_FEATURE: 'early-access-feature', // owner: @EDsCODE
EARLY_ACCESS_FEATURE_SITE_BUTTON: 'early-access-feature-site-button', // owner: @neilkakkar
2 changes: 1 addition & 1 deletion frontend/src/queries/nodes/DataTable/DataTable.tsx
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import { dataNodeLogic, DataNodeLogicProps } from '~/queries/nodes/DataNode/data
import { LemonTable, LemonTableColumn } from 'lib/lemon-ui/LemonTable'
import { EventName } from '~/queries/nodes/EventsNode/EventName'
import { EventPropertyFilters } from '~/queries/nodes/EventsNode/EventPropertyFilters'
import { EventDetails } from 'scenes/events'
import { EventDetails } from 'scenes/events/EventDetails'
import { EventRowActions } from '~/queries/nodes/DataTable/EventRowActions'
import { DataTableExport } from '~/queries/nodes/DataTable/DataTableExport'
import { Reload } from '~/queries/nodes/DataNode/Reload'
44 changes: 13 additions & 31 deletions frontend/src/scenes/actions/Action.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { ActionEdit } from './ActionEdit'
import { useActions, useValues } from 'kea'
import { router } from 'kea-router'
import { EventsTable } from 'scenes/events'
import { urls } from 'scenes/urls'
import { ActionType } from '~/types'
import { Spinner } from 'lib/lemon-ui/Spinner/Spinner'
import { SceneExport } from 'scenes/sceneTypes'
import { actionLogic, ActionLogicProps } from 'scenes/actions/actionLogic'
import { Query } from '~/queries/Query/Query'
import { NodeKind } from '~/queries/schema'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { FEATURE_FLAGS } from 'lib/constants'
import { defaultDataTableColumns } from '~/queries/nodes/DataTable/utils'

export const scene: SceneExport = {
@@ -20,16 +17,11 @@ export const scene: SceneExport = {
}

export function Action({ id }: { id?: ActionType['id'] } = {}): JSX.Element {
const fixedFilters = { action_id: id }

const { push } = useActions(router)

const { action, isComplete } = useValues(actionLogic)
const { loadAction } = useActions(actionLogic)

const { featureFlags } = useValues(featureFlagLogic)
const featureDataExploration = featureFlags[FEATURE_FLAGS.HOGQL]

return (
<>
{(!id || action) && (
@@ -52,29 +44,19 @@ export function Action({ id }: { id?: ActionType['id'] } = {}): JSX.Element {
This is the list of <strong>recent</strong> events that match this action.
</p>
<div className="pt-4 border-t" />
{featureDataExploration ? (
<Query
query={{
kind: NodeKind.DataTableNode,
source: {
kind: NodeKind.EventsQuery,
select: defaultDataTableColumns(NodeKind.EventsQuery),
actionId: id,
},
full: true,
showEventFilter: false,
showPropertyFilter: false,
}}
/>
) : (
<EventsTable
fixedFilters={fixedFilters}
sceneUrl={urls.action(id)}
fetchMonths={3}
pageKey={`action-${id}-${JSON.stringify(fixedFilters)}`}
showEventFilter={false}
/>
)}
<Query
query={{
kind: NodeKind.DataTableNode,
source: {
kind: NodeKind.EventsQuery,
select: defaultDataTableColumns(NodeKind.EventsQuery),
actionId: id,
},
full: true,
showEventFilter: false,
showPropertyFilter: false,
}}
/>
</div>
) : (
<div>
10 changes: 2 additions & 8 deletions frontend/src/scenes/cohorts/CohortEdit.tsx
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import { Field } from 'lib/forms/Field'
import { LemonInput } from 'lib/lemon-ui/LemonInput/LemonInput'
import { LemonSelect } from 'lib/lemon-ui/LemonSelect'
import { COHORT_TYPE_OPTIONS } from 'scenes/cohorts/CohortFilters/constants'
import { CohortTypeEnum, FEATURE_FLAGS } from 'lib/constants'
import { CohortTypeEnum } from 'lib/constants'
import { AvailableFeature } from '~/types'
import { LemonTextArea } from 'lib/lemon-ui/LemonTextArea/LemonTextArea'
import Dragger from 'antd/lib/upload/Dragger'
@@ -20,11 +20,9 @@ import { IconUploadFile } from 'lib/lemon-ui/icons'
import { AndOrFilterSelect } from 'lib/components/PropertyGroupFilters/PropertyGroupFilters'
import { CohortCriteriaGroups } from 'scenes/cohorts/CohortFilters/CohortCriteriaGroups'
import { Spinner } from 'lib/lemon-ui/Spinner/Spinner'
import { Persons } from 'scenes/persons/Persons'
import { LemonLabel } from 'lib/lemon-ui/LemonLabel/LemonLabel'
import { Form } from 'kea-forms'
import { NotFound } from 'lib/components/NotFound'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { Query } from '~/queries/Query/Query'
import { pluralize } from 'lib/utils'

@@ -35,8 +33,6 @@ export function CohortEdit({ id }: CohortLogicProps): JSX.Element {
const { cohort, cohortLoading, cohortMissing, query } = useValues(logic)
const { hasAvailableFeature } = useValues(userLogic)
const isNewCohort = cohort.id === 'new' || cohort.id === undefined
const { featureFlags } = useValues(featureFlagLogic)
const featureDataExploration = featureFlags[FEATURE_FLAGS.HOGQL]

if (cohortMissing) {
return <NotFound object="cohort" />
@@ -214,10 +210,8 @@ export function CohortEdit({ id }: CohortLogicProps): JSX.Element {
We're recalculating who belongs to this cohort. This could take up to a couple of
minutes.
</div>
) : featureDataExploration ? (
<Query query={query} setQuery={setQuery} />
) : (
<Persons cohort={cohort.id} />
<Query query={query} setQuery={setQuery} />
)}
</div>
</>
Original file line number Diff line number Diff line change
@@ -48,7 +48,6 @@ const eventsTabsLogic = kea<eventsTabsLogicType>({
(s) => [s.featureFlags],
(featureFlags): boolean => !!featureFlags[FEATURE_FLAGS.INGESTION_WARNINGS_ENABLED],
],
showDatabaseTab: [(s) => [s.featureFlags], (featureFlags): boolean => !!featureFlags[FEATURE_FLAGS.HOGQL]],
},
actionToUrl: () => ({
setTab: ({ tab }) => tabUrls[tab as DataManagementTab] || urls.events(),
@@ -68,7 +67,7 @@ const eventsTabsLogic = kea<eventsTabsLogicType>({
})

export function DataManagementPageTabs({ tab }: { tab: DataManagementTab }): JSX.Element {
const { showWarningsTab, showDatabaseTab } = useValues(eventsTabsLogic)
const { showWarningsTab } = useValues(eventsTabsLogic)
const { setTab } = useActions(eventsTabsLogic)

return (
@@ -121,7 +120,7 @@ export function DataManagementPageTabs({ tab }: { tab: DataManagementTab }): JSX
label: <span data-attr="data-management-warnings-tab">Ingestion Warnings</span>,
},

showDatabaseTab && {
{
key: DataManagementTab.Database,
label: (
<span data-attr="data-management-database-tab">
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mswDecorator, useFeatureFlags } from '~/mocks/browser'
import { mswDecorator } from '~/mocks/browser'
import { Meta } from '@storybook/react'
import { useAvailableFeatures } from '~/mocks/features'
import { AvailableFeature } from '~/types'
@@ -7,7 +7,6 @@ import { router } from 'kea-router'
import { urls } from 'scenes/urls'
import { App } from 'scenes/App'
import { DatabaseSchemaQueryResponse } from '~/queries/schema'
import { FEATURE_FLAGS } from 'lib/constants'
import { ingestionWarningsResponse } from './ingestion-warnings/__mocks__/ingestion-warnings-response'
import { dayjs } from 'lib/dayjs'

@@ -111,7 +110,6 @@ export default {

export function Database(): JSX.Element {
useAvailableFeatures([AvailableFeature.EXPERIMENTATION])
useFeatureFlags([FEATURE_FLAGS.HOGQL])
useEffect(() => {
router.actions.push(urls.database())
}, [])
42 changes: 12 additions & 30 deletions frontend/src/scenes/data-management/definition/DefinitionView.tsx
Original file line number Diff line number Diff line change
@@ -23,14 +23,11 @@ import {
} from 'lib/components/DefinitionPopover/DefinitionPopoverContents'
import { EventDefinitionProperties } from 'scenes/data-management/events/EventDefinitionProperties'
import { getPropertyLabel } from 'lib/components/PropertyKeyInfo'
import { EventsTable } from 'scenes/events'
import { SpinnerOverlay } from 'lib/lemon-ui/Spinner/Spinner'
import { NotFound } from 'lib/components/NotFound'
import { IconPlayCircle } from 'lib/lemon-ui/icons'
import { combineUrl } from 'kea-router/lib/utils'
import { urls } from 'scenes/urls'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { FEATURE_FLAGS } from 'lib/constants'
import { NodeKind } from '~/queries/schema'
import { Query } from '~/queries/Query/Query'
import { defaultDataTableColumns } from '~/queries/nodes/DataTable/utils'
@@ -56,12 +53,9 @@ export function DefinitionView(props: DefinitionLogicProps = {}): JSX.Element {
mode,
isEvent,
isProperty,
backDetailUrl,
} = useValues(logic)
const { setPageMode, deleteDefinition } = useActions(logic)
const { hasAvailableFeature } = useValues(userLogic)
const { featureFlags } = useValues(featureFlagLogic)
const featureDataExploration = featureFlags[FEATURE_FLAGS.HOGQL]

if (definitionLoading) {
return <SpinnerOverlay sceneLevel />
@@ -251,30 +245,18 @@ export function DefinitionView(props: DefinitionLogicProps = {}): JSX.Element {
This is the list of recent events that match this definition.
</p>
<div className="pt-4 border-t" />
{featureDataExploration ? (
<Query
query={{
kind: NodeKind.DataTableNode,
source: {
kind: NodeKind.EventsQuery,
select: defaultDataTableColumns(NodeKind.EventsQuery),
event: definition.name,
},
full: true,
showEventFilter: false,
}}
/>
) : (
<EventsTable
sceneUrl={backDetailUrl}
pageKey={`definition-page-${definition.id}`}
showEventFilter={false}
fetchMonths={3}
fixedFilters={{
event_filter: definition.name,
}}
/>
)}
<Query
query={{
kind: NodeKind.DataTableNode,
source: {
kind: NodeKind.EventsQuery,
select: defaultDataTableColumns(NodeKind.EventsQuery),
event: definition.name,
},
full: true,
showEventFilter: false,
}}
/>
</div>
</>
)}
Original file line number Diff line number Diff line change
@@ -116,11 +116,6 @@ export const definitionLogic = kea<definitionLogicType>([
isEvent: [() => [router.selectors.location], ({ pathname }) => pathname.startsWith(urls.eventDefinitions())],
isProperty: [(s) => [s.isEvent], (isEvent) => !isEvent],
singular: [(s) => [s.isEvent], (isEvent): string => (isEvent ? 'event' : 'property')],
backDetailUrl: [
(s) => [s.isEvent, s.definition],
(isEvent, definition) =>
isEvent ? urls.eventDefinition(definition.id) : urls.propertyDefinition(definition.id),
],
breadcrumbs: [
(s) => [s.definition, s.isEvent],
(definition, isEvent): Breadcrumb[] => {
Loading

0 comments on commit 7355359

Please sign in to comment.