Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into brett/cyclotron-bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
bretthoerner committed Aug 26, 2024
2 parents 5abc6df + d71d24d commit 6e34326
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/actions/run-backend-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ runs:

- name: Upload updated timing data as artifacts
uses: actions/upload-artifact@v4
if: ${{ inputs.person-on-events != 'true' && inputs.clickhouse-server-image == 'clickhouse/clickhouse-server:23.12.5.81-alpine' }}
if: ${{ inputs.person-on-events != 'true' && inputs.clickhouse-server-image == 'clickhouse/clickhouse-server:23.12.6.19-alpine' }}
with:
name: timing_data-${{ inputs.segment }}-${{ inputs.group }}
path: .test_durations
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-backend-update-test-timing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
group: 1
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }}
python-version: '3.11.9'
clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.5.81-alpine'
clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.6.19-alpine'
segment: 'FOSS'
person-on-events: false

- name: Upload updated timing data as artifacts
uses: actions/upload-artifact@v4
if: ${{ inputs.person-on-events != 'true' && inputs.clickhouse-server-image == 'clickhouse/clickhouse-server:23.12.5.81-alpine' }}
if: ${{ inputs.person-on-events != 'true' && inputs.clickhouse-server-image == 'clickhouse/clickhouse-server:23.12.6.19-alpine' }}
with:
name: timing_data-${{ inputs.segment }}-${{ inputs.group }}
path: .test_durations
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ jobs:
fail-fast: false
matrix:
python-version: ['3.11.9']
clickhouse-server-image: ['clickhouse/clickhouse-server:23.12.5.81-alpine']
clickhouse-server-image: ['clickhouse/clickhouse-server:23.12.6.19-alpine']
segment: ['Core']
person-on-events: [false, true]
# :NOTE: Keep concurrency and groups in sync
Expand All @@ -242,7 +242,7 @@ jobs:
include:
- segment: 'Temporal'
person-on-events: false
clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.5.81-alpine'
clickhouse-server-image: 'clickhouse/clickhouse-server:23.12.6.19-alpine'
python-version: '3.11.9'
concurrency: 1
group: 1
Expand Down Expand Up @@ -313,7 +313,7 @@ jobs:
strategy:
fail-fast: false
matrix:
clickhouse-server-image: ['clickhouse/clickhouse-server:23.12.5.81-alpine']
clickhouse-server-image: ['clickhouse/clickhouse-server:23.12.6.19-alpine']
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ services:
# Note: please keep the default version in sync across
# `posthog` and the `charts-clickhouse` repos
#
image: ${CLICKHOUSE_SERVER_IMAGE:-clickhouse/clickhouse-server:23.12.5.81-alpine}
image: ${CLICKHOUSE_SERVER_IMAGE:-clickhouse/clickhouse-server:23.12.6.19-alpine}
restart: on-failure

zookeeper:
Expand Down
23 changes: 19 additions & 4 deletions frontend/src/lib/lemon-ui/Link/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import './Link.scss'

import clsx from 'clsx'
import { useActions } from 'kea'
import { router } from 'kea-router'
import { isExternalLink } from 'lib/utils'
import { getCurrentTeamId } from 'lib/utils/getAppContext'
Expand Down Expand Up @@ -96,8 +95,6 @@ export const Link: React.FC<LinkProps & React.RefAttributes<HTMLElement>> = Reac
href: typeof to === 'string' ? to : undefined,
})

const { openSidePanel } = useActions(sidePanelStateLogic)

const onClick = (event: React.MouseEvent<HTMLElement>): void => {
if (event.metaKey || event.ctrlKey) {
event.stopPropagation()
Expand All @@ -111,8 +108,26 @@ export const Link: React.FC<LinkProps & React.RefAttributes<HTMLElement>> = Reac
return
}

if (typeof to === 'string' && isPostHogComDocs(to)) {
const mountedSidePanelLogic = sidePanelStateLogic.findMounted()

if (typeof to === 'string' && isPostHogComDocs(to) && mountedSidePanelLogic) {
// TRICKY: We do this instead of hooks as there is some weird cyclic issue in tests
const { sidePanelOpen } = mountedSidePanelLogic.values
const { openSidePanel } = mountedSidePanelLogic.actions

event.preventDefault()

const target = event.currentTarget
const container = document.getElementsByTagName('main')[0]
const topBar = document.getElementsByClassName('TopBar3000')[0]
if (!sidePanelOpen && container.contains(target)) {
setTimeout(() => {
// Little delay to allow the rendering of the side panel
const y = container.scrollTop + target.getBoundingClientRect().top - topBar.clientHeight
container.scrollTo({ top: y })
}, 50)
}

openSidePanel(SidePanelTab.Docs, to)
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ export function HogFunctionConfiguration({ templateId, id }: { templateId?: stri
Hide source code
</LemonButton>
</div>
<span className="text-xs text-muted-alt">
This is the underlying Hog code that will run whenever the
filters match.{' '}
<Link to="https://posthog.com/docs/cdp/destinations#advanced---custom-code">
See the docs
</Link>{' '}
for more info
</span>
<CodeEditorResizeable
language="hog"
value={value ?? ''}
Expand Down
45 changes: 30 additions & 15 deletions frontend/src/scenes/pipeline/hogfunctions/HogFunctionInputs.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { closestCenter, DndContext } from '@dnd-kit/core'
import { arrayMove, SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable'
import { CSS } from '@dnd-kit/utilities'
import { IconGear, IconLock, IconPlus, IconTrash, IconX } from '@posthog/icons'
import { IconGear, IconInfo, IconLock, IconPlus, IconTrash, IconX } from '@posthog/icons'
import {
LemonButton,
LemonCheckbox,
Expand Down Expand Up @@ -344,8 +344,11 @@ export function HogFunctionInputWithSchema({ schema }: HogFunctionInputWithSchem
}
}, [showSource])

const supportsTemplating = ['string', 'json', 'dictionary', 'email'].includes(schema.type)

return (
<div
className="group"
ref={setNodeRef}
// eslint-disable-next-line react/forbid-dom-props
style={{
Expand Down Expand Up @@ -378,20 +381,32 @@ export function HogFunctionInputWithSchema({ schema }: HogFunctionInputWithSchem
</Tooltip>
) : undefined}
</LemonLabel>
{showSource ? (
<>
<LemonTag type="muted" className="font-mono">
inputs.{schema.key}
</LemonTag>
<div className="flex-1" />
<LemonButton
size="small"
noPadding
icon={<IconGear />}
onClick={() => setEditing(true)}
/>
</>
) : null}
{showSource && (
<LemonTag type="muted" className="font-mono">
inputs.{schema.key}
</LemonTag>
)}
<div className="flex-1" />

{supportsTemplating && (
<LemonButton
size="xsmall"
to="https://posthog.com/docs/cdp/destinations#input-formatting"
sideIcon={<IconInfo />}
noPadding
className=" opacity-0 group-hover:opacity-100 p-1 transition-opacity"
>
Supports templating
</LemonButton>
)}
{showSource && (
<LemonButton
size="small"
noPadding
icon={<IconGear />}
onClick={() => setEditing(true)}
/>
)}
</div>
{value?.secret ? (
<div className="border border-dashed rounded p-1 flex gap-2 items-center">
Expand Down
2 changes: 1 addition & 1 deletion posthog/management/commands/backfill_raw_sessions_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
TARGET_TABLE = "raw_sessions"

SETTINGS = {
"max_execution_time": 3600 # 1 hour
"max_execution_time": 7200 # 2 hours
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
THubspotObjectType = Literal["company", "contact", "deal", "ticket", "quote"]


@dlt.source(name="hubspot")
@dlt.source(name="hubspot", max_table_nesting=0)
def hubspot(
api_key: str,
refresh_token: str,
Expand Down
15 changes: 3 additions & 12 deletions posthog/warehouse/api/external_data_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
trigger_external_data_workflow,
unpause_external_data_schedule,
cancel_external_data_workflow,
delete_data_import_folder,
)
from posthog.warehouse.models.external_data_schema import (
filter_mysql_incremental_fields,
Expand Down Expand Up @@ -251,17 +250,9 @@ def resync(self, request: Request, *args: Any, **kwargs: Any):
if latest_running_job and latest_running_job.workflow_id and latest_running_job.status == "Running":
cancel_external_data_workflow(latest_running_job.workflow_id)

all_jobs = ExternalDataJob.objects.filter(
schema_id=instance.pk, team_id=instance.team_id, status="Completed"
).all()

# Unnecessary to iterate for incremental jobs since they'll all by identified by the schema_id. Be over eager just to clear remnants
for job in all_jobs:
try:
delete_data_import_folder(job.folder_path())
except Exception as e:
logger.exception(f"Could not clean up data import folder: {job.folder_path()}", exc_info=e)
pass
source: ExternalDataSource = instance.source
source.job_inputs.update({"reset_pipeline": True})
source.save()

try:
trigger_external_data_workflow(instance)
Expand Down

0 comments on commit 6e34326

Please sign in to comment.