Skip to content

chore: use pnpm native release management#206

Merged
marandaneto merged 2 commits into
mainfrom
chore/use-pnpm-versioning
Jul 23, 2026
Merged

chore: use pnpm native release management#206
marandaneto merged 2 commits into
mainfrom
chore/use-pnpm-versioning

Conversation

@marandaneto

@marandaneto marandaneto commented Jul 23, 2026

Copy link
Copy Markdown
Member

💡 Motivation and Context

pnpm now provides native release management, so the PHP SDK no longer needs @changesets/cli and its dependency tree solely to record and apply release intents.

This replaces the Changesets CLI with pnpm change and pnpm version -r, while preserving repository-backed changelogs and the existing reviewed release-candidate workflow. The workflow also captures pnpm's release ledger in the verified patch and skips none-only intents by inspecting only their YAML frontmatter.

💚 How did you test it?

  • Ran pnpm install --frozen-lockfile --ignore-scripts with pnpm 11.13.1.
  • Parsed the updated workflow and workspace files as YAML and ran git diff --check.
  • Exercised the release-intent check for no intents, a none intent with a misleading releasable-looking summary, malformed frontmatter, and a releasable intent.
  • Ran the exact release-candidate step in a temporary git repository with patch and minor intents, then applied the generated patch in a fresh clone and verified the version files, changelog, and ledger.
  • Ran two independent review passes; the final review found no release-safety or documentation issues.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm change to generate a change intent file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Implemented with Pi's coding tools and read-only reviewer subagents. The migration keeps pnpm pinned to 11.13.1, the first eligible native-versioning release under this repository's seven-day minimum release age, and retains committed changelogs via versioning.changelog.storage: repository. Review feedback identified none-intent handling, a stale PR-template command, and a body-text false positive in the release check; all were fixed and validated before resolving the thread.

@marandaneto marandaneto self-assigned this Jul 23, 2026
@marandaneto
marandaneto marked this pull request as ready for review July 23, 2026 03:07
@marandaneto
marandaneto requested a review from a team as a code owner July 23, 2026 03:07
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

posthog-php Compliance Report

Date: 2026-07-23 06:33:17 UTC
Duration: 95264ms

✅ All Tests Passed!

46/46 tests passed


Capture Tests

29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 12ms
Format Validation.Event Has Uuid 6ms
Format Validation.Event Has Lib Properties 5ms
Format Validation.Distinct Id Is String 6ms
Format Validation.Token Is Present 5ms
Format Validation.Custom Properties Preserved 6ms
Format Validation.Event Has Timestamp 5ms
Retry Behavior.Retries On 503 5316ms
Retry Behavior.Does Not Retry On 400 2009ms
Retry Behavior.Does Not Retry On 401 2008ms
Retry Behavior.Respects Retry After Header 8015ms
Retry Behavior.Implements Backoff 15728ms
Retry Behavior.Retries On 500 5115ms
Retry Behavior.Retries On 502 5112ms
Retry Behavior.Retries On 504 5115ms
Retry Behavior.Max Retries Respected 16516ms
Deduplication.Generates Unique Uuids 12ms
Deduplication.Preserves Uuid On Retry 5113ms
Deduplication.Preserves Uuid And Timestamp On Retry 10316ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 5117ms
Deduplication.No Duplicate Events In Batch 11ms
Deduplication.Different Events Have Different Uuids 7ms
Compression.Sends Gzip When Enabled 6ms
Batch Format.Uses Proper Batch Structure 6ms
Batch Format.Flush With No Events Sends Nothing 3ms
Batch Format.Multiple Events Batched Together 9ms
Error Handling.Does Not Retry On 403 2008ms
Error Handling.Does Not Retry On 413 2009ms
Error Handling.Retries On 408 5114ms

Feature_Flags Tests

17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 7ms
Request Payload.Flags Request Uses V2 Query Param 5ms
Request Payload.Flags Request Hits Flags Path Not Decide 4ms
Request Payload.Flags Request Omits Authorization Header 5ms
Request Payload.Token In Flags Body Matches Init 4ms
Request Payload.Groups Round Trip 5ms
Request Payload.Groups Default To Empty Object 4ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 5ms
Request Payload.Disable Geoip Omitted Defaults To False 4ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 5ms
Request Lifecycle.No Flags Request On Init Alone 2ms
Request Lifecycle.No Flags Request On Normal Capture 6ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 8ms
Request Lifecycle.Mock Response Value Is Returned To Caller 5ms
Retry Behavior.Retries Flags On 502 107ms
Retry Behavior.Retries Flags On 504 108ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 7ms

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
.github/workflows/release.yml:41
**Markdown Body Triggers Release**

This grep scans the whole intent file rather than only its YAML frontmatter. A `none` intent whose summary contains a standalone line such as `posthog-php: patch` is treated as releasable, but `pnpm version -r` still reads the frontmatter as `none`; the candidate job then fails instead of skipping the intent.

Reviews (1): Last reviewed commit: "chore: use pnpm native versioning" | Re-trigger Greptile

Comment thread .github/workflows/release.yml Outdated

@ioannisj ioannisj left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile comment looks reasonable though, should be scanning frontmatter only

@marandaneto
marandaneto merged commit bb2f7c2 into main Jul 23, 2026
21 checks passed
@marandaneto
marandaneto deleted the chore/use-pnpm-versioning branch July 23, 2026 06:34
turnipdabeets added a commit to PostHog/posthog-kmp that referenced this pull request Jul 23, 2026
* chore: use pnpm native release management instead of @changesets

pnpm >=11.13 ships native release management (pnpm change /
pnpm version -r), so the repo no longer needs @changesets/cli and
@changesets/changelog-github solely to record and apply release intents.
Mirrors PostHog/posthog-php#206.

- release.yml: pnpm version -r consumes intents, updates CHANGELOG.md and
  the committed .changeset/ledger.yaml; the trigger check now inspects
  intent frontmatter so none-only intents don't start a release; no
  install step needed (zero npm deps remain)
- lint-pr.yml: validate intents with pnpm change status (verified it
  rejects malformed bump types)
- bump-version.sh comments updated, pinned sha256 rotated in release.yml
- pnpm-workspace.yaml: versioning.changelog.storage: repository, plus
  minimumReleaseAge for any future npm deps

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore: restore changelog commit links and author attribution

pnpm's native changelog writes plain summaries; scripts/enrich-changelog.mjs
post-processes the fresh section to match the previous changelog-github
format: [short-sha](commit-url) prefix, '— Thanks @author!' suffix, and the
release date on the version heading. Author resolution failures degrade to a
plain entry instead of failing the release. Pinned via
EXPECTED_ENRICH_SCRIPT_SHA256 like the bump script.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore: thank the PR author in changelog entries, not the commit author

Resolve the intent's introducing commit to its associated PR via
repos/{repo}/commits/{sha}/pulls (what changelog-github did) and thank the
PR author; fall back to the commit author for direct pushes. Hash re-pinned.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore: drop packageManager field, it breaks the Kotlin/JS yarn toolchain

kotlinNpmInstall runs yarn 1, whose corepack check rejects a root
package.json declaring a non-yarn packageManager. CI pins pnpm 11.13.1
via pnpm/setup and RELEASING.md documents the >=11.13 requirement, so
the field was informational only.

* chore: drop changelog enrichment, let formatting follow pnpm output

* ci: keep required-check job name stable

* chore: trim workflow comments

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants