Skip to content
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
rubenvdlinde merged 1 commit into
developmentfrom
chore/canonical-pilot-followups
May 21, 2026
Merged

chore(canonical): ship baseline-include pattern + pilot fixes#49
rubenvdlinde merged 1 commit into
developmentfrom
chore/canonical-pilot-followups

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Summary

Three follow-ups surfaced by the decidesk pilot of the canonical (after #48 merged):

  1. Ship empty phpstan-baseline.neon + include from phpstan.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.
  2. Fix the JSONResponse statusCode ignoreErrors regex. Previous: '#Parameter \\\$statusCode of class …#' — only matched the literal-name form. Real phpstan output is Parameter #N \$statusCode, so the regex never matched and apps had to add per-app suppressions. New regex matches both forms.
  3. Add OCA\OpenRegister\Service\CalendarEventService to 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/NEON
  • phpstan.neon: parses as valid YAML/NEON; includes resolves
  • psalm.xml: valid XML
  • CI green on template's own lib/ (PHPStan now reads the empty baseline)

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.
@rubenvdlinde rubenvdlinde merged commit f18e43c into development May 21, 2026
14 of 21 checks passed
@rubenvdlinde rubenvdlinde deleted the chore/canonical-pilot-followups branch May 21, 2026 19:36
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/nextcloud-app-template @ 547d313

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.

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.
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant