Skip to content

Commit 25a52e6

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/android-exception-steps
# Conflicts: # posthog-samples/posthog-android-sample/src/main/AndroidManifest.xml # posthog-samples/posthog-android-sample/src/main/java/com/posthog/android/sample/MyApp.kt # posthog-samples/posthog-android-sample/src/main/java/com/posthog/android/sample/NormalActivity.kt
2 parents 4e06a81 + 24913a3 commit 25a52e6

64 files changed

Lines changed: 3761 additions & 1332 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/hygiene.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"transitiveReExports": {
3-
"posthog": ["posthog-android", "posthog-server"]
3+
"posthog": ["posthog-android", "posthog-server", "posthog-android-surveys-compose"],
4+
"posthog-android": ["posthog-android-surveys-compose"]
45
}
56
}

.github/pull_request_template.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,29 @@
1919
- [ ] Ran `pnpm changeset` to generate a changeset file
2020

2121
<!-- For more details check RELEASING.md -->
22+
23+
## 🤖 Agent context
24+
25+
<!-- Fill this section if an agent co-authored or authored this PR. Remove it for fully human-authored PRs. -->
26+
27+
<!-- Autonomy — keep one of the two options on the line below:
28+
- "Human-driven (agent-assisted)" when a person directed the work — assign that person as the PR assignee (the DRI).
29+
- "Fully autonomous" when no human drove it; leave the PR unassigned for the owning team to triage. -->
30+
31+
**Autonomy:** Human-driven (agent-assisted) — or — Fully autonomous
32+
33+
<!-- Keep this short: 1-3 short paragraphs or a handful of bullets — not an exhaustive log. Include:
34+
- tools/agent used and link to session. List the agent and tool names used, but do not include tool call results.
35+
- decisions made along the way (what was tried, rejected, chosen, and why)
36+
- anything else that helps reviewers
37+
Write reviewer-facing prose. Do not paste user prompts verbatim — paraphrase the intent in your own words.
38+
DO NOT INCLUDE sensitive data that may have been shared in an agent session.
39+
-->
40+
<!-- Rules for agent-authored PRs:
41+
- When a human directed the work, the PR must be attributable to that person, even if agent-assisted.
42+
- If a human directed this work, assign them as the PR assignee (the DRI) — actually set the assignee, don't just name them here. Leave a PR unassigned only when it is fully autonomous with no human driver (set Autonomy to "Fully autonomous").
43+
- Do not add a human Co-authored-by just for the sake of attribution — if no human was involved in the changes, own it as agent-authored.
44+
- Agent-authored PRs always require human review — do not self-merge or auto-approve.
45+
- Do NOT claim manual testing you haven't done.
46+
- GitHub PR descriptions render markdown, not fixed-width text. Do not hard-wrap prose at a column width or use space-aligned tables — use real markdown tables, headings, and fenced code blocks, and let GitHub flow the text.
47+
-->

.github/workflows/build.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,41 @@ on:
44
branches:
55
- main
66
pull_request:
7-
paths-ignore:
8-
- "**/*.md"
97

108
permissions:
119
contents: read
12-
1310
concurrency:
1411
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1512
cancel-in-progress: true
1613

1714
jobs:
15+
detect-markdown-only:
16+
uses: PostHog/.github/.github/workflows/detect-markdown-only.yml@ec25337d9fae0100622cbfea1bd5bd88284ac10b
17+
permissions:
18+
pull-requests: read
19+
1820
build:
21+
needs: detect-markdown-only
1922
name: Build Job
2023
runs-on: ubuntu-latest
2124

2225
steps:
26+
- name: Complete markdown-only PR check
27+
if: needs.detect-markdown-only.outputs.markdown_only == 'true'
28+
run: echo "Only Markdown files changed; no additional work is required for this check."
2329
- name: Git checkout
30+
if: needs.detect-markdown-only.outputs.markdown_only != 'true'
2431
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2532

2633
- name: 'Set up Java 17'
34+
if: needs.detect-markdown-only.outputs.markdown_only != 'true'
2735
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
2836
with:
2937
java-version: '17'
3038
distribution: 'temurin'
3139

3240
- name: Cache Gradle packages
41+
if: needs.detect-markdown-only.outputs.markdown_only != 'true'
3342
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
3443
with:
3544
path: |
@@ -40,7 +49,9 @@ jobs:
4049
${{ runner.os }}-gradle-
4150
4251
- name: Make compile
52+
if: needs.detect-markdown-only.outputs.markdown_only != 'true'
4353
run: make compile
4454

4555
- name: Make stop
56+
if: needs.detect-markdown-only.outputs.markdown_only != 'true'
4657
run: make stop

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ jobs:
2828
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2929

3030
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@87557b9c84dde89fdd9b10e88954ac2f4248e463 # v4.36.1
31+
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
3232
with:
3333
languages: ${{ matrix.language }}
3434
build-mode: ${{ matrix.build-mode }}
3535
queries: security-and-quality
3636

3737
- name: Perform CodeQL Analysis
38-
uses: github/codeql-action/analyze@87557b9c84dde89fdd9b10e88954ac2f4248e463 # v4.36.1
38+
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
3939
with:
4040
category: '/language:${{matrix.language}}'

.github/workflows/gradle-wrapper-validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
18-
- uses: gradle/actions/wrapper-validation@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
18+
- uses: gradle/actions/wrapper-validation@5e2ebd065dc2488b7a6ad670704656cbbe1e8f60 # v6.1.1

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,13 @@ jobs:
104104
# Sync package.json versions back to gradle.properties
105105
CORE_VERSION=$(node -p "require('./posthog/package.json').version")
106106
ANDROID_VERSION=$(node -p "require('./posthog-android/package.json').version")
107+
SURVEYS_COMPOSE_VERSION=$(node -p "require('./posthog-android-surveys-compose/package.json').version")
107108
SERVER_VERSION=$(node -p "require('./posthog-server/package.json').version")
108109
PLUGIN_VERSION=$(node -p "require('./posthog-android-gradle-plugin/package.json').version")
109110
110111
sed -i "s/^coreVersion=.*/coreVersion=$CORE_VERSION/" gradle.properties
111112
sed -i "s/^androidVersion=.*/androidVersion=$ANDROID_VERSION/" gradle.properties
113+
sed -i "s/^surveysComposeVersion=.*/surveysComposeVersion=$SURVEYS_COMPOSE_VERSION/" gradle.properties
112114
sed -i "s/^serverVersion=.*/serverVersion=$SERVER_VERSION/" gradle.properties
113115
sed -i "s/^androidPluginVersion=.*/androidPluginVersion=$PLUGIN_VERSION/" posthog-android-gradle-plugin/gradle.properties
114116
@@ -125,7 +127,7 @@ jobs:
125127
- name: Commit version bump
126128
id: commit-version-bump
127129
if: steps.check-changes.outputs.committed == 'true'
128-
uses: planetscale/ghcommit-action@25309d8005ac7c3bcd61d3fe19b69e0fe47dbdde # v0.2.20
130+
uses: planetscale/ghcommit-action@a6b150b81dca5dd027baa898604418eec9e11465 # v0.2.22
129131
with:
130132
commit_message: "chore: update versions and changelogs [version bump] [skip ci]"
131133
repo: ${{ github.repository }}
@@ -214,6 +216,11 @@ jobs:
214216
make_dry_target: dryReleaseAndroid
215217
make_release_target: releaseAndroid
216218
changelog: posthog-android/CHANGELOG.md
219+
- name: posthog-android-surveys-compose
220+
tag_prefix: surveysCompose
221+
make_dry_target: dryReleaseSurveysCompose
222+
make_release_target: releaseSurveysCompose
223+
changelog: posthog-android-surveys-compose/CHANGELOG.md
217224
- name: posthog-server
218225
tag_prefix: server
219226
make_dry_target: dryReleaseServer

AI_POLICY.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# AI contributions policy
2+
3+
PostHog is built with plenty of AI assistance.
4+
This policy exists because of a growing volume of low-quality, AI-generated contributions that waste maintainer time.
5+
6+
## The standard
7+
8+
**You own what you submit.**
9+
Understand your code, test it, and be ready to explain why it's correct and how it interacts with the rest of the system (without re-prompting an LLM).
10+
This is no different from what we'd expect of any contribution; AI makes it easier to skip the work – please don't skip the work.
11+
12+
**Prove it works.**
13+
Before submitting, please verify the change actually works end-to-end — don't rely on "it compiles" or "tests pass" alone.
14+
15+
Add tests for new behavior, smoke test the change in an example project where applicable, and describe your test strategy in the PR description: what you tested, how you tested it, and what edge cases you considered.
16+
17+
For changes with user-visible UI, include a short demo (screenshot, screen recording, or GIF) of the feature working in the PR description. Ideally you demo more than just the happy path.
18+
19+
PRs that clearly weren't run or tested will be closed under this policy.
20+
21+
**Disclose AI usage.**
22+
Our [PR template](.github/pull_request_template.md) includes an Agent context section — please use it (most agents will pick it up automatically).
23+
If an agent co-authored or authored your PR, say so and leave context about the tools and session.
24+
This helps reviewers calibrate.
25+
26+
**Prefer PRs over AI-generated issues.**
27+
If AI helped you find a bug, fix it and open a pull request — don't paste the AI's output into an issue.
28+
Unreviewed, AI-generated bug reports and security disclosures will be closed without response.
29+
30+
**Don't submit unsolicited AI-generated PR reviews.**
31+
If you didn't write the code and aren't a maintainer, don't point an LLM at someone else's PR and leave its output as a review comment.
32+
This is generally never helpful.
33+
34+
## What happens when contributions don't meet this bar
35+
36+
- **First time:** We'll close the PR/issue with a link to this policy and a brief explanation.
37+
- **Two or more closures:** We'll block the account.
38+
39+
## Why we're not anti-AI
40+
41+
We think the best contributions today often involve AI.
42+
A contributor who uses an LLM to help them understand unfamiliar code, draft a first pass, or catch edge cases they'd miss is probably _more_ productive than someone doing everything by hand.
43+
The key difference is that they're driving the AI, not the other way around.
44+
45+
If you're new to open-source contributing and want to learn, we're genuinely happy to help — open an issue, ask questions, submit small PRs.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ Changelogs can be found in the individual packages:
66

77
- [posthog](./posthog/CHANGELOG.md)
88
- [posthog-android](./posthog-android/CHANGELOG.md)
9+
- [posthog-android-surveys-compose](./posthog-android-surveys-compose/CHANGELOG.md)
910
- [posthog-server](./posthog-server/CHANGELOG.md)
1011
- [posthog-android-gradle-plugin](./posthog-android-gradle-plugin/CHANGELOG.md)

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ dryReleaseCore:
2929
dryReleaseAndroid:
3030
./gradlew :posthog-android:publishToMavenLocal
3131

32+
dryReleaseSurveysCompose:
33+
./gradlew :posthog-android-surveys-compose:publishToMavenLocal
34+
3235
dryReleaseServer:
3336
./gradlew :posthog-server:publishToMavenLocal
3437

@@ -44,6 +47,9 @@ releaseCore:
4447
releaseAndroid:
4548
./gradlew :posthog-android:publishToSonatype closeAndReleaseSonatypeStagingRepository
4649

50+
releaseSurveysCompose:
51+
./gradlew :posthog-android-surveys-compose:publishToSonatype closeAndReleaseSonatypeStagingRepository
52+
4753
releaseServer:
4854
./gradlew :posthog-server:publishToSonatype closeAndReleaseSonatypeStagingRepository
4955

README.md

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,28 @@
33
| Packages | Maven Central | Min Version |
44
|-----------------| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
55
| posthog-android | [![Maven Central](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-android/badge.svg)](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-android) | Android API 21 |
6+
| posthog-android-surveys-compose | [![Maven Central](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-android-surveys-compose/badge.svg)](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-android-surveys-compose) | Android API 23 · `0.x` |
67
| posthog (core) | [![Maven Central](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog/badge.svg)](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog) | Java 8 |
78
| posthog-server | [![Maven Central](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-server/badge.svg)](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-server) | Java 8 |
89
| posthog-android-gradle-plugin | [![Maven Central](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-android-gradle-plugin/badge.svg)](https://maven-badges.herokuapp.com/sonatype-central/com.posthog/posthog-android-gradle-plugin) | Java 8 |
910

10-
# PostHog Android & JVM SDKs
11+
# PostHog Android and JVM SDKs
1112

1213
This repository contains PostHog's Android and JVM SDKs. PostHog is an open source platform for product analytics, feature flags, session replay, and more.
1314

14-
## Packages
15-
16-
### posthog-android
17-
18-
Full-featured Android SDK with automatic screen tracking, session recording, and Android-specific features.
19-
20-
```kotlin
21-
implementation("com.posthog:posthog-android:$latestVersion")
22-
```
23-
24-
**Documentation:** [posthog-android/](./posthog-android/) | **Usage:** [posthog-android/USAGE.md](./posthog-android/USAGE.md)
25-
26-
### posthog (core)
27-
28-
Pure Kotlin/JVM library suitable for environment specific SDK integrations.
29-
30-
```kotlin
31-
implementation("com.posthog:posthog:$latestVersion")
32-
```
33-
34-
**Documentation:** [posthog/](./posthog/) | **Usage:** [posthog/USAGE.md](./posthog/USAGE.md)
35-
36-
### posthog-server
37-
38-
Pure Kotlin/JVM library suitable for server integrations.
39-
40-
```kotlin
41-
implementation("com.posthog:posthog-server:$latestVersion")
42-
```
43-
44-
**Documentation:** [posthog-server/](./posthog-server/) | **Usage:** [posthog-server/USAGE.md](./posthog-server/USAGE.md)
45-
46-
### posthog-android-gradle-plugin
47-
48-
Gradle plugin suitable for Android-specific features.
49-
50-
```kotlin
51-
implementation("com.posthog:posthog-android-gradle-plugin:$latestVersion")
52-
```
15+
Please see the main [PostHog docs](https://posthog.com/docs).
5316

54-
**Documentation:** [posthog-android-gradle-plugin/](./posthog-android-gradle-plugin/) | **Usage:** [posthog-android-gradle-plugin/USAGE.md](./posthog-android-gradle-plugin/USAGE.md)
17+
SDK usage examples and code snippets live in the official documentation so they stay up to date.
5518

5619
## Documentation
5720

58-
Please see the main [PostHog docs](https://posthog.com/docs).
59-
60-
Specifically, the [Android docs](https://posthog.com/docs/libraries/android) details.
21+
- [Android library docs](https://posthog.com/docs/libraries/android)
22+
- [Java/JVM library docs](https://posthog.com/docs/libraries/java)
6123

6224
## Questions?
6325

6426
### [Check out our community page.](https://posthog.com/posts)
27+
28+
## Contributing
29+
30+
See [CONTRIBUTING.md](CONTRIBUTING.md) for local setup and test instructions.

0 commit comments

Comments
 (0)