Repository navigation
chore: absorb compression into packages/compression - #13798
Conversation
feat: utopia compression
fix: constructor
fix: add tests ci and & gzip
feat(zstd): enable by default for accept encoding
Rename IDENTITY constant to NONE
Real fixes surfaced by the hoisted toolchain: Algorithms\Gzip referenced with the wrong case (a PSR-4 autoload hazard on case-sensitive filesystems), a typo'd 'suggests' composer key hiding the extension suggestions, and compressed-size assertions hardcoding library-version-dependent byte counts. Algorithm suites now skip via RequiresPhpExtension when an extension is absent; psalm is replaced by the hoisted phpstan (level 5); the tests-in-container scaffolding is retired. Co-Authored-By: Claude Fable 5 <[email protected]>
setup-php has no xz extension, so the runner's phpstan lacked xzencode/xzdecode; a scanFiles stub provides the symbols without the extension. Tests already skip via RequiresPhpExtension. Co-Authored-By: Claude Fable 5 <[email protected]>
Every uses: ref is upgraded to its latest major (checkout v6, create-github-app-token v3) and pinned to the tag's commit SHA in ratchet's format. The validate job now runs ratchet lint over root and package workflows, so unpinned refs fail CI. Four leftover QA-only codeql workflows (cli, pools, telemetry, validators) are deleted — they invoke the composer check script that QA hoisting removed. Co-Authored-By: Claude Fable 5 <[email protected]>
- Drop the 17 per-package mirror CI workflows: they were inert in the monorepo and only re-tested, on the mirror, code the monorepo's own matrix already gated pre-merge. absorb now strips all incoming workflows and writes only mirror.yml; the ratchet lint over packages/* (no uses: left to pin) goes too. - Make absorb's mirror ruleset idempotent: update whatever branch ruleset already exists in place instead of skipping on a name clash (the gap that left auth's mirror without the split-app bypass). - Remove the standalone `import` command — unused, and it left a package without mirror.yml/banner/ruleset. import_package() stays as absorb's helper. - Trim absorbing.md/creating.md/README to match. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
build: hoist baseline rector + phpstan configs to the root
Reuse mirror redirect workflow
docs: enforce documentation style with Vale
docs: centralize CODE_OF_CONDUCT and CONTRIBUTING at the monorepo root
chore: stop committing package lock files
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
|
| $dataSize = mb_strlen($data, '8bit'); | ||
|
|
||
| $this->assertSame(21, $demoSize); | ||
| $this->assertSame(27, $dataSize); |
There was a problem hiding this comment.
Codec output is over-specified
This assertion freezes the exact output size of the current LZ4 extension and fixture even though the test already verifies a lossless round trip. A valid extension upgrade can change the encoded byte count without breaking compression, causing meaningless CI failures. The same pattern appears in SnappyTest and ZstdTest. This violates the repository directive to test observable behavior rather than mirror implementation- or version-specific output, so these byte-size assertions must be removed before merging.
Context Used: Call out and harshly judge implementation-coupled tests. We don't mirror source code, configuration, or version pins in assertions. We test observable behavior; use linters for syntax and schema checks. (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/compression/tests/Algorithms/LZ4Test.php
Line: 35
Comment:
**Codec output is over-specified**
This assertion freezes the exact output size of the current LZ4 extension and fixture even though the test already verifies a lossless round trip. A valid extension upgrade can change the encoded byte count without breaking compression, causing meaningless CI failures. The same pattern appears in `SnappyTest` and `ZstdTest`. This violates the repository directive to test observable behavior rather than mirror implementation- or version-specific output, so these byte-size assertions must be removed before merging.
**Context Used:** Call out and harshly judge implementation-coupled tests. We don't mirror source code, configuration, or version pins in assertions. We test observable behavior; use linters for syntax and schema checks. ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Absorb
utopia-php/compressionintopackages/compression, so Appwrite loads it directly and library changes can land alongside their callers. It is a leaf package requiring only PHP; optional compression extensions remain suggested dependencies.8a23fdec63623aa6ad64ed764d688e67cf2c110e, flatten source/tests, and point the mirror workflow and README here.Validation
bin/monorepo validatebin/monorepo check compression(Pint and maximum-level PHPStan with baseline)bin/monorepo test compression: 30 tests, 88 assertions; all optional compression extensions present, no skipscomposer validate --no-check-publish(existing exact-version warnings only)bin/monorepo split compression --dry-run:b920ca6c3fd10c00515f1fccddf2c71c92eddab8git diff --checkFull Appwrite CI remains pending; no Appwrite E2E stack was run locally.
Merge and mirror
Merge with a merge commit, not squash, to preserve the subtree ancestry. After merge, verify the compression Split workflow. The mirror already has an active ruleset with split-app bypass, so no ruleset mutation was needed. Existing mirror PR utopia-php/compression#5 concerns formatting/CI now owned by the root and should be closed as superseded after this lands.
Closes #13797.