Repository navigation
feat(cli): bundle and upload jvm sources with hog - #144749
Conversation
🤖 CI report✅ Trunk lane — non-backend lane (
|
| File | Comment lines | Added lines |
|---|---|---|
hog/worker/src/jvm.rs |
28 | 539 |
hog/src/error-tracking/jvm.ts |
15 | 192 |
hog/src/error-tracking/run.ts |
9 | 131 |
hog/worker/src/main.rs |
8 | 27 |
hog/src/commands/error-tracking/error-tracking.test.ts |
3 | 126 |
hog/test/parity/worker-pins.test.ts |
3 | 16 |
hog/src/error-tracking/discover.ts |
2 | 16 |
hog/src/error-tracking/session.ts |
1 | 2 |
This check does not block merging. It updates on every push and clears when the share drops.
✅ Dependency scan — clean, 1 package scanned
GuardDog scans each registry package this pull request adds to a lockfile or a go.mod file. This check is advisory and does not block the merge. Most findings are false positives, so read the rule names before acting.
Scanned 1 package.
afd41bd to
a0fae48
Compare
|
@PostHog/team-mobile-app This PR may need a new production iOS or Android build. See why the check flagged it. Anyone with repository write access, including the PR author, can acknowledge this commit.
|
ec963d0 to
5a9ee97
Compare
|
Risk: Low · 1 low This increment only swaps hog-worker's posthog-symbol-data dependency from an in-repo path to the published "=0.6.0" from crates.io (lock-pinned with a checksum, no dependency-set change) and relaxes the worker-pins test to allow that one crate to be newer than posthog-cli's frozen version. It touches no runtime input, auth, secret or upload logic, and I found no security weakness in it. Sentinel reviewed |
|
@PostHog review --deep |
|
@ablaszkiewicz PostHog Review is reviewing this pull request. |
PostHog Review · Deep · reviewed
|
| Step | Status | Result |
|---|---|---|
| Prepare the diff | done | 10 files, 2 chunks |
| Pick perspectives | done | 3 perspectives |
| Run review passes | done | 17 issues (+2 blind-spot) |
| Merge overlapping findings | done | 19 → 7 |
| Validate findings | done | 1 kept, 6 dismissed |
| Publish | done | 1 posted (view review) |
rafaeelaudibert
left a comment
There was a problem hiding this comment.
Requesting changes just until I can come back to this and make this work for hog only, posthog-cli is frozen now.
I'll fix this as soon as I'm finished with the launch of hog, probably tomorrow.
|
😎 Stack merged successfully - details. |
hog error-tracking bundle writes the Java and Kotlin files of a build into one bundle whose id comes from the files. upload sends it, and process bundles folders of the jvm kind and uploads them in one step. --meta-out writes posthog-meta.properties after a successful upload, and --skip-without-credentials lets build plugins pass without credentials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hog already exits 3 with not_authenticated when it finds no credentials, and removes the old posthog-meta.properties first, so build plugins can treat that exit as a skipped upload without a separate flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- upload refuses unbundled source folders itself, so the shared upload flow needs no flag for it - bundle reuses select's root resolution and the discover walk - hog-worker reads sources with the bounded read from sources.rs and writes the bundle through Container - jvm_read no longer returns a file count nobody reads Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Read a package declaration through comments and line breaks, accept `$` in package names, and let Kotlin block comments nest, so these files get the key cymbal looks up. - Check the file count and the total source size before any file is read, so a source tree too large to bundle fails without its text in memory. - Skip every `src/*Test` source set, which covers the Kotlin Multiplatform `commonTest` and `jvmTest` sets. - Leave posthog-meta.properties in place on a dry run. Unverified: tooling (hogli verify runs hog tests with jest; bun test passes, 1194 tests) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…meta-out - Decode a source file that is not UTF-8, such as Latin-1 Java, with replacement characters instead of leaving it out, so its frames still show code. - Warn when a JVM bundle uploads without --meta-out: the SDK reads the bundle ID and the release ID only from posthog-meta.properties, so nothing would point at the upload. Unverified: tooling (hogli verify runs hog tests with jest; bun test passes) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b50f862 to
fb4b90d
Compare
A source file that is not valid UTF-8 grows when each invalid byte becomes a three-byte replacement character. A file under the 1 MiB limit on disk could therefore go over it in the bundle. Every reader refuses a bundle with a source over that limit, so one such file hid the code of every frame in the app. hog now checks the decoded text against the limit and leaves the file out with the same reason as a file that is too large on disk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@rafaeelaudibert I've tested everything on my end and it looks good - can you remove your "changes requested" marker? |
rafaeelaudibert
left a comment
There was a problem hiding this comment.
Oops, forgot to approve!
Ty aleks
…0.6.0 hog CI and the release build check out only hog/, so hog-worker could not build the crate from rust/common/symbol_data. It now pins 0.6.0 from crates.io. posthog-cli is frozen on 0.5.2, which has no JVM bundles, so worker-pins.test.ts now lets posthog-symbol-data be newer than posthog-cli's version, but never older. The container goldens in hog/worker/src/parity.rs pass on 0.6.0, so the other symbol set types still match posthog-cli byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploy status
This table shows the |
Source code for JVM server exceptions, in release order:
hog error-tracking bundle👈 this PRposthog-meta.propertiescom.posthog.jvm: upload the sources at build timeWhat each step waits for:
posthog-symbol-data0.6.0 release PR.Problem
Changes
hog et bundle <folders>writes Java and Kotlin files into one.jvmbundle, whose ID comes from the files.uploadsends.jvmbundlefiles without a release, andprocessbundlesjvmfolders first.--kind jvmor"kind": "jvm".--meta-outwrites the bundle and release IDs toposthog-meta.propertiesafter the upload.posthog-symbol-data0.6.0. posthog-cli is frozen on 0.5.2, soworker-pins.test.tsnow lets this one crate be newer, never older. The container goldens still pass.Terminal output
A real upload that writes
posthog-meta.propertiesis covered by a test against a fake PostHog, not run against a real one.How did you test this code?
Test rationale: new tests catch a bundle sent with a release, a stale bundle, a meta file left after a failed upload, wrong skip rules, a source that decodes past the size limit, and an unbundled folder upload. Each failed against a broken copy.
Release status
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5
Skills:
/developing-the-cli,/writing-tests,/writing-code-comments,/writing-user-facing-copy,/writing-pr-descriptionsDriver checked: Decided the hog-only move, the separate
bundleanduploadsteps, thebundlename, and thejvmkind forprocess. Not yet checked the diff.Security review: not needed
More context for AI agents
$release_id, so the bundle ID is the sources alone, as in the posthog-cli version.posthog-symbol-data.uploadrecomputes the ID from the bundle contents rather than trusting the file name.jvm_bundleandjvm_read.--skip-without-credentials: plugins treat exit 3 (not_authenticated) as a skipped upload.hog/src/error-tracking/run.ts(the JVM block inuploadFrom),jvmSourceRoots, and the skip rules inhog/src/error-tracking/jvm.ts.🤖 Generated with Claude Code