Skip to content

fix(appinfo): properly type info parser and app manager for appinfo.xml types#60066

Open
susnux wants to merge 4 commits into
masterfrom
fix/type-app-info
Open

fix(appinfo): properly type info parser and app manager for appinfo.xml types#60066
susnux wants to merge 4 commits into
masterfrom
fix/type-app-info

Conversation

@susnux
Copy link
Copy Markdown
Contributor

@susnux susnux commented May 2, 2026

Summary

  • Added type definitions for parsed appinfo.xml
  • Small changes to simply typing (sanitation belongs to parsing not apply l10n!)
  • Added tests cases to ensure shape of parsing results

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@susnux susnux added this to the Nextcloud 34 milestone May 2, 2026
@susnux susnux added the technical debt 🧱 🤔🚀 label May 2, 2026
@susnux susnux force-pushed the fix/type-app-info branch 2 times, most recently from 02a08c0 to e3044a3 Compare May 2, 2026 22:18
@susnux susnux added the 3. to review Waiting for reviews label May 2, 2026
@susnux susnux marked this pull request as ready for review May 3, 2026 09:54
@susnux susnux requested review from a team, come-nc and skjnldsv as code owners May 3, 2026 09:54
@susnux susnux requested review from Altahrim, CarlSchwan, leftybournes, provokateurin and salmart-dev and removed request for a team May 3, 2026 09:54
Comment thread apps/files_sharing/appinfo/info.xml
@susnux susnux requested a review from come-nc May 4, 2026 13:30
Copy link
Copy Markdown
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

I'm a bit surprised by the behavior changes in parsing. Was it incorrect according to the schema?

Comment on lines +174 to 176
if (isset($array['collaboration']['plugins']['plugin']) && is_array($array['collaboration']['plugins']['plugin'])) {
$array['collaboration']['plugins'] = $array['collaboration']['plugins']['plugin'];
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@provokateurin here the old code does nothing there are no such elements. The new code fixes a problem where wrong elements were parsed. This is similar to all other parsing of such elements in this function, e.g. see the if block before this comment.

Comment on lines +56 to +57
if (!array_key_exists('description', $array)) {
$array['description'] = '';
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@provokateurin there is no info inside the info, the <info> is the outer element - thats just always empty and unused.

The new code is just moved from applyL10N because there it made no sense but file sanitizing belongs to the parsing.

@susnux susnux requested a review from provokateurin May 5, 2026 16:02
Comment on lines +219 to +221
/**
* @var AppInfoXmlDefinition $array
*/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This @var should not be there. To do it correctly you'd add all the checks that are needed to ensure the data matches the shape.

While I would like to see this, it's probably a bit overkill for this PR 🙈

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Lets do this in a follow up, I think it makes sense but not in the scope of this PR

Comment thread lib/private/App/InfoParser.php Outdated
Comment thread lib/private/App/InfoParser.php
Comment thread tests/lib/App/InfoParserTest.php
susnux added 3 commits May 12, 2026 22:52
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the fix/type-app-info branch from e3044a3 to 8577d57 Compare May 12, 2026 20:52
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the fix/type-app-info branch from 8577d57 to 2b2b984 Compare May 12, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews technical debt 🧱 🤔🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants