Skip to content

Use namespaced imports for Html class#36

Merged
malberts merged 3 commits into
ProfessionalWiki:masterfrom
SomeMWDev:master
Jul 23, 2025
Merged

Use namespaced imports for Html class#36
malberts merged 3 commits into
ProfessionalWiki:masterfrom
SomeMWDev:master

Conversation

@SomeMWDev

@SomeMWDev SomeMWDev commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

Fixes compatibility with MW 1.44.
Raise MW requirement to 1.40 accordingly.

Summary by CodeRabbit

  • Chores
    • Increased the minimum required MediaWiki version for the extension to 1.43.
    • Raised the minimum required PHP version to 8.1.0.
    • Updated internal references to the MediaWiki Html class for improved clarity.
    • Simplified CI testing matrix to focus on newer MediaWiki and PHP versions.

No changes to user-facing features or functionality.

@coderabbitai

coderabbitai Bot commented Jul 22, 2025

Copy link
Copy Markdown
📝 Walkthrough

"""

Walkthrough

The changes update the import statements for the Html class in several source and test files to use the fully qualified MediaWiki\Html\Html namespace. The extension version was bumped to 4.0.0, and the minimum required MediaWiki version was increased from 1.39 to 1.43. The CI workflow matrix was simplified to test only newer MediaWiki and PHP versions. No logic, functionality, or public entity declarations were altered.

Changes

Files Change Summary
extension.json Updated extension version to 4.0.0; increased minimum required MediaWiki version from 1.39 to 1.43.
src/IconRenderers/JavascriptRenderer.php
src/IconRenderers/WebfontRenderer.php
Updated Html class import to use use MediaWiki\Html\Html; instead of a generic import.
tests/phpunit/IconRenderers/JavascriptRendererTest.php
tests/phpunit/IconRenderers/WebfontRendererTest.php
Changed Html class import to fully qualified MediaWiki\Html\Html namespace in test files.
.github/workflows/ci.yml Simplified CI matrix by removing older MediaWiki versions (REL1_39 to REL1_42) and older PHP versions; added REL1_44 with PHP 8.3.
README.md Increased minimum required PHP version from 7.4.3 to 8.1.0 and MediaWiki version from 1.39 to 1.43; added release note for version 4.0.0.
composer.json Updated PHP version requirement from ">=7.4.3" to ">=8.1".

Estimated code review effort

2 (~15 minutes)

Possibly related PRs

  • Add MW 1.40 to CI #24: Related through CI matrix changes involving MediaWiki version REL1_40, but with opposite actions regarding its inclusion.
  • Remove failing MW master build #32: Also modifies .github/workflows/ci.yml by adjusting the CI testing matrix, removing older PHP and MediaWiki versions.
  • Update CI #22: Also changes the CI workflow matrix by removing older versions and adding experimental flags, related to CI configuration management.
    """

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@JeroenDeDauw

Copy link
Copy Markdown
Member

GitHub Actions config needs update. Also good to bump the version of the extension to 4.0.0 and minimum MW version to 43 (extension.json and release notes in README.md)

Fixes compatibility with MW 1.44.
Raise MW requirement to 1.43 accordingly.
Run CI on 1.44.
Bump version to 4.0.0.
@SomeMWDev

Copy link
Copy Markdown
Contributor Author

GitHub Actions config needs update. Also good to bump the version of the extension to 4.0.0 and minimum MW version to 43 (extension.json and release notes in README.md)

Should be done.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/ci.yml (1)

17-22: Quote the php value to avoid YAML-float pitfalls and keep style consistent

In the test matrix the newly added entry uses an unquoted scalar (php: 8.3) whereas the phpcs matrix below quotes the very same value ('8.3').
Quoting avoids the “8.0 → 8” truncation hazard seen when people later copy-paste this row for other versions and keeps the style uniform.

-  - mw: 'REL1_44'
-    php: 8.3
+  - mw: 'REL1_44'
+    php: '8.3'
README.md (1)

104-109: Release-note bullets violate the repo’s markdownlint style

markdownlint expects dash (-) list markers, but the new entry uses asterisks (*), triggering MD004.

-* Raised the minimum MediaWiki version from 1.39 to 1.43
+- Raised the minimum MediaWiki version from 1.39 to 1.43
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2aefaba and 1bee93c.

📒 Files selected for processing (7)
  • .github/workflows/ci.yml (1 hunks)
  • README.md (2 hunks)
  • extension.json (2 hunks)
  • src/IconRenderers/JavascriptRenderer.php (1 hunks)
  • src/IconRenderers/WebfontRenderer.php (1 hunks)
  • tests/phpunit/IconRenderers/JavascriptRendererTest.php (1 hunks)
  • tests/phpunit/IconRenderers/WebfontRendererTest.php (1 hunks)
🪛 markdownlint-cli2 (0.17.2)
README.md

108-108: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)

✅ Files skipped from review due to trivial changes (3)
  • extension.json
  • src/IconRenderers/JavascriptRenderer.php
  • tests/phpunit/IconRenderers/JavascriptRendererTest.php
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/phpunit/IconRenderers/WebfontRendererTest.php
  • src/IconRenderers/WebfontRenderer.php
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

108-108: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)

🔇 Additional comments (1)
README.md (1)

14-16: Double-check that the composer.json also enforces PHP ≥ 8.1 & MW ≥ 1.43

The requirements table is updated, but if composer.json (not shown here) still advertises lower constraints, users can install an incompatible version.
Please verify that composer.json now contains:

"require": {
    "php": ">=8.1",
    "mediawiki/core": ">=1.43"
}

Comment thread README.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
README.md (1)

104-110: Fix MD004 – unify list marker style inside the new release-notes block

markdownlint flags the two new bullets for using * while the surrounding lists in the “Requirements” section use -. Pick one marker style for the whole document. If you follow the linter recommendation (dash), the diff is trivial:

-* Raised the minimum PHP version from 7.4.3 to 8.1.0
-* Raised the minimum MediaWiki version from 1.39 to 1.43
+- Raised the minimum PHP version from 7.4.3 to 8.1.0
+- Raised the minimum MediaWiki version from 1.39 to 1.43

(Or flip the earlier dashes to stars—either way, be consistent.)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08b37a1 and bdc6774.

📒 Files selected for processing (1)
  • README.md (2 hunks)
🪛 markdownlint-cli2 (0.17.2)
README.md

108-108: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)


109-109: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)

🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
README.md

108-108: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)


109-109: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)

Comment thread README.md
Comment on lines +14 to +15
- PHP 8.1.0 or later
- MediaWiki 1.43 or later

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Composer example still references the obsolete ^2.0 constraint

The requirements were bumped to PHP 8.1 / MW 1.43, yet the Composer install snippet further down the file still asks for ^2.0. Anyone copy-pasting it will end up installing an old major version that does not match the documented requirements.

-1. `COMPOSER=composer.local.json php composer.phar require --no-update mediawiki/font-awesome ^2.0`
+1. `COMPOSER=composer.local.json php composer.phar require --no-update mediawiki/font-awesome ^4.0`

🏁 Script executed:

#!/bin/bash
# Search for the composer require snippet in README.md
grep -n 'composer.phar require' README.md

# Check if the old ^2.0 constraint is still referenced
grep -n '\^2\.0' README.md

Length of output: 278


🏁 Script executed:

#!/bin/bash
# Fetch the latest 10 versions of mediawiki/font-awesome from Packagist
curl -s https://packagist.org/packages/mediawiki/font-awesome.json \
  | grep -o '"version":"[^"]*"' \
  | sed 's/"version":"//; s/"//' \
  | sort -rV \
  | head -n 10

# List all unique major versions available
curl -s https://packagist.org/packages/mediawiki/font-awesome.json \
  | grep -o '"version":"[^"]*"' \
  | sed 's/"version":"//; s/"//' \
  | cut -d'.' -f1 \
  | sort -u

Length of output: 387


Update Composer constraint to the latest major (3.x)

The README’s install snippet still pins ^2.0, but Packagist’s newest stable major release is 3.0.0. Copy-pasting the old constraint will pull in v2.x instead of the current v3.x.

– README.md, line 25:

- COMPOSER=composer.local.json php composer.phar require --no-update mediawiki/font-awesome ^2.0
+ COMPOSER=composer.local.json php composer.phar require --no-update mediawiki/font-awesome ^3.0

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In README.md around lines 14 to 15, the Composer version constraint is outdated,
still pinned to ^2.0, which causes installation of version 2.x instead of the
latest major 3.x. Update the Composer constraint in the install snippet to ^3.0
to ensure users get the current stable major release.

@malberts
malberts merged commit 375d85c into ProfessionalWiki:master Jul 23, 2025
3 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.

3 participants