This repository was archived by the owner on May 29, 2026. It is now read-only.
chore(canonical): ship baseline-include pattern + pilot fixes#49
Merged
Conversation
Three follow-ups discovered during the decidesk pilot of the fleetwide canonical (#48): 1. Ship empty phpstan-baseline.neon and include it from phpstan.neon. This is the canonical tracked-debt entry point. The fleet directive forbids per-app validation rules, but baselines remain acceptable as temporary tracked-debt markers (with an open GitHub issue + removal timeline). Apps without debt ship the empty baseline file as-is. 2. Fix the JSONResponse statusCode ignoreErrors regex to match both `Parameter $statusCode` and the more common `Parameter #N $statusCode` forms that phpstan actually emits. The previous regex only matched the first form, which is why decidesk needed a per-app suppression (and several other apps too). 3. Add OCA\OpenRegister\Service\CalendarEventService to the psalm referencedClass whitelist. Currently only decidesk uses it, but it's an OpenRegister-shipped class loaded at runtime; whitelisting it fleetwide is no-op for apps that don't depend on it.
Contributor
Quality Report — ConductionNL/nextcloud-app-template @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ❌ | ||||
| composer | ❌ | ✅ 100/100 | |||
| npm | ✅ | ❌ 2/684 denied | |||
| PHPUnit | ⏭️ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ |
❌ Denied npm licenses
| Package | Version | License |
|---|---|---|
| pako | 1.0.11 | (MIT AND Zlib) |
| sha.js | 2.4.12 | (MIT AND BSD-3-Clause) |
Quality workflow — 2026-05-21 19:36 UTC
Download the full PDF report from the workflow artifacts.
3 tasks
rubenvdlinde
added a commit
that referenced
this pull request
May 21, 2026
The `#` is the PCRE delimiter for phpstan ignoreErrors regexes, so the unescaped `(#\d+ )?` in #49 closed the pattern early and produced "Unknown modifier" errors when an app actually parsed the canonical. Escape it as `(\#\d+ )?` so the pattern parses and matches both `Parameter $statusCode` and `Parameter #N $statusCode` forms. Caught while applying the canonical to decidesk in the Phase 2 pilot.
3 tasks
rubenvdlinde
added a commit
that referenced
this pull request
May 21, 2026
…ut (#51) Four refinements identified during the 16-app fleet rollout (Phase 2), absorbed back into the canonical so the next round of fleet syncs is cleaner: 1. psalm.xml ignoreFiles adds lib/Resources/template — mirrors the existing phpcs/phpstan excludes for apps shipping a verbatim template snapshot (openbuilt). No-op for apps without the directory. 2. psalm.xml gains errorBaseline="psalm-baseline.xml" + ships an empty psalm-baseline.xml as the canonical tracked-debt entry point. openregister/mydash/opencatalogi/docudesk already used this pattern ad-hoc; making it canonical means every app's psalm tracked debt has a uniform home. Mirrors the phpstan-baseline.neon pattern from nextcloud-app-template #49. 3. psalm.xml referencedClass list gains OCA\OpenRegister\Service\RiskLevelService and OCA\OpenRegister\Db\EntityRelationMapper. docudesk surfaced these as needed-but-missing; promoting fleetwide so per-app additions aren't required (per the no-per-app-rules directive). 4. phpstan.neon ignoreErrors gains the OC\Security\CSRF\ family. Pipelinq surfaced CsrfTokenManager during the sync (no OCP equivalent yet); this is server-internal and applies fleetwide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three follow-ups surfaced by the decidesk pilot of the canonical (after #48 merged):
phpstan-baseline.neon+ include fromphpstan.neon. Canonical tracked-debt entry point. The fleet directive forbids per-app validation rules, but baselines remain acceptable as temporary tracked-debt markers with an open GitHub issue + removal timeline. Apps without debt ship the empty baseline file as-is.ignoreErrorsregex. Previous:'#Parameter \\\$statusCode of class …#'— only matched the literal-name form. Real phpstan output isParameter #N \$statusCode, so the regex never matched and apps had to add per-app suppressions. New regex matches both forms.OCA\OpenRegister\Service\CalendarEventServiceto the psalm<UndefinedClass>whitelist. Currently only decidesk uses it; whitelisting fleetwide is a no-op for non-consumers and unblocks decidesk from carrying a per-app entry.Context
Pilot run on decidesk surfaced 2 psalm errors (both
CalendarEventService) and 8 phpstan errors. Without these canonical adjustments, decidesk would need 3 per-app suppressions just to absorb fleet-shared patterns — defeating the consolidation. With these landed, decidesk's remaining debt is genuinely decidesk-specific.Test plan
phpstan-baseline.neon: parses as valid YAML/NEONphpstan.neon: parses as valid YAML/NEON; includes resolvespsalm.xml: valid XMLlib/(PHPStan now reads the empty baseline)