Skip to content

Commit

Permalink
merge base
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Dec 7, 2023
2 parents ad84119 + f2554dc commit d34ab1b
Show file tree
Hide file tree
Showing 417 changed files with 11,257 additions and 2,057 deletions.
39 changes: 32 additions & 7 deletions .github/pr-deploy/hobby.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ spec:
imagePullPolicy: Always
securityContext:
privileged: true
resources:
requests:
cpu: 250m
memory: 500M
ports:
- containerPort: 2375
- containerPort: 80
Expand All @@ -28,23 +32,44 @@ spec:
value: $REGISTRY_URL
- name: DOCKER_TAG
value: $DOCKER_TAG
- name: SUBDOMAIN
value: $HOSTNAME

---
apiVersion: v1
kind: Service
metadata:
name: hobby-service-$HOSTNAME
annotations:
tailscale.com/expose: "true"
tailscale.com/hostname: hobby-$HOSTNAME
tailscale.com/tags: tag:service
finalizers:
- tailscale.com/finalizer
spec:
selector:
app: hobby-$HOSTNAME
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ClusterIP
type: NodePort

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hobby-ingress-$HOSTNAME
annotations:
kubernetes.io/ingress.class: "alb"
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
alb.ingress.kubernetes.io/ssl-redirect: '443'
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-1:169684386827:certificate/698851fd-36de-4d28-8d75-cb75cc7a92f2
external-dns.alpha.kubernetes.io/hostname: $HOSTNAME.dev.posthog.dev
spec:
ingressClassName: alb
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: hobby-service-$HOSTNAME
port:
number: 80
2 changes: 1 addition & 1 deletion .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:
DISABLE_SECURE_SSL_REDIRECT=1
SECURE_COOKIES=0
OPT_OUT_CAPTURE=0
SELF_CAPTURE=0
SELF_CAPTURE=1
E2E_TESTING=1
SKIP_SERVICE_VERSION_REQUIREMENTS=1
EMAIL_HOST=email.test.posthog.net
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
kubectl -n $NAMESPACE delete -f .github/pr-deploy/hobby.yaml || true
kubectl -n $NAMESPACE apply -f .github/pr-deploy/hobby.yaml
echo "url=$NAMESPACE-${HOSTNAME}.hedgehog-kitefin.ts.net" >> $GITHUB_OUTPUT
echo "url=$HOSTNAME.dev.posthog.dev" >> $GITHUB_OUTPUT
- name: update deployment status
uses: bobheadxi/deployments@v1
Expand All @@ -104,5 +104,5 @@ jobs:
status: ${{ job.status }}
env: ${{ steps.deployment.outputs.env }}
ref: ${{ github.head_ref }}
env_url: http://${{ steps.deploy_hobby.outputs.url }}
env_url: https://${{ steps.deploy_hobby.outputs.url }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
2 changes: 1 addition & 1 deletion cypress/e2e/annotations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Annotations', () => {

it('Annotations loaded', () => {
cy.get('h2').should('contain', 'Create your first annotation')
cy.get('[data-attr="product-introduction-docs-link"]').should('contain', 'Learn more about Annotations')
cy.get('[data-attr="product-introduction-docs-link"]').should('contain', 'Learn more')
})

it('Create annotation', () => {
Expand Down
19 changes: 19 additions & 0 deletions cypress/e2e/billingv2.cy.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import * as fflate from 'fflate'

const UNSUBSCRIBE_SURVEY_ID = '018b6e13-590c-0000-decb-c727a2b3f462'

describe('Billing', () => {
beforeEach(() => {
cy.intercept('/api/billing-v2/', { fixture: 'api/billing-v2/billing-v2.json' })

cy.visit('/organization/billing')

cy.intercept('POST', '**/e/?compression=gzip-js*').as('capture')
})

it('Show and submit unsubscribe survey', () => {
Expand All @@ -19,6 +25,19 @@ describe('Billing', () => {
cy.get('[data-attr=unsubscribe-reason-survey-textarea]').type('Product analytics')
cy.contains('.LemonModal .LemonButton', 'Unsubscribe').click()

cy.wait('@capture').then(({ request }) => {
const data = new Uint8Array(request.body)
const decoded = fflate.strFromU8(fflate.decompressSync(data))
const decodedJSON = JSON.parse(decoded)

// These should be a 'survey sent' event somewhere in the decodedJSON
const matchingEvents = decodedJSON.filter((event) => event.event === 'survey sent')
expect(matchingEvents.length).to.equal(1)
const matchingEvent = matchingEvents[0]
expect(matchingEvent.properties.$survey_id).to.equal(UNSUBSCRIBE_SURVEY_ID)
expect(matchingEvent.properties.$survey_response).to.equal('Product analytics')
expect(matchingEvent.properties.$survey_response_1).to.equal('product_analytics')
})
cy.get('.LemonModal').should('not.exist')
cy.wait(['@unsubscribeProductAnalytics'])
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/cohorts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Cohorts', () => {
cy.get('h1').should('contain', 'People')
cy.title().should('equal', 'Cohorts • People • PostHog')
cy.get('h2').should('contain', 'Create your first cohort')
cy.get('[data-attr="product-introduction-docs-link"]').should('contain', 'Learn more about Cohorts')
cy.get('[data-attr="product-introduction-docs-link"]').should('contain', 'Learn more')

// go to create a new cohort
cy.get('[data-attr="new-cohort"]').click()
Expand Down
5 changes: 1 addition & 4 deletions cypress/e2e/early-access-management.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ describe('Early Access Management', () => {
cy.get('h1').should('contain', 'Early Access Management')
cy.title().should('equal', 'Early access features • PostHog')
cy.get('h2').should('contain', 'Create your first feature')
cy.get('[data-attr="product-introduction-docs-link"]').should(
'contain',
'Learn more about Early access features'
)
cy.get('[data-attr="product-introduction-docs-link"]').should('contain', 'Learn more')

// go to create a new feature
cy.get('[data-attr="create-feature"]').click()
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/notebooks.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ describe('Notebooks', () => {
cy.get('.ph-recording.NotebookNode').should('exist')
})

it('Insertion suggestions can be dismissed', () => {
it.skip('Insertion suggestions can be dismissed', () => {
cy.visit(urls.notebook('h11RoiwV'))
cy.get('.node-ph-replay-timestamp').click()
cy.get('.NotebookEditor').type('{enter}')
cy.get('.SessionRecordingPlayer').click()
cy.get('.ProseMirror').type('{enter}')

cy.get('.NotebookRecordingTimestamp.opacity-50').should('exist')

cy.get('.NotebookEditor').type('{esc}')
cy.get('.ProseMirror').type('{esc}')
cy.get('.NotebookRecordingTimestamp.opacity-50').should('not.exist')
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,7 @@
{
"key": "dedicated_support",
"name": "Slack (dedicated channel)",
"description": "Get help firectly from our support team in a dedicated Slack channel shared between you and the PostHog team.",
"description": "Get help directly from our support team in a dedicated Slack channel shared between you and the PostHog team.",
"unit": null,
"limit": null,
"note": "$2k/month spend or above"
Expand Down
4 changes: 2 additions & 2 deletions cypress/fixtures/api/billing-v2/billing-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
{
"key": "dedicated_support",
"name": "Slack (dedicated channel)",
"description": "Get help firectly from our support team in a dedicated Slack channel shared between you and the PostHog team.",
"description": "Get help directly from our support team in a dedicated Slack channel shared between you and the PostHog team.",
"unit": null,
"limit": null,
"note": "$2k/month spend or above"
Expand Down Expand Up @@ -2110,7 +2110,7 @@
{
"key": "dedicated_support",
"name": "Slack (dedicated channel)",
"description": "Get help firectly from our support team in a dedicated Slack channel shared between you and the PostHog team.",
"description": "Get help directly from our support team in a dedicated Slack channel shared between you and the PostHog team.",
"unit": null,
"limit": null,
"note": "$2k/month spend or above"
Expand Down
20 changes: 9 additions & 11 deletions ee/clickhouse/queries/test/test_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
from posthog.models.group.util import create_group
from posthog.models.group_type_mapping import GroupTypeMapping
from posthog.models.person import Person
from posthog.queries.test.test_lifecycle import assertLifecycleResults
from posthog.queries.test.test_lifecycle import TestLifecycleBase
from posthog.queries.trends.trends import Trends
from posthog.test.base import (
APIBaseTest,
ClickhouseTestMixin,
also_test_with_materialized_columns,
snapshot_clickhouse_queries,
)
Expand All @@ -29,7 +27,7 @@ def _create_action(**kwargs):
return action


class TestClickhouseLifecycle(ClickhouseTestMixin, APIBaseTest):
class TestClickhouseLifecycle(TestLifecycleBase):
@snapshot_clickhouse_queries
def test_test_account_filters_with_groups(self):
self.team.test_account_filters = [{"key": "key", "type": "group", "value": "value", "group_type_index": 0}]
Expand Down Expand Up @@ -98,7 +96,7 @@ def test_test_account_filters_with_groups(self):
self.team,
)

assertLifecycleResults(
self.assertLifecycleResults(
result,
[
{"status": "dormant", "data": [0, -1, 0, 0, -1, 0, 0, 0]},
Expand Down Expand Up @@ -139,7 +137,7 @@ def test_lifecycle_edge_cases(self):
self.team,
)

assertLifecycleResults(
self.assertLifecycleResults(
result,
[
{"status": "dormant", "data": [0, 0, 0, -1, 0, 0, -1, 0]},
Expand All @@ -156,7 +154,7 @@ def test_interval_dates_days(self):

result = self._run_lifecycle({"date_from": "-7d", "interval": "day"})

assertLifecycleResults(
self.assertLifecycleResults(
result,
[
{"status": "dormant", "data": [0] * 8},
Expand Down Expand Up @@ -186,7 +184,7 @@ def test_interval_dates_weeks(self):

result = self._run_lifecycle({"date_from": "-30d", "interval": "week"})

assertLifecycleResults(
self.assertLifecycleResults(
result,
[
{"status": "dormant", "data": [0] * 5},
Expand All @@ -207,7 +205,7 @@ def test_interval_dates_months(self):

result = self._run_lifecycle({"date_from": "-90d", "interval": "month"})

assertLifecycleResults(
self.assertLifecycleResults(
result,
[
{"status": "dormant", "data": [0] * 4},
Expand Down Expand Up @@ -235,7 +233,7 @@ def test_lifecycle_hogql_event_properties(self):
],
}
)
assertLifecycleResults(
self.assertLifecycleResults(
result,
[
{"status": "dormant", "data": [0] * 8},
Expand Down Expand Up @@ -263,7 +261,7 @@ def test_lifecycle_hogql_person_properties(self):
}
)

assertLifecycleResults(
self.assertLifecycleResults(
result,
[
{"status": "dormant", "data": [0] * 8},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,12 @@
day_start
UNION ALL SELECT count(*) as total,
toStartOfDay(toTimeZone(toDateTime(timestamp, 'UTC'), 'UTC')) as day_start,
replaceRegexpAll(JSONExtractRaw(properties, '$feature/a-b-test'), '^"|"$', '') as breakdown_value
transform(replaceRegexpAll(JSONExtractRaw(properties, '$feature/a-b-test'), '^"|"$', ''), (['control', 'test', 'ablahebf', '']), (['control', 'test', 'ablahebf', '']), '$$_posthog_breakdown_other_$$') as breakdown_value
FROM events e
WHERE e.team_id = 2
AND event = '$pageview'
AND toTimeZone(timestamp, 'UTC') >= toDateTime('2020-01-01 00:00:00', 'UTC')
AND toTimeZone(timestamp, 'UTC') <= toDateTime('2020-01-06 00:00:00', 'UTC')
AND replaceRegexpAll(JSONExtractRaw(properties, '$feature/a-b-test'), '^"|"$', '') in (['control', 'test', 'ablahebf', ''])
GROUP BY day_start,
breakdown_value))
GROUP BY day_start,
Expand Down
Loading

0 comments on commit d34ab1b

Please sign in to comment.