nextcloud / nextcloud/server

Migrations generated via occ fail psalm validation

Open
#34,555 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop feature: install and update good first issue needs review technical debt
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

Actually such migrations fail psalm:

Error: ….php:42:56: MoreSpecificImplementedParamType: Argument 2 of …::changeSchema has the more specific type 'Closure():OCP\DB\ISchemaWrapper', expecting 'Closure' as defined by OCP\Migration\SimpleMigrationStep::changeSchema (see https://psalm.dev/140)

So I guess we have to revert it or update the base class as well?

Originally posted by @nickvergessen in https://github.com/nextcloud/server/issues/34488#issuecomment-1275904697

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generated migration mentioned in the Psalm error and inspect OCP\Migration\SimpleMigrationStep::changeSchema, focusing on the Closure type mismatch. Run Psalm against a generated migration to reproduce the failure; done means migrations generated via occ pass validation without this error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.