Skip to content

Commit

Permalink
Merge branch 'master' into fix/remove-gl-from-sr-onb
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed May 22, 2024
2 parents 3dda142 + 90155c4 commit 75e4753
Show file tree
Hide file tree
Showing 372 changed files with 9,160 additions and 4,533 deletions.
4 changes: 1 addition & 3 deletions .github/actions/run-backend-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ runs:
sudo apt-get update && sudo apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.x.x
uses: pnpm/action-setup@v4

- name: Set up Node.js
uses: actions/setup-node@v3
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ jobs:

- name: Install pnpm
if: needs.changes.outputs.shouldTriggerCypress == 'true'
uses: pnpm/action-setup@v2
with:
version: 8.x.x
uses: pnpm/action-setup@v4

- name: Set up Node.js
if: needs.changes.outputs.shouldTriggerCypress == 'true'
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ jobs:

- name: Install pnpm
if: needs.changes.outputs.frontend == 'true'
uses: pnpm/action-setup@v2
with:
version: 8.x.x
uses: pnpm/action-setup@v4

- name: Set up Node.js
if: needs.changes.outputs.frontend == 'true'
Expand Down Expand Up @@ -142,9 +140,7 @@ jobs:

- name: Install pnpm
if: needs.changes.outputs.frontend == 'true'
uses: pnpm/action-setup@v2
with:
version: 8.x.x
uses: pnpm/action-setup@v4

- name: Set up Node.js
if: needs.changes.outputs.frontend == 'true'
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/ci-plugin-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ jobs:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.x.x
uses: pnpm/action-setup@v4

- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -139,9 +137,7 @@ jobs:
- name: Install pnpm
if: needs.changes.outputs.plugin-server == 'true'
uses: pnpm/action-setup@v2
with:
version: 8.x.x
uses: pnpm/action-setup@v4

- name: Set up Node.js
if: needs.changes.outputs.plugin-server == 'true'
Expand Down Expand Up @@ -230,9 +226,7 @@ jobs:
uv pip install --system -r requirements.txt
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.x.x
uses: pnpm/action-setup@v4

- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/container-images-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,26 @@ jobs:
"context": ${{ toJson(github) }}
}
- name: Check for changes that affect general purpose temporal worker
id: check_changes_general_purpose_temporal_worker
run: |
echo "changed=$((git diff --name-only HEAD^ HEAD | grep -qE '^posthog/temporal/common|^posthog/temporal/proxy_service|^posthog/management/commands/start_temporal_worker.py$' && echo true) || echo false)" >> $GITHUB_OUTPUT
- name: Trigger General Purpose Temporal Worker Cloud deployment
if: steps.check_changes_general_purpose_temporal_worker.outputs.changed == 'true'
uses: mvasigh/dispatch-action@main
with:
token: ${{ steps.deployer.outputs.token }}
repo: charts
owner: PostHog
event_type: temporal_worker_deploy
message: |
{
"image_tag": "${{ steps.build.outputs.digest }}",
"worker_name": "temporal-worker-general-purpose",
"context": ${{ toJson(github) }}
}
- name: Check for changes that affect data warehouse temporal worker
id: check_changes_data_warehouse_temporal_worker
run: |
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/storybook-chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ jobs:
fetch-depth: 0 # 👈 Required to retrieve git history (https://www.chromatic.com/docs/github-actions)

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.x.x
uses: pnpm/action-setup@v4

- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -107,9 +105,7 @@ jobs:
token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN || github.token }}

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.x.x
uses: pnpm/action-setup@v4

- name: Set up Node.js
uses: buildjet/setup-node@v3
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/storybook-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ jobs:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.x.x
uses: pnpm/action-setup@v4

- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/actions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const createAction = (actionName: string): void => {
cy.get('input[name="item-name-large"]').should('exist')

cy.get('input[name="item-name-large"]').type(actionName)
cy.get('.LemonSegmentedButton > ul > :nth-child(2)').click() // Click "Pageview"
cy.get('[data-attr=action-type-pageview]').click() // Click "Pageview"
cy.get('[data-attr=edit-action-url-input]').click().type(Cypress.config().baseUrl)

cy.get('[data-attr=save-action-button]').first().click()
Expand Down
8 changes: 6 additions & 2 deletions cypress/e2e/experiments.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,15 @@ describe('Experiments', () => {
cy.get('[data-attr="lemon-calendar-month-previous"]').first().click()
cy.get('[data-attr="lemon-calendar-day"]').first().click()
cy.get('[data-attr="lemon-calendar-select-apply"]').first().click()
cy.get('[data-attr="experiment-start-date"]').contains('month ago').should('be.visible')
cy.get('[data-attr="experiment-start-date"]')
.contains(/months? ago/)
.should('be.visible')

cy.reload()

// Check that the start date persists
cy.get('[data-attr="experiment-start-date"]').contains('month ago').should('be.visible')
cy.get('[data-attr="experiment-start-date"]')
.contains(/months? ago/)
.should('be.visible')
})
})
1 change: 0 additions & 1 deletion cypress/fixtures/api/experiments/user.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"distinct_id": "kOyAmTq2McfCD5XvqwjKf8m6GVecm9uN0L0ypEoRN50",
"first_name": "Jane",
"email": "[email protected]",
"email_opt_in": true,
"anonymize_data": false,
"toolbar_mode": "toolbar",
"has_password": true,
Expand Down
1 change: 0 additions & 1 deletion cypress/fixtures/api/user-enterprise.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"distinct_id": "kOyAmTq2McfCD5XvqwjKf8m6GVecm9uN0L0ypEoRN50",
"first_name": "Jane",
"email": "[email protected]",
"email_opt_in": true,
"anonymize_data": false,
"toolbar_mode": "toolbar",
"has_password": true,
Expand Down
1 change: 0 additions & 1 deletion cypress/fixtures/api/users/@me.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"distinct_id": "kOyAmTq2McfCD5XvqwjKf8m6GVecm9uN0L0ypEoRN50",
"first_name": "Jane",
"email": "[email protected]",
"email_opt_in": true,
"anonymize_data": false,
"toolbar_mode": "toolbar",
"has_password": true,
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ services:
worker: &worker
command: ./bin/docker-worker-celery --with-scheduler
restart: on-failure
environment:
environment: &worker_env
DISABLE_SECURE_SSL_REDIRECT: 'true'
IS_BEHIND_PROXY: 'true'
DATABASE_URL: 'postgres://posthog:posthog@db:5432/posthog'
Expand Down Expand Up @@ -133,6 +133,7 @@ services:
deploy:
replicas: 0
environment:
<<: *worker_env
SKIP_ASYNC_MIGRATIONS_SETUP: 0
# Temporal containers
Expand Down Expand Up @@ -193,4 +194,5 @@ services:
command: ./bin/temporal-django-worker
restart: on-failure
environment:
<<: *worker_env
TEMPORAL_HOST: temporal
4 changes: 4 additions & 0 deletions docker-compose.hobby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ services:
- '443:443'
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy-data:/data
- caddy-config:/config
depends_on:
- web
objectstorage:
Expand Down Expand Up @@ -191,3 +193,5 @@ volumes:
objectstorage:
postgres-data:
clickhouse-data:
caddy-data:
caddy-config:
29 changes: 25 additions & 4 deletions docker/clickhouse/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
[1]:
https://github.com/pocoproject/poco/blob/poco-1.9.4-release/Foundation/include/Poco/Logger.h#L105-L114
-->
<level>trace</level>
<level>error</level>
<log>/var/log/clickhouse-server/clickhouse-server.log</log>
<errorlog>/var/log/clickhouse-server/clickhouse-server.err.log</errorlog>
<!-- Rotation policy
Expand Down Expand Up @@ -878,17 +878,29 @@

<!-- Interval of flushing data. -->
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<!-- Maximal size in lines for the logs. When non-flushed logs amount reaches max_size, logs dumped to the disk. -->
<max_size_rows>1048576</max_size_rows>
<!-- Pre-allocated size in lines for the logs. -->
<reserved_size_rows>8192</reserved_size_rows>
<!-- Lines amount threshold, reaching it launches flushing logs to the disk in background. -->
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<!-- Indication whether logs should be dumped to the disk in case of a crash -->
<flush_on_crash>false</flush_on_crash>

<!-- example of using a different storage policy for a system table -->
<!-- storage_policy>local_ssd</storage_policy -->
</query_log>

<!-- Trace log. Stores stack traces collected by query profilers.
See query_profiler_real_time_period_ns and query_profiler_cpu_time_period_ns settings. -->
See query_profiler_real_time_period_ns and query_profiler_cpu_time_period_ns settings.
<trace_log>
<database>system</database>
<table>trace_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</trace_log>
-->

<!-- Query thread log. Has information about all threads participated in query execution.
Used only for queries with setting log_query_threads = 1. -->
Expand All @@ -897,6 +909,10 @@
<table>query_thread_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
<max_size_rows>1048576</max_size_rows>
<reserved_size_rows>8192</reserved_size_rows>
<buffer_size_rows_flush_threshold>524288</buffer_size_rows_flush_threshold>
<flush_on_crash>false</flush_on_crash>
</query_thread_log>

<!-- Query views log. Has information about all dependent views associated with a query.
Expand All @@ -910,13 +926,14 @@

<!-- Uncomment if use part log.
Part log contains information about all actions with parts in MergeTree tables (creation, deletion,
merges, downloads).-->
merges, downloads).
<part_log>
<database>system</database>
<table>part_log</table>
<partition_by>toYYYYMM(event_date)</partition_by>
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
</part_log>
-->

<!-- Uncomment to write text log into table.
Text log contains all information from usual server log but stores it in structured and efficient
Expand Down Expand Up @@ -987,6 +1004,10 @@

<partition_by />
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
<max_size_rows>1024</max_size_rows>
<reserved_size_rows>1024</reserved_size_rows>
<buffer_size_rows_flush_threshold>512</buffer_size_rows_flush_threshold>
<flush_on_crash>true</flush_on_crash>
</crash_log>

<!-- Session log. Stores user log in (successful or not) and log out events. -->
Expand Down Expand Up @@ -1267,4 +1288,4 @@
</tables>
</rocksdb>
-->
</yandex>
</yandex>
2 changes: 1 addition & 1 deletion ee/api/dashboard_collaborator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Meta:
"updated_at",
"user_uuid", # write_only (see above)
]
read_only_fields = ["id", "dashboard_id", "user", "user"]
read_only_fields = ["id", "dashboard_id", "user"]

def validate(self, attrs: dict[str, Any]) -> dict[str, Any]:
dashboard: Dashboard = self.context["dashboard"]
Expand Down
10 changes: 6 additions & 4 deletions ee/api/test/__snapshots__/test_organization_resource_access.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
"posthog_user"."is_email_verified",
"posthog_user"."has_seen_product_intro_for",
"posthog_user"."strapi_id",
"posthog_user"."email_opt_in",
"posthog_user"."theme_mode",
"posthog_user"."partial_notification_settings",
"posthog_user"."anonymize_data",
"posthog_user"."toolbar_mode",
"posthog_user"."events_column_config"
"posthog_user"."hedgehog_config",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in"
FROM "posthog_user"
WHERE "posthog_user"."id" = 2
LIMIT 21
Expand Down Expand Up @@ -204,12 +205,13 @@
"posthog_user"."is_email_verified",
"posthog_user"."has_seen_product_intro_for",
"posthog_user"."strapi_id",
"posthog_user"."email_opt_in",
"posthog_user"."theme_mode",
"posthog_user"."partial_notification_settings",
"posthog_user"."anonymize_data",
"posthog_user"."toolbar_mode",
"posthog_user"."events_column_config"
"posthog_user"."hedgehog_config",
"posthog_user"."events_column_config",
"posthog_user"."email_opt_in"
FROM "posthog_user"
WHERE "posthog_user"."id" = 2
LIMIT 21
Expand Down
2 changes: 1 addition & 1 deletion ee/api/test/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def test_cannot_enforce_sso_without_a_license(self, mock_warning):
def test_login_with_sso_resets_session(self):
with self.settings(**GOOGLE_MOCK_SETTINGS):
first_key = self.client.session.session_key
self.client.post("/login/google-oauth2/", {"email_opt_in": False})
self.client.post("/login/google-oauth2/", {})
second_key = self.client.session.session_key
self.assertNotEqual(first_key, second_key)

Expand Down
Loading

0 comments on commit 75e4753

Please sign in to comment.