Skip to content

Commit

Permalink
Merge branch 'master' into dn-feat/improved-inspector-positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin committed Apr 24, 2024
2 parents bc965a2 + a8eccd4 commit d9f2ec8
Show file tree
Hide file tree
Showing 79 changed files with 1,204 additions and 1,064 deletions.
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"--scheduler",
"redbeat.RedBeatScheduler",
"--without-heartbeat",
"--without-gossip",
"--without-mingle",
"--pool=solo",
"-Ofair",
Expand Down
28 changes: 0 additions & 28 deletions bin/build-schema-python.sh

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion bin/start-worker
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trap 'kill $(jobs -p)' EXIT
source ./bin/celery-queues.env

# start celery worker with heartbeat (-B)
SKIP_ASYNC_MIGRATIONS_SETUP=0 CELERY_WORKER_QUEUES=$CELERY_WORKER_QUEUES celery -A posthog worker -B --scheduler redbeat.RedBeatScheduler --without-heartbeat --without-mingle -Ofair -n node@%h &
SKIP_ASYNC_MIGRATIONS_SETUP=0 CELERY_WORKER_QUEUES=$CELERY_WORKER_QUEUES celery -A posthog worker -B --scheduler redbeat.RedBeatScheduler --without-heartbeat --without-mingle --pool=solo -Ofair -n node@%h &

if [[ "$PLUGIN_SERVER_IDLE" != "1" && "$PLUGIN_SERVER_IDLE" != "true" ]]; then
./bin/plugin-server
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ export const SidePanelSupport = (): JSX.Element => {
</Section>
) : null}

{hasAvailableFeature(AvailableFeature.EMAIL_SUPPORT) ? (
{hasAvailableFeature(AvailableFeature.EMAIL_SUPPORT) ||
window.location.href.includes(urls.organizationBilling()) ? (
<>
<Section title="Contact us">
<p>Can't find what you need in the docs?</p>
Expand Down Expand Up @@ -309,7 +310,8 @@ export const SidePanelSupport = (): JSX.Element => {
</ul>
</Section>

{!hasAvailableFeature(AvailableFeature.EMAIL_SUPPORT) ? (
{hasAvailableFeature(AvailableFeature.EMAIL_SUPPORT) ||
window.location.href.includes(urls.organizationBilling()) ? null : (
<Section title="Contact support">
<p>
Due to our large userbase, we're unable to offer email support to organizations
Expand Down Expand Up @@ -355,7 +357,7 @@ export const SidePanelSupport = (): JSX.Element => {
</li>
</ol>
</Section>
) : null}
)}
</>
)}
</div>
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1801,22 +1801,18 @@ const api = {
): Promise<BatchExportConfiguration> {
return await new ApiRequest().batchExport(id).update({ data })
},

async create(data?: Partial<BatchExportConfiguration>): Promise<BatchExportConfiguration> {
return await new ApiRequest().batchExports().create({ data })
},
async delete(id: BatchExportConfiguration['id']): Promise<BatchExportConfiguration> {
return await new ApiRequest().batchExport(id).delete()
},

async pause(id: BatchExportConfiguration['id']): Promise<BatchExportConfiguration> {
return await new ApiRequest().batchExport(id).withAction('pause').create()
},

async unpause(id: BatchExportConfiguration['id']): Promise<BatchExportConfiguration> {
return await new ApiRequest().batchExport(id).withAction('unpause').create()
},

async listRuns(
id: BatchExportConfiguration['id'],
params: Record<string, any> = {}
Expand Down Expand Up @@ -1958,6 +1954,9 @@ const api = {
async reload(schemaId: ExternalDataSourceSchema['id']): Promise<void> {
await new ApiRequest().externalDataSourceSchema(schemaId).withAction('reload').create()
},
async resync(schemaId: ExternalDataSourceSchema['id']): Promise<void> {
await new ApiRequest().externalDataSourceSchema(schemaId).withAction('resync').create()
},
},

dataWarehouseViewLinks: {
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/lib/components/Support/SupportForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { useEffect, useRef } from 'react'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { userLogic } from 'scenes/userLogic'

import { AvailableFeature } from '~/types'

import {
SEVERITY_LEVEL_TO_NAME,
SUPPORT_TICKET_TEMPLATES,
Expand Down Expand Up @@ -56,7 +58,7 @@ export function SupportForm(): JSX.Element | null {
const { setSendSupportRequestValue } = useActions(supportLogic)
const { objectStorageAvailable } = useValues(preflightLogic)
// the support model can be shown when logged out, file upload is not offered to anonymous users
const { user } = useValues(userLogic)
const { user, hasAvailableFeature } = useValues(userLogic)
// only allow authentication issues for logged out users

const dropRef = useRef<HTMLDivElement>(null)
Expand Down Expand Up @@ -129,6 +131,8 @@ export function SupportForm(): JSX.Element | null {
disabledReason={
!user
? 'Please login to your account before opening a ticket unrelated to authentication issues.'
: !hasAvailableFeature(AvailableFeature.EMAIL_SUPPORT)
? 'You can only create billing related issues while viewing the billing page.'
: null
}
fullWidth
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/lib/components/Support/supportLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { uuid } from 'lib/utils'
import posthog from 'posthog-js'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'

import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePanelStateLogic'
Expand Down Expand Up @@ -337,6 +338,11 @@ export const supportLogic = kea<supportLogicType>([
actions.setSidePanelOptions(panelOptions)
}
},
openEmailForm: async () => {
if (window.location.href.includes(urls.organizationBilling())) {
actions.setSendSupportRequestValue('target_area', 'billing')
}
},
openSupportForm: async ({ name, email, kind, target_area, severity_level, message }) => {
let area = target_area ?? getURLPathToTargetArea(window.location.pathname)
if (!userLogic.values.user) {
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/lib/utils/eventUsageLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ export const eventUsageLogic = kea<eventUsageLogicType>([
existingCohort,
newCohort,
}),
reportExperimentInsightLoadFailed: true,
// Definition Popover
reportDataManagementDefinitionHovered: (type: TaxonomicFilterGroupType) => ({ type }),
reportDataManagementDefinitionClickView: (type: TaxonomicFilterGroupType) => ({ type }),
Expand Down Expand Up @@ -1015,6 +1016,9 @@ export const eventUsageLogic = kea<eventUsageLogicType>([
id: newCohort.id,
})
},
reportExperimentInsightLoadFailed: () => {
posthog.capture('experiment load insight failed')
},
reportPropertyGroupFilterAdded: () => {
posthog.capture('property group filter added')
},
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/queries/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,7 @@
"type": "string"
},
"operator": {
"$ref": "#/definitions/PropertyOperator",
"default": "exact"
"$ref": "#/definitions/PropertyOperator"
},
"type": {
"const": "event",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/queries/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export enum NodeKind {
SavedInsightNode = 'SavedInsightNode',
InsightVizNode = 'InsightVizNode',

// New queries, not yet implemented
TrendsQuery = 'TrendsQuery',
FunnelsQuery = 'FunnelsQuery',
RetentionQuery = 'RetentionQuery',
Expand Down
40 changes: 20 additions & 20 deletions frontend/src/scenes/batch_exports/batchExportEditLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { urls } from 'scenes/urls'

import {
BatchExportConfiguration,
BatchExportDestination,
BatchExportDestinationBigQuery,
BatchExportDestinationHTTP,
BatchExportDestinationPostgres,
BatchExportDestinationRedshift,
BatchExportDestinationS3,
BatchExportDestinationSnowflake,
BatchExportService,
BatchExportServiceBigQuery,
BatchExportServiceHTTP,
BatchExportServicePostgres,
BatchExportServiceRedshift,
BatchExportServiceS3,
BatchExportServiceSnowflake,
Breadcrumb,
} from '~/types'

Expand All @@ -29,12 +29,12 @@ export type BatchExportConfigurationForm = Omit<
BatchExportConfiguration,
'id' | 'destination' | 'start_at' | 'end_at'
> &
Partial<BatchExportDestinationPostgres['config']> &
Partial<BatchExportDestinationRedshift['config']> &
Partial<BatchExportDestinationBigQuery['config']> &
Partial<BatchExportDestinationS3['config']> &
Partial<BatchExportDestinationSnowflake['config']> &
Partial<BatchExportDestinationHTTP['config']> & {
Partial<BatchExportServicePostgres['config']> &
Partial<BatchExportServiceRedshift['config']> &
Partial<BatchExportServiceBigQuery['config']> &
Partial<BatchExportServiceS3['config']> &
Partial<BatchExportServiceSnowflake['config']> &
Partial<BatchExportServiceHTTP['config']> & {
destination: 'S3' | 'Snowflake' | 'Postgres' | 'BigQuery' | 'Redshift' | 'HTTP'
start_at: Dayjs | null
end_at: Dayjs | null
Expand Down Expand Up @@ -159,36 +159,36 @@ export const batchExportsEditLogic = kea<batchExportsEditLogicType>([
} as BatchExportConfigurationForm,
errors: (form) => batchExportFormFields(props.id === 'new', form),
submit: async ({ name, destination, interval, start_at, end_at, paused, ...config }) => {
const destinationObject: BatchExportDestination =
const destinationObject: BatchExportService =
destination === 'Postgres'
? ({
type: 'Postgres',
config: config,
} as unknown as BatchExportDestinationPostgres)
} as unknown as BatchExportServicePostgres)
: destination === 'S3'
? ({
type: 'S3',
config: config,
} as unknown as BatchExportDestinationS3)
} as unknown as BatchExportServiceS3)
: destination === 'Redshift'
? ({
type: 'Redshift',
config: config,
} as unknown as BatchExportDestinationRedshift)
} as unknown as BatchExportServiceRedshift)
: destination === 'BigQuery'
? ({
type: 'BigQuery',
config: config,
} as unknown as BatchExportDestinationBigQuery)
} as unknown as BatchExportServiceBigQuery)
: destination === 'HTTP'
? ({
type: 'HTTP',
config: config,
} as unknown as BatchExportDestinationHTTP)
} as unknown as BatchExportServiceHTTP)
: ({
type: 'Snowflake',
config: config,
} as unknown as BatchExportDestinationSnowflake)
} as unknown as BatchExportServiceSnowflake)

const data: Omit<BatchExportConfiguration, 'id' | 'created_at' | 'team_id'> = {
paused,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/scenes/batch_exports/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useValues } from 'kea'
import { userLogic } from 'scenes/userLogic'

import { AvailableFeature, BatchExportConfiguration, BatchExportDestination, BatchExportRun } from '~/types'
import { AvailableFeature, BatchExportConfiguration, BatchExportRun, BatchExportService } from '~/types'

export function intervalToFrequency(interval: BatchExportConfiguration['interval']): string {
return {
Expand All @@ -15,7 +15,7 @@ export function isRunInProgress(run: BatchExportRun): boolean {
return ['Running', 'Starting'].includes(run.status)
}

export function humanizeDestination(destination: BatchExportDestination): string {
export function humanizeDestination(destination: BatchExportService): string {
if (destination.type === 'S3') {
return `s3://${destination.config.bucket_name}/${destination.config.prefix}`
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TZLabel } from '@posthog/apps-common'
import { LemonButton, LemonDialog, LemonSwitch, LemonTable, LemonTag, Link, Spinner } from '@posthog/lemon-ui'
import { LemonButton, LemonDialog, LemonSwitch, LemonTable, LemonTag, Link, Spinner, Tooltip } from '@posthog/lemon-ui'
import { useActions, useValues } from 'kea'
import { PageHeader } from 'lib/components/PageHeader'
import { More } from 'lib/lemon-ui/LemonButton/More'
Expand Down Expand Up @@ -181,7 +181,7 @@ interface SchemaTableProps {
}

const SchemaTable = ({ schemas }: SchemaTableProps): JSX.Element => {
const { updateSchema, reloadSchema } = useActions(dataWarehouseSettingsLogic)
const { updateSchema, reloadSchema, resyncSchema } = useActions(dataWarehouseSettingsLogic)
const { schemaReloadingById } = useValues(dataWarehouseSettingsLogic)

return (
Expand All @@ -192,7 +192,22 @@ const SchemaTable = ({ schemas }: SchemaTableProps): JSX.Element => {
title: 'Schema Name',
key: 'name',
render: function RenderName(_, schema) {
return schema.name
return <span>{schema.name}</span>
},
},
{
title: 'Refresh Type',
key: 'incremental',
render: function RenderIncremental(_, schema) {
return schema.incremental ? (
<Tooltip title="Each run will only pull data that has since been added" placement="top">
<LemonTag type="primary">Incremental</LemonTag>
</Tooltip>
) : (
<Tooltip title="Each run will pull all data from the source" placement="top">
<LemonTag type="default">Full Refresh</LemonTag>
</Tooltip>
)
},
},
{
Expand Down Expand Up @@ -293,6 +308,20 @@ const SchemaTable = ({ schemas }: SchemaTableProps): JSX.Element => {
>
Reload
</LemonButton>
{schema.incremental && (
<Tooltip title="Completely resync incrementally loaded data. Only recommended if there is an issue with data quality in previously imported data">
<LemonButton
type="tertiary"
key={`resync-data-warehouse-schema-${schema.id}`}
onClick={() => {
resyncSchema(schema)
}}
status="danger"
>
Resync
</LemonButton>
</Tooltip>
)}
</>
}
/>
Expand Down
Loading

0 comments on commit d9f2ec8

Please sign in to comment.