Skip to content

[UPSTREAM CHANGES] latest changes as of Mon Mar 09 2026 00:45:46 GMT+0000 (Coordinated Universal Time) - #219

Open
github-actions[bot] wants to merge 5080 commits into
masterfrom
upstream-changes-2026-03-09
Open

[UPSTREAM CHANGES] latest changes as of Mon Mar 09 2026 00:45:46 GMT+0000 (Coordinated Universal Time)#219
github-actions[bot] wants to merge 5080 commits into
masterfrom
upstream-changes-2026-03-09

Conversation

@github-actions

@github-actions github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown

This PR is auto-generated by
actions/github-script.

bufke and others added 30 commits February 17, 2026 11:56
…cker

DUCKDB_EXTENSION_DIRECTORY defaults to None (not /opt/duckdb/extensions)
so CI and dev environments use DuckDB's default behavior with autoinstall.
Docker image sets it via ENV to use pre-installed extensions with autoinstall
disabled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
load_extension() Python method doesn't trigger autoinstall. SQL LOAD
statement does, so CI environments can download httpfs on first use
while Docker uses pre-installed extensions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Unify retention setting names across the codebase:
- GLITCHTIP_RETENTION_DAYS: master default (falls back to legacy MAX_EVENT_LIFE_DAYS)
- Per-type: EVENT_RETENTION_DAYS, TRANSACTION_RETENTION_DAYS, UPTIME_RETENTION_DAYS, FILE_RETENTION_DAYS, LOG_RETENTION_DAYS
- Hot storage: EVENT_HOT_DAYS, LOG_HOT_DAYS

All old env vars continue to work via fallback chains for backward compatibility.

Also fixes GLITCHTIP_MAX_FILE_LIFE_DAYS bug (was reading wrong env var).

Behavior changes:
- Logs without DuckDB now retain for LOG_RETENTION_DAYS (90d) instead of
  LOGS_HOT_DAYS (7d) — the 7d deletion was HOT_DAYS doing double duty.
- When BILLING_ENABLED, free-tier orgs (no stripe subscription) are skipped
  during cold storage archival, saving DuckDB/parquet work and storage costs.

AI-assisted development (Claude Code)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace glob-based read_parquet('org_N/*.parquet') with per-file
enumeration so a single corrupt file doesn't poison the entire query.

- Add query_cold_parquet_files() helper to glitchtip/cold_storage.py
  that lists files individually, queries each in try/except, logs ERROR
  for corrupt files, and returns the union of successful reads
- Refactor query_cold_storage() (logs) and query_cold_events() (issue
  events) to use the new helper
- Add CorruptParquetTestCase integration test
- Add ColdStorageQueryUnionTestCase and MissingParquetTestCase for logs
  and issue events cold storage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
refactor: rename retention settings + gate free-tier cold storage

See merge request glitchtip/glitchtip-backend!2083
…noise

- assemble_file: skip blobs with None size instead of TypeError
- InternalTransport: log failures as warning (one line) instead of
  exception (full traceback)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Users with S3 configured for static assets now get cold storage
automatically. Files use cold_storage/ prefix to avoid collisions.
Advanced users can still set GLITCHTIP_COLD_STORAGE_BUCKET to
use a separate bucket.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: default cold storage bucket to AWS_STORAGE_BUCKET_NAME

See merge request glitchtip/glitchtip-backend!2084
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
chore(deps): update dependency boto3 to v1.42.51

See merge request glitchtip/glitchtip-backend!2086
chore(deps): update dependency django-allauth to v65.14.3

See merge request glitchtip/glitchtip-backend!2087
chore(deps): update dependency locust to v2.43.3

See merge request glitchtip/glitchtip-backend!2088
chore(deps): update dependency model-bakery to v1.23.3

See merge request glitchtip/glitchtip-backend!2089
add `GLITCHTIP_CHUNK_UPLOAD_USE_RELATIVE_URL` setting to return relative path from sourcemap upload endpoint

See merge request glitchtip/glitchtip-backend!2085
Cold storage previously auto-enabled when AWS_STORAGE_BUCKET_NAME was
set, which would silently start writing Parquet files to existing S3
buckets on upgrade. Require GLITCHTIP_ENABLE_DUCKDB=true for 6.0.x
patch releases; auto-detection can be revisited for a minor release.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The function existed but was never scheduled. Without it, annual plan
orgs never get their virtual monthly cycle rolled forward, causing
stale throttle windows. Move logic to apps/stripe/maintenance.py
(gated behind BILLING_ENABLED) and call from perform_maintenance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add sentry-cli compatible endpoints for release workflows:
- POST/GET deploys for a release (with optional_slash support)
- POST/GET commits for a release (stored in JSONField, capped at 1000)
- Add commit_count to release response
- Fix release files returning size: null

Closes #458, #223, #460

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Delete releases older than GLITCHTIP_RELEASE_RETENTION_DAYS (default 365)
during nightly maintenance. Batched _raw_delete with explicit CASCADE FK
cleanup (Deploy, ReleaseProject). IssueEvent and DebugSymbolBundle refs
are SET_NULL and handled by their own retention.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused ChunkedMiddleware, ContentLengthHeaderMiddleware, and
  UWsgiChunkedInput from glitchtip/middleware.py
- Prefix unused required-by-contract parameters with _ where safe
- Add vulture and coverage as dev dependencies
- Add vulture dead code check to CI lint job (min-confidence 100)
- Add vulture_whitelist.py for known false positives

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
refactor: remove dead code and add vulture CI check

See merge request glitchtip/glitchtip-backend!2092
feat: add deploy/commit APIs and fix release file size

Closes #458, #223, and #460

See merge request glitchtip/glitchtip-backend!2091
chore(deps): update dependency boto3 to v1.42.52

See merge request glitchtip/glitchtip-backend!2093
bufke and others added 30 commits March 6, 2026 08:05
chore(deps): update dependency boto3 to v1.42.62

See merge request glitchtip/glitchtip-backend!2148
- Tighten arro3 dependency pins from >=0.8 to ~=0.8 (compatible release)
- Update settings.py comment: DuckDB controls reads, arro3 handles writes
- Fix _duckdb_type_to_arrow docstring (arro3 is now a hard dependency)
- Log S3 delete failures at debug level instead of silent pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
feat: use arro3 for Parquet writes, keep DuckDB for reads only

See merge request glitchtip/glitchtip-backend!2159
chore: add pre-commit hooks for ruff and vulture

See merge request glitchtip/glitchtip-backend!2158
chore(deps): update dependency vulture to v2.15

See merge request glitchtip/glitchtip-backend!2149
Implement Debug Files list endpoint (GET /projects/{org}/{project}/files/dsyms/)

Closes #459

See merge request glitchtip/glitchtip-backend!2162
chore(deps): update dependency ipython to v9.11.0

See merge request glitchtip/glitchtip-backend!2161
shlex.split() raises ValueError when the query contains unmatched
quotes (e.g. searching for "SMTPAuthenticationError: (534, b'5.7.8").
Fall back to str.split() when this happens.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: handle unmatched quotes in issue search query

See merge request glitchtip/glitchtip-backend!2163
Two changes to reduce worker memory during maintenance:

1. rewrite_parquet_excluding_project now uses get_duckdb_read_connection
   (cached per-thread) instead of get_duckdb_connection (fresh per file).
   This eliminates per-file connection overhead and removes the only
   production caller of get_duckdb_connection. DuckDB COPY TO still
   handles the write for this rare operation (project deletion only) —
   bridging DuckDB→arro3 without pyarrow would add complexity for no
   practical benefit.

2. perform_maintenance now runs gc.collect() + malloc_trim(0) at start
   and after every step, reclaiming glibc heap pages accumulated from
   concurrent ingest tasks before memory-intensive archival begins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
chore(deps): update dependency boto3 to v1.42.63

See merge request glitchtip/glitchtip-backend!2166
Passing `datetime.min` (year 0001) to `_uuid7_for_timestamp()` produced
a negative timestamp_ms, causing `UUID(int=...)` to raise ValueError.
This happened in production when `get_latest_issue_event` used
`datetime.min` as the cold storage query start bound.

Clamp timestamp_ms to [0, 2^48-1] so pre-epoch dates produce the
minimum valid UUIDv7 instead of crashing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: clamp UUIDv7 timestamp to valid 48-bit range

See merge request glitchtip/glitchtip-backend!2168
…g partitions

Two fixes for production cold storage issues:

1. get_latest_issue_event now resolves the issue first and filters
   IssueEvent by organization_id, enabling PostgreSQL to prune hash
   sub-partitions. Previously the query joined through
   issue→project→organization→users without ever filtering the
   IssueEvent.organization_id column, forcing PG to lock every
   sub-partition and hitting max_locks_per_transaction.

2. archive_partition_per_org now handles "relation does not exist"
   gracefully when a partition was already dropped (by a prior
   maintenance run or concurrent worker). Logs at info level and
   returns empty instead of raising an error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ption

A failed query in psycopg3 aborts the transaction. Checking pg_tables
first avoids that and is a cleaner pattern than string-matching
exception messages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests were creating IssueEvents without explicitly setting the
organization FK, so baker assigned a random org. Now that
get_latest_issue_event filters by organization_id for partition
pruning, the test data must match production's invariant: an
IssueEvent's organization matches its issue's project's organization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: use cached read connection for parquet rewrites, add malloc_trim

See merge request glitchtip/glitchtip-backend!2165
chore(deps): update dependency google-cloud-logging to v3.14.0

See merge request glitchtip/glitchtip-backend!2167
fix: add organization_id pruning to latest event query, handle missing partitions

See merge request glitchtip/glitchtip-backend!2169
cache_page tries to serialize the entire TemplateResponse object into
Valkey via ormsgpack, which fails with "Type is not msgpack
serializable: TemplateResponse" (django-vcache uses ormsgpack, not
pickle).

Replace with:
- cache_control(public=True, max_age=60) for browser/CDN caching
- Low-level cache.set() on the monitors queryset only (the actual
  expensive part — the StatusPage lookup is a simple PK fetch)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: replace cache_page with selective caching on status page

See merge request glitchtip/glitchtip-backend!2170
A concurrent ingest task can create a ReleaseProject row between
the explicit ReleaseProject delete and the Release delete, causing
an IntegrityError. Catch it and skip the batch — the release will
be cleaned up on the next maintenance run.

Same pattern used in cleanup_old_issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: handle concurrent FK insert during release cleanup

See merge request glitchtip/glitchtip-backend!2171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants