Skip to content

chore: enable 7-day Composer cooldown for the Laravel package - #340

Merged
marandaneto merged 2 commits into
mainfrom
chore/composer-cooldown
Dec 1, 2026
Merged

marandaneto merged 2 commits into
mainfrom
chore/composer-cooldown

Conversation

@marandaneto

@marandaneto marandaneto commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

💡 Motivation and Context

Composer 2.11 added a cooldown setting. When it is on, Composer will not install a package version until it has been public on Packagist for a set amount of time. Compromised releases are often found and pulled within a few days, so waiting lowers the chance that we pull one in. See the Socket write-up and the Composer docs.

This repo already waits 7 days in Dependabot and pnpm (minimumReleaseAge). This PR sets the same 7-day cooldown in packages/laravel/composer.json. That project has no lock file, so CI and the release workflow resolve its dependencies from scratch on every run.

posthog/posthog-php is exempt from the cooldown. The Laravel package pins the core SDK to an exact version. The release workflow installs that version right after core is published to Packagist. Without the exemption, every Laravel release would fail for 7 days after a core release.

The root composer.json and examples/laravel/composer.json are not changed. Composer 2.11 adds config.policy to the lock file content-hash, and older Composer versions don't. Dependabot runs Composer 2.10.3, so a cooldown in those files would make its Composer PRs fail composer validate --strict. Dependabot already waits 7 days before opening those updates. We can add the root cooldown once Dependabot moves to Composer 2.11.

💚 How did you test it?

  • I ran a dry-run of the same composer install --no-dev --prefer-dist --no-scripts --no-plugins that scripts/verify-laravel-production-dependencies.sh uses, against the Laravel manifest. It installs posthog/posthog-php 4.29.0. Without the exemption it fails with "still in the cooldown period". The same output also reports 123 third-party versions withheld by the cooldown.
  • scripts/test-laravel.sh 13 passes.
  • The root and examples/laravel manifests and lock files match main. Composer 2.10.3 and 2.11.3 both validate them.

This does not affect SDK users. Composer only reads config from the root project, so it ignores this setting when our packages are installed as dependencies.

To pull an urgent fix sooner, run Composer with --no-cooldown or set COMPOSER_POLICY_COOLDOWN_PERIOD=0.

📝 Checklist

  • All commits are signed (see Commit signing)
  • 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

No change intent is needed because this only affects how this repo installs dependencies.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

  • Written with Pi (Claude). Pi's autoreview step also had a second model (GPT) review the change, and it found no issues.
  • The first version also set the cooldown in the root and example projects. Review showed two problems with that. It broke Laravel release verification, and it changed the lock file hashes in a way Dependabot's Composer 2.10.3 can't reproduce. Both were reproduced before the fix.

@marandaneto marandaneto self-assigned this Dec 1, 2026
@marandaneto
marandaneto marked this pull request as ready for review December 1, 2026 15:31
@marandaneto
marandaneto requested a review from a team as a code owner December 1, 2026 15:31

@stamphog stamphog Bot 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.

Not approved — this change needs a human reviewer.

Asking again through the PostHog MCP or with @posthog stamp gives the same result unless the changed files change.

stamphog can't auto-approve this pull request. The deny-list gate refused it because it touches composer.lock and examples/laravel/composer.lock, which fall under the dependency and toolchain category. That match also placed the change in the never-auto tier. The size gate passed, so the refusal is about which files changed, not how much.

The author should ask a human reviewer to look at it. Splitting the lock file edits into a separate PR won't get around the gate, since any change to those files will match the deny-list.

Gate mechanics and policy version
Gate Result
prerequisites ✓ all clear
deny-list ✗ matches: deps_toolchain in composer.lock, examples/laravel/composer.lock
every_file_attested ✓ not a bot PR
size ✓ 23L, 3F substantive, 27L/5F incl. docs/generated/snapshots — within ceiling
tier ✗ T2-never because the deny-list matched deps_toolchain
stamphog 2.9.1 .stamphog/policy.yml @ unknown · reviewed head 1b7f248

@stamphog stamphog Bot removed the stamphog label Dec 1, 2026
@veria-ai

veria-ai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PostHog Review · Standard · reviewed 1b7f248: 1 Must fix.

New pushes to this pull request won't start an automatic review. Comment @posthog review to review new changes.

Comment thread packages/laravel/composer.json Resolved
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

posthog-php-socket Compliance Report

Date: 2026-12-01T16:23:27.372998+00:00
Duration: 118922ms

✅ All Tests Passed!

47/47 tests passed


Capture Tests

✅ 30/30 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 29ms
Format Validation.Event Has Uuid ✅ 524ms
Format Validation.Event Has Lib Properties ✅ 526ms
Format Validation.Distinct Id Is String ✅ 525ms
Format Validation.Token Is Present ✅ 526ms
Format Validation.Custom Properties Preserved ✅ 526ms
Format Validation.Event Has Timestamp ✅ 525ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc ✅ 526ms
Retry Behavior.Retries On 503 ✅ 5833ms
Retry Behavior.Does Not Retry On 400 ✅ 2528ms
Retry Behavior.Does Not Retry On 401 ✅ 2528ms
Retry Behavior.Respects Retry After Header ✅ 8533ms
Retry Behavior.Implements Backoff ✅ 16246ms
Retry Behavior.Retries On 500 ✅ 5636ms
Retry Behavior.Retries On 502 ✅ 5630ms
Retry Behavior.Retries On 504 ✅ 5636ms
Retry Behavior.Max Retries Respected ✅ 16246ms
Deduplication.Generates Unique Uuids ✅ 535ms
Deduplication.Preserves Uuid On Retry ✅ 5633ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10840ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5637ms
Deduplication.No Duplicate Events In Batch ✅ 532ms
Deduplication.Different Events Have Different Uuids ✅ 527ms
Compression.Sends Gzip When Enabled ✅ 526ms
Batch Format.Uses Proper Batch Structure ✅ 526ms
Batch Format.Flush With No Events Sends Nothing ✅ 522ms
Batch Format.Multiple Events Batched Together ✅ 513ms
Error Handling.Does Not Retry On 403 ✅ 2529ms
Error Handling.Does Not Retry On 413 ✅ 2528ms
Error Handling.Retries On 408 ✅ 5633ms

Feature_Flags Tests

✅ 17/17 tests passed

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

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

posthog-php-fork_curl Compliance Report

Date: 2026-12-01T16:23:19.499926+00:00
Duration: 119366ms

✅ All Tests Passed!

47/47 tests passed


Capture Tests

✅ 30/30 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 43ms
Format Validation.Event Has Uuid ✅ 535ms
Format Validation.Event Has Lib Properties ✅ 536ms
Format Validation.Distinct Id Is String ✅ 537ms
Format Validation.Token Is Present ✅ 536ms
Format Validation.Custom Properties Preserved ✅ 536ms
Format Validation.Event Has Timestamp ✅ 537ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc ✅ 537ms
Retry Behavior.Retries On 503 ✅ 5863ms
Retry Behavior.Does Not Retry On 400 ✅ 2537ms
Retry Behavior.Does Not Retry On 401 ✅ 2540ms
Retry Behavior.Respects Retry After Header ✅ 8554ms
Retry Behavior.Implements Backoff ✅ 16286ms
Retry Behavior.Retries On 500 ✅ 5656ms
Retry Behavior.Retries On 502 ✅ 5654ms
Retry Behavior.Retries On 504 ✅ 5652ms
Retry Behavior.Max Retries Respected ✅ 16289ms
Deduplication.Generates Unique Uuids ✅ 545ms
Deduplication.Preserves Uuid On Retry ✅ 5653ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10870ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5661ms
Deduplication.No Duplicate Events In Batch ✅ 542ms
Deduplication.Different Events Have Different Uuids ✅ 539ms
Compression.Sends Gzip When Enabled ✅ 538ms
Batch Format.Uses Proper Batch Structure ✅ 537ms
Batch Format.Flush With No Events Sends Nothing ✅ 523ms
Batch Format.Multiple Events Batched Together ✅ 523ms
Error Handling.Does Not Retry On 403 ✅ 2539ms
Error Handling.Does Not Retry On 413 ✅ 2539ms
Error Handling.Retries On 408 ✅ 5650ms

Feature_Flags Tests

✅ 17/17 tests passed

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

@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

posthog-php-lib_curl Compliance Report

Date: 2026-12-01T16:22:58.905567+00:00
Duration: 118974ms

✅ All Tests Passed!

47/47 tests passed


Capture Tests

✅ 30/30 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields ✅ 31ms
Format Validation.Event Has Uuid ✅ 524ms
Format Validation.Event Has Lib Properties ✅ 526ms
Format Validation.Distinct Id Is String ✅ 527ms
Format Validation.Token Is Present ✅ 527ms
Format Validation.Custom Properties Preserved ✅ 526ms
Format Validation.Event Has Timestamp ✅ 526ms
Format Validation.Non Utc Event Timestamp Is Converted To Utc ✅ 526ms
Retry Behavior.Retries On 503 ✅ 5837ms
Retry Behavior.Does Not Retry On 400 ✅ 2529ms
Retry Behavior.Does Not Retry On 401 ✅ 2530ms
Retry Behavior.Respects Retry After Header ✅ 8535ms
Retry Behavior.Implements Backoff ✅ 16243ms
Retry Behavior.Retries On 500 ✅ 5140ms
Retry Behavior.Retries On 502 ✅ 5636ms
Retry Behavior.Retries On 504 ✅ 5634ms
Retry Behavior.Max Retries Respected ✅ 17048ms
Deduplication.Generates Unique Uuids ✅ 237ms
Deduplication.Preserves Uuid On Retry ✅ 5633ms
Deduplication.Preserves Uuid And Timestamp On Retry ✅ 10843ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5633ms
Deduplication.No Duplicate Events In Batch ✅ 536ms
Deduplication.Different Events Have Different Uuids ✅ 528ms
Compression.Sends Gzip When Enabled ✅ 527ms
Batch Format.Uses Proper Batch Structure ✅ 526ms
Batch Format.Flush With No Events Sends Nothing ✅ 522ms
Batch Format.Multiple Events Batched Together ✅ 512ms
Error Handling.Does Not Retry On 403 ✅ 2528ms
Error Handling.Does Not Retry On 413 ✅ 2530ms
Error Handling.Retries On 408 ✅ 5634ms

Feature_Flags Tests

✅ 17/17 tests passed

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

@dustinbyrne dustinbyrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Left two items before approval:

  1. Breaking: Confirmed the packages/laravel/composer.json cooldown failure against posthog/posthog-php 4.29.0 with Composer 2.11.3 and added the resume_run_id / 5-day artifact expiry and CONTRIBUTING.md details directly in the existing thread.
  2. Concern: Added an inline note on composer.lock regarding the Composer < 2.11 vs >= 2.11 content-hash split (affecting weekly Dependabot Composer PRs while dependabot-core pins 2.10.3, plus missing Composer 2.11+ contributor docs).

AI-assisted review.

Comment thread composer.lock Resolved
@dustinbyrne
dustinbyrne requested a review from a team December 1, 2026 16:14
@marandaneto marandaneto changed the title chore: enable 7-day Composer dependency cooldown chore: enable 7-day Composer cooldown for the Laravel package Dec 1, 2026

@stamphog stamphog Bot 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.

Not approved — escalated to a human reviewer.

Ask for another review through the PostHog MCP or comment @posthog stamp once you have addressed this.

The risky dependency-resolution change has no current-head independent review; the older concerns are addressed by exempting the core SDK and leaving locked projects unchanged. Request a review from Codex, Claude, or a human teammate covering dependency resolution and Laravel release verification before re-requesting.

  • Author wrote 0% of the modified lines and has 9 merged PRs in these paths (familiarity MODERATE).
  • Risky territory without independent assurance: Dependency and third-party code changes: packages/laravel/composer.json changes which dependency releases Composer may select by imposing a seven-day waiting period with an exemption for the core SDK.; CI/deploy/build tooling: packages/laravel/composer.json affects dependency installation during Laravel CI and release verification, including the install performed by scripts/verify-laravel-production-dependencies.sh.
Gate mechanics and policy version
Gate Result
prerequisites ✓ all clear
deny-list ✓ no deny categories matched
every_file_attested ✓ not a bot PR
size ✓ 12L, 1F substantive — within ceiling
tier ✓ T1-agent / T1a-trivial (12L, 1F, single-area, chore)
stamphog 2.9.1 .stamphog/policy.yml @ 90bd536 · reviewed head 90bd536

@stamphog stamphog Bot removed the stamphog label Dec 1, 2026
@marandaneto
marandaneto enabled auto-merge (squash) December 1, 2026 16:23
@marandaneto
marandaneto merged commit 38e37fa into main Dec 1, 2026
36 of 37 checks passed
@marandaneto
marandaneto deleted the chore/composer-cooldown branch December 1, 2026 16:35
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