Skip to content

Commit

Permalink
override these
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarticus committed Feb 4, 2025
2 parents 843e840 + fd8baf5 commit d73e80c
Show file tree
Hide file tree
Showing 549 changed files with 21,744 additions and 9,478 deletions.
12 changes: 7 additions & 5 deletions .flox/env/direnv-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ else
echo "⏩ direnv hook already present in $config_file"
fi

# Add hook to shell config if not already present
if ! grep -q "warn_timeout" "$HOME/.config/direnv/direnv.toml" 2>/dev/null; then
echo "[global]\nwarn_timeout = 0 # Ignore timeout from this issue: https://github.com/direnv/direnv/issues/1065 - added by PostHog's Flox activation hook (../posthog/.flox/env/manifest.toml)" >> "$HOME/.config/direnv/direnv.toml"
echo "✅ Configured ~/.config/direnv/direnv.toml"
# Ignore direnv timeout warning
direnv_config_file="$HOME/.config/direnv/direnv.toml"
mkdir -p "$(dirname "$direnv_config_file")"
if ! grep -q "warn_timeout" "$direnv_config_file" 2>/dev/null; then
echo -e "[global]\nwarn_timeout = 0 # Ignore timeout from this issue: https://github.com/direnv/direnv/issues/1065 - added by PostHog's Flox activation hook (../posthog/.flox/env/manifest.toml)" >> "$direnv_config_file"
echo "✅ Configured $direnv_config_file"
else
echo "~/.config/direnv/direnv.toml already configured"
echo "$direnv_config_file already configured"
fi

echo "💫 direnv is now active"
Expand Down
2 changes: 1 addition & 1 deletion .flox/env/manifest.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"POSTHOG_SKIP_MIGRATION_CHECKS": "1"
},
"hook": {
"on-activate": "# Guide through installing and configuring direnv if it's not present (optionally)\nif [[ -t 0 ]] && [ ! -d \"$DIRENV_DIR\" ] && [ ! -f \"$FLOX_ENV_CACHE/.hush-direnv\" ]; then\n read -p \"\n👉 Use direnv (https://direnv.net) for automatic activation of this environment by your shell.\n❓ Would you like direnv to be set up now? (y/n, default: y)\" -n 1 -r\n if [[ $REPLY =~ ^[Yy]$ || -z $REPLY ]]; then\n $FLOX_ENV_CACHE/../env/direnv-setup.sh\n else\n echo \"⏭️ Skipping direnv setup. This message will not be shown again, but if you change your mind, just run '.flox/bin/direnv-setup.sh'\"\n touch $FLOX_ENV_CACHE/.hush-direnv\n fi\n echo\nfi\n\n# Set up a Python virtual environment\nexport PYTHON_DIR=\"$FLOX_ENV_CACHE/venv\"\nif [ ! -d \"$PYTHON_DIR\" ]; then\n uv venv \"$PYTHON_DIR\" --allow-existing\nfi\n\necho -e \"Python virtual environment path: \\033[33m.flox/cache/venv\\033[0m\"\necho -e \"Python interpreter path, for your code editor: \\033[33m.flox/cache/venv/bin/python\\033[0m\"\n\nsource \"$PYTHON_DIR/bin/activate\"\n\n# Install Python dependencies (this is practically instant thanks to uv)\nuv pip install -q -r requirements.txt -r requirements-dev.txt\n\n# Install top-level Node dependencies (only if not present all yet, because this takes almost a second even with pnpm)\n# This also sets up pre-commit hooks via Husky\nif [ ! -d \"node_modules\" ]; then\n pnpm install -s\nfi\n\nif [[ -t 0 ]]; then # The block below only runs when in an interactive shell\n # Add required entries to /etc/hosts if not present\n if ! grep -q \"127.0.0.1 kafka clickhouse\" /etc/hosts; then\n echo\n echo \"🚨 Amending /etc/hosts to map hostnames 'kafka' and 'clickhouse' to 127.0.0.1...\"\n echo \"127.0.0.1 kafka clickhouse\" | sudo tee -a /etc/hosts 1> /dev/null\n echo \"✅ /etc/hosts amended\"\n fi\n\n # Print intro message\n echo -e \"\nIT'S DANGEROUS TO GO ALONE! RUN THIS:\n1. \\033[31mbin/migrate\\033[0m - to run all migrations\n2. \\033[32mbin/start\\033[0m - to start the entire stack\n3. \\033[34m./manage.py generate_demo_data\\033[0m - to create a user with demo data\n\"\nfi\n"
"on-activate": "# Guide through installing and configuring direnv if it's not present (optionally)\nif [[ -t 0 ]] && [ ! -d \"$DIRENV_DIR\" ] && [ ! -f \"$FLOX_ENV_CACHE/.hush-direnv\" ]; then\n read -p \"\n👉 Use direnv (https://direnv.net) for automatic activation of this environment by your shell.\n❓ Would you like direnv to be set up now? (y/n, default: y)\" -n 1 -r\n if [[ $REPLY =~ ^[Yy]$ || -z $REPLY ]]; then\n $FLOX_ENV_CACHE/../env/direnv-setup.sh\n else\n echo \"⏭️ Skipping direnv setup. This message will not be shown again, but if you change your mind, just run '.flox/bin/direnv-setup.sh'\"\n touch $FLOX_ENV_CACHE/.hush-direnv\n fi\n echo\nfi\n\n# Set up a Python virtual environment\nexport PYTHON_DIR=\"$FLOX_ENV_CACHE/venv\"\nif [ ! -d \"$PYTHON_DIR\" ]; then\n uv venv \"$PYTHON_DIR\" --allow-existing\nfi\n\necho -e \"Python virtual environment path: \\033[33m.flox/cache/venv\\033[0m\"\necho -e \"Python interpreter path, for your code editor: \\033[33m.flox/cache/venv/bin/python\\033[0m\"\n\nsource \"$PYTHON_DIR/bin/activate\"\n\n# Install Python dependencies (this is practically instant thanks to uv)\nuv pip install -q -r requirements.txt -r requirements-dev.txt\n\n# Install top-level Node dependencies (only if not present all yet, because this takes almost a second even with pnpm)\n# This also sets up pre-commit hooks via Husky\nif [ ! -d \"node_modules\" ]; then\n pnpm install -s\nfi\n\nif [[ -t 0 ]]; then # The block below only runs when in an interactive shell\n # Add required entries to /etc/hosts if not present\n if ! grep -q \"127.0.0.1 kafka clickhouse clickhouse-coordinator\" /etc/hosts; then\n echo\n echo \"🚨 Amending /etc/hosts to map hostnames 'kafka', 'clickhouse' and 'clickhouse-coordinator' to 127.0.0.1...\"\n echo \"127.0.0.1 kafka clickhouse clickhouse-coordinator\" | sudo tee -a /etc/hosts 1> /dev/null\n echo \"✅ /etc/hosts amended\"\n fi\n\n # Print intro message\n echo -e \"\nIT'S DANGEROUS TO GO ALONE! RUN THIS:\n1. \\033[31mbin/migrate\\033[0m - to run all migrations\n2. \\033[32mbin/start\\033[0m - to start the entire stack\n3. \\033[34m./manage.py generate_demo_data\\033[0m - to create a user with demo data\n\"\nfi\n"
},
"profile": {
"bash": " source \"$PYTHON_DIR/bin/activate\"\n",
Expand Down
6 changes: 3 additions & 3 deletions .flox/env/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ fi
if [[ -t 0 ]]; then # The block below only runs when in an interactive shell
# Add required entries to /etc/hosts if not present
if ! grep -q "127.0.0.1 kafka clickhouse" /etc/hosts; then
if ! grep -q "127.0.0.1 kafka clickhouse clickhouse-coordinator" /etc/hosts; then
echo
echo "🚨 Amending /etc/hosts to map hostnames 'kafka' and 'clickhouse' to 127.0.0.1..."
echo "127.0.0.1 kafka clickhouse" | sudo tee -a /etc/hosts 1> /dev/null
echo "🚨 Amending /etc/hosts to map hostnames 'kafka', 'clickhouse' and 'clickhouse-coordinator' to 127.0.0.1..."
echo "127.0.0.1 kafka clickhouse clickhouse-coordinator" | sudo tee -a /etc/hosts 1> /dev/null
echo "✅ /etc/hosts amended"
fi
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
# Job to decide if we should run backend ci
# See https://github.com/dorny/paths-filter#conditional-execution for more details
changes:
runs-on: ubuntu-24.04
runs-on: depot-ubuntu-latest-4
timeout-minutes: 5
name: Determine need to run backend checks
# Set job outputs to values from filter step
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
timeout-minutes: 30

name: Python code quality checks
runs-on: ubuntu-24.04
runs-on: depot-ubuntu-latest-4

steps:
# If this run wasn't initiated by the bot (meaning: snapshot update) and we've determined
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
timeout-minutes: 10

name: Validate Django and CH migrations
runs-on: ubuntu-24.04
runs-on: depot-ubuntu-latest-4

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -228,7 +228,7 @@ jobs:
timeout-minutes: 30

name: Django tests – ${{ matrix.segment }} (persons-on-events ${{ matrix.person-on-events && 'on' || 'off' }}), Py ${{ matrix.python-version }}, ${{ matrix.clickhouse-server-image }} (${{matrix.group}}/${{ matrix.concurrency }})
runs-on: ubuntu-24.04
runs-on: depot-ubuntu-latest-4

strategy:
fail-fast: false
Expand Down Expand Up @@ -328,7 +328,7 @@ jobs:
matrix:
clickhouse-server-image: ['clickhouse/clickhouse-server:24.8.7.41']
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-24.04
runs-on: depot-ubuntu-latest-4
steps:
- name: 'Checkout repo'
uses: actions/checkout@v3
Expand Down Expand Up @@ -382,7 +382,7 @@ jobs:
calculate-running-time:
name: Calculate running time
needs: [django, async-migrations]
runs-on: ubuntu-24.04
runs-on: depot-ubuntu-latest-4
if: # Run on pull requests to PostHog/posthog + on PostHog/posthog outside of PRs - but never on forks
needs.changes.outputs.backend == 'true' &&
(
Expand Down Expand Up @@ -416,4 +416,4 @@ jobs:
with:
posthog-token: ${{secrets.POSTHOG_API_TOKEN}}
event: 'posthog-ci-running-time'
properties: '{"duration_seconds": ${{ env.running_time_duration_seconds }}, "run_url": "${{ env.running_time_run_url }}", "run_attempt": "${{ env.running_time_run_attempt }}", "run_id": "${{ env.running_time_run_id }}", "run_started_at": "${{ env.running_time_run_started_at }}"}'
properties: '{"runner": "depot","duration_seconds": ${{ env.running_time_duration_seconds }}, "run_url": "${{ env.running_time_run_url }}", "run_attempt": "${{ env.running_time_run_attempt }}", "run_id": "${{ env.running_time_run_id }}", "run_started_at": "${{ env.running_time_run_started_at }}"}'
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@
"OBJECT_STORAGE_ENABLED": "True",
"HOG_HOOK_URL": "http://localhost:3300/hoghook",
"PLUGIN_SERVER_MODE": "all-v2",
"HOG_TRANSFORMATIONS_ENABLED": "True"
"HOG_TRANSFORMATIONS_ENABLED": "True",
"HOG_TRANSFORMATIONS_COMPARISON_PERCENTAGE": "1"
},
"presentation": {
"group": "main"
Expand Down
Loading

0 comments on commit d73e80c

Please sign in to comment.