Skip to content

XWIKI-10330: Allow reinstalling an extension from an extension reposi…#5383

Open
vmassol wants to merge 1 commit intomasterfrom
XWIKI-10330
Open

XWIKI-10330: Allow reinstalling an extension from an extension reposi…#5383
vmassol wants to merge 1 commit intomasterfrom
XWIKI-10330

Conversation

@vmassol
Copy link
Copy Markdown
Member

@vmassol vmassol commented Apr 11, 2026

…tory in the extension manager

Jira URL

https://jira.xwiki.org/browse/XWIKI-10330

Changes

Description

This is the change in platform. There's also a PR for commons.

Coded by Claude Code. To be reviewed/validated.

Screenshots & Video

Screenshot 2026-04-11 at 21 33 56

Executed Tests

Manual testing in EM to reinstall an extension after a change was made.

Expected merging strategy

  • Prefers squash: Yes

@vmassol vmassol requested a review from tmortagne April 11, 2026 19:34
* @return true if the extension was removed or not present, false on error
* @since 18.3.0RC1
*/
public boolean removeExtension(String id, String version)
Copy link
Copy Markdown
Member

@tmortagne tmortagne Apr 16, 2026

Choose a reason for hiding this comment

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

It's IMO not a good idea to provide such a dangerous helper (if the passed extension is still installed, it will create quite a mess since the extension will still be found in the installed extension index in memory but not in the storage). If you really need that hack (but I don't think it's the right direction here), you can always use the already existing getRepository() script API.


#macro (computeReinstallPlan $extensionId $extensionVersion $extensionNamespace)
## Remove from local cache to force a fresh download (useful for snapshot versions)
#set ($discard = $services.extension.local.removeExtension($extensionId, $extensionVersion))
Copy link
Copy Markdown
Member

@tmortagne tmortagne Apr 16, 2026

Choose a reason for hiding this comment

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

After this line the installed extension is essentially broken. So if you don't validate the proposed plan, you are left in a pretty bad state. Creating an installation plan should be a readonly thing. Also, any change like this should be part of a job IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants