Skip to content

XCOMMONS-3862: Add a build check verifying that the provided macros are declared in xwiki.extension.components - #459

Merged
manuelleduc merged 2 commits into
masterfrom
feature-deploy-macro-declaration
Nov 10, 2026
Merged

manuelleduc merged 2 commits into
masterfrom
feature-deploy-macro-declaration

Conversation

@manuelleduc

@manuelleduc manuelleduc commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Jira URL

https://jira.xwiki.org/browse/XCOMMONS-3862

Changes

Description

  • Declare the macros of the box, comment, content, footnotes, html, id, message, raw and toc macro modules (12 macros) in xwiki.extension.components, so that the Extension Manager can suggest installing them.
  • Exclude the internal ctsdata (rendering compatibility test suite) and putFootnotes (inserted by the footnote macro) macros with the xwiki.extension.components.macros.check.excluded Maven property, so that the editor doesn't suggest installing them.

Clarifications

Screenshots & Video

N/A, build-only change.

Executed Tests

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • None

🤖 Generated with Claude Code

…re declared in xwiki.extension.components

* Declare the macros of the box, comment, content, ctsreport, footnotes, html, id, message, raw and toc macro modules so that the Extension Manager can suggest installing them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmortagne

tmortagne commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

I'm surprised to not see any mention of xwiki-platform-rendering-wikimacro-store (which contain java macros). Note that I don't think we should expose those macros in the index as they don't really make sense on their own.

…re declared in xwiki.extension.components

* Exclude the internal macros from xwiki.extension.components using the xwiki.extension.components.macros.check.excluded Maven property, so that the editor doesn't suggest installing them
* Use the renamed xwiki.extension.components.macros.check.skip Maven property

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

@manuelleduc

Copy link
Copy Markdown
Member Author

I'm surprised to not see any mention of xwiki-platform-rendering-wikimacro-store (which contain java macros). Note that I don't think we should expose those macros in the index as they don't really make sense on their own.

Good catch, thanks.

This module is in xwiki-platform, so it's probably a comment for xwiki/xwiki-platform#7232 ;)

The check never reported it because it crashed on this module: DefaultWikiMacro has its own class as component role, making Spoon crash.

I updated xwiki/xwiki-commons#2104 accordingly, and excluded wikimacrocontent and wikimacroparameter in xwiki/xwiki-platform#7232

@tmortagne

Copy link
Copy Markdown
Member

This module is in xwiki-platform, so it's probably a comment for xwiki/xwiki-platform#7232 ;)

I could not find the comment anymore on xwiki-platform and finally noticed I had put it on the wrong PR...

</xwiki.extension.components>
<!-- Internal macro inserted by the footnote macro, not declared in xwiki.extension.components so that the editor
doesn't suggest installing it -->
<xwiki.extension.components.macros.check.excluded>putFootnotes</xwiki.extension.components.macros.check.excluded>

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.

Not that it's allowed to use this macro (when you want the footnotes to be inserted in a specific location). But it would probably be noise from macro index point of view, so I would suggest keeping the exclusion.

@manuelleduc
manuelleduc merged commit 5a41492 into master Nov 10, 2026
6 checks passed
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