Skip to content

REL1_43 REL1_44 compatibility#78

Open
freephile wants to merge 28 commits into
ProfessionalWiki:masterfrom
freephile:REL1_43_compat
Open

REL1_43 REL1_44 compatibility#78
freephile wants to merge 28 commits into
ProfessionalWiki:masterfrom
freephile:REL1_43_compat

Conversation

@freephile

@freephile freephile commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Except for a failing test in REL1_41, this new workflow for GitHub Actions appears to pass all tests for MediaWiki and PHP including REL1_43.

The "incompatible" warning on mediawiki.org could be removed.

The Extension request at Miraheze could be approved

In this fork/branch, all I did was enhance the GitHub Actions pipeline.

I used "act" to run the GitHub Actions pipeline locally in order to test the results.

If you install 'act' on your host, you can use it with Docker to run
all GitHub Actions locally before you commit to test changes
https://github.com/nektos/act

Here are the changes to ci.yml

add concurrency group to avoid duplicate runs for the same ref.

improve caching:

  • Cache Composer v2 path (~/.cache/composer)
  • Scope cache keys with hashFiles('**/composer.lock') so caches are invalidated when deps change, and use restore-keys.

add junit.xml log output for visibility of test failures

replace curl | bash codecov upload with the official action codecov/codecov-action@v4 for security and reliability.

change working-directory from bare ~ which does not work to ${{ github.workspace }} which works in GitHub Actions and also in local runners like 'act' https://github.com/nektos/act

add name: and id: keys

Summary by CodeRabbit

  • Chores
    • Overhauled CI workflows (concurrency, expanded matrices, caching, logging/artifacts), added local CI helper script and updated .gitignore.
  • Compatibility
    • Bumped extension to 4.0.0 and raised required MediaWiki minimum to >= 1.43.0.
  • Documentation
    • Updated README and test docs with platform requirements, installer note and 4.0.0 release notes.
  • Internationalization
    • Added Chechen locale and expanded Brazilian Portuguese message keys.
  • Tests
    • Added parser tests and new test runner target for MW 1.43; updated test harness and integration tests.

@coderabbitai

coderabbitai Bot commented Dec 11, 2025

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 98e5ca76-c7d4-4dd3-9664-f536e3ee49ae

📥 Commits

Reviewing files that changed from the base of the PR and between 4d962d1 and 852e97d.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml

📝 Walkthrough

Walkthrough

Refactors CI workflow and adds local CI tooling; introduces MW 1.43-specific parser tests and test harness updates; bumps extension to 4.0.0 and raises MediaWiki requirement to >=1.43.0; standardizes MediaWiki FQCN imports across source/tests; updates docs and i18n (adds ce, expands pt-br).

Changes

Cohort / File(s) Summary
CI workflow
\.github/workflows/ci\.yml
Reworked GitHub Actions: added concurrency, updated PHPUnit/static-analysis/code-style matrices (add REL1_44 / PHP 8.4), added pdo_sqlite & php-ast, improved cache keys & restore logic, restructured checkout/composer steps, added JUnit output + artifact, conditional Codecov action and coverage artifact, and refined parser-test conditions.
Local CI & ignores
\.gitignore, test-ci\.sh
Added ignores for local CI artifacts (.actrc, *.log, mediawiki/, EarlyCopy/) and new test-ci.sh script to run CI jobs locally with act (supports test/static-analysis/code-style/all/list).
Make targets & build
Makefile
Added parser-mw143 phony target and included it in .PHONY, invoking parser tests with parserTests-mw143.txt.
Extension metadata & docs
extension\.json, README\.md
Bumped extension version 3.0.14.0.0 and raised requires.MediaWiki >=1.39.0>=1.43.0; updated README with 4.x baseline, release notes, and installer guidance.
Parser tests & docs
tests/parser/parserTests-mw143\.txt, tests/parser/parserTests\.txt, tests/parser/README\.md
Added MW 1.43-specific parser test file; adjusted expected HTML class ordering in existing parser tests; documented MW 1.43 vs 1.44+ differences and test run instructions.
Source & tests — namespace/import changes
src files: src/... (e.g. src/Adapters/.../CategoryUsageTracker.php, src/Adapters/.../ParserFunctionEmbedPresenter.php, src/Adapters/.../ParserFunctionEmbedResourceLoader.php, src/Domain/.../CodeRenderer.php, src/EntryPoints/.../BitbucketFunction.php, src/EntryPoints/.../EmbedFunction.php, src/EntryPoints/.../MediaWikiHooks.php)
tests: tests/... (e.g. tests/Integration/EmbedFunctionIntegrationTest.php, tests/Integration/EmbedFunctionSystemTest.php, tests/TestEnvironment.php)
Replaced local/global imports with fully-qualified MediaWiki namespaces (e.g., MediaWiki\Parser\Parser, MediaWiki\Html\Html, MediaWiki\Parser\ParserOutput, MediaWiki\Title\Title, MediaWiki\User\User). Updated TestEnvironment and integration tests to construct ParserOptions with a system user, supply a context Title, call runOutputPipeline, and use getContentHolderText.
i18n locale files
i18n/ce\.json, i18n/pt-br\.json
Added Chechen locale i18n/ce.json; expanded i18n/pt-br.json with multiple external-content message keys (fetch failures, domain/URL issues, tracking category keys).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title "REL1_43 REL1_44 compatibility" is vague and uses non-descriptive abbreviations that don't convey the full scope of changes. While it references version compatibility, it doesn't clearly explain that the PR involves CI workflow improvements, version bumps, API namespace updates, and new translations. Consider a more descriptive title like "Update CI workflow and add REL1_43/REL1_44 compatibility" or "Bump to 4.0.0 with REL1_43 and REL1_44 support" to better reflect the primary changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@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: 2

🧹 Nitpick comments (4)
test-ci.sh (2)

27-32: Hardcoded MediaWiki and PHP versions in the "all" command lack consistency.

The all command hardcodes REL1_43 and 8.3 instead of using the script parameters, limiting flexibility and creating divergence from the test command behavior.

  all)
-   echo "Running all jobs with REL1_43..."
+   echo "Running all jobs with $MW_VERSION..."
    act -j static-analysis --verbose
    act -j code-style --verbose
-   act -j test --matrix mw:REL1_43 --matrix php:8.3 --matrix experimental:false --verbose
+   act -j test --matrix mw:"$MW_VERSION" --matrix php:"$PHP_VERSION" --matrix experimental:false --verbose

1-5: Add a guard clause to verify act is installed.

The script will fail with an unclear error if act is not available. Consider adding a dependency check.

#!/bin/bash
# Helper script to test CI workflow locally with act
# Usage: ./test-ci.sh [job-name] [mw-version] [php-version]

set -e

# Verify act is installed
if ! command -v act &> /dev/null; then
  echo "Error: 'act' is not installed. See: https://github.com/nektos/act"
  exit 1
fi
.gitignore (1)

5-9: Add inline comment to clarify local testing artifacts.

Consider adding a brief comment above the local testing section to document why these patterns are ignored.

  vendor/
  
+ # Local CI/testing artifacts (act, generated directories, logs)
  .actrc
  *.log
  mediawiki/
  EarlyCopy/
.github/workflows/ci.yml (1)

126-128: Document why parser tests are limited to REL1_43 and master.

Parser tests are conditionally executed only on REL1_43 || master. This may be intentional to save CI resources, but the rationale should be documented.

Add an inline comment:

      - name: Run parser tests (explicit targets)
        if: matrix.mw == 'REL1_43' || matrix.mw == 'master'
+       # Parser tests are resource-intensive; only run on latest stable and development branches
        run: php tests/parser/parserTests.php --file=extensions/ExternalContent/tests/parser/parserTests.txt
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c1c291c and a68e829.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml (9 hunks)
  • .gitignore (1 hunks)
  • test-ci.sh (1 hunks)
🔇 Additional comments (5)
.github/workflows/ci.yml (5)

7-9: Concurrency configuration is correct.

The workflow properly cancels in-progress runs and groups by ref/head_ref to prevent duplicate execution.


50-50: PHP extensions are correctly and consistently configured across jobs.

The additions of pdo_sqlite and php-ast are appropriate for MediaWiki compatibility and psalm analysis.

Also applies to: 150-150, 220-220


75-94: Checkout and installation steps are well-structured and clearly named.

The explicit step naming, conditional MediaWiki installation, and working-directory overrides correctly handle the multi-stage checkout and setup process.


130-199: Static-analysis job is well-structured with clear step naming.

The separation of PHPStan and Psalm steps with explicit names improves readability and debugging.


200-265: Code-style job structure is appropriate.

The job properly isolates code-style checking and uses the correct tools. However, the cache key collision issue flagged earlier also affects this job.

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
@@ -130,23 +159,29 @@ jobs:
!mediawiki/extensions/
!mediawiki/vendor/
key: mw_static_analysis

@coderabbitai coderabbitai Bot Dec 11, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Cache key collision: static-analysis and code-style share the same MediaWiki cache.

Both jobs use key: mw_static_analysis, causing them to share a single cached MediaWiki installation. If their dependencies differ or if one job modifies the cache, it could corrupt the other job's environment.

Assign distinct cache keys:

  # In static-analysis job (line 161):
- key: mw_static_analysis
+ key: mw_static_analysis_php${{ matrix.php }}

  # In code-style job (line 231):
- key: mw_static_analysis
+ key: mw_code_style_php${{ matrix.php }}

Or if these jobs are truly identical and can safely share a cache, document this intention and add a comment explaining why the shared key is acceptable.

Also applies to: 231-231

🤖 Prompt for AI Agents
.github/workflows/ci.yml around line 161 (and also line 231): the
static-analysis and code-style jobs both use the identical cache key
`mw_static_analysis`, causing a cache collision; change each job to use a
distinct, descriptive cache key (for example include the job name or purpose and
optionally the OS/hash) such as `mw_static_analysis-${{ matrix.os
}}-static-analysis` and `mw_static_analysis-${{ matrix.os }}-code-style`, or if
sharing is intentional add a comment above both keys explaining why a shared
cache is safe and keep a single shared key.

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.

adding a comment to indicate that a shared cache is intentional

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@freephile, thank you for addressing this! Adding a comment to document that the shared cache between static-analysis and code-style is intentional is exactly the right approach. This will help future maintainers understand that both jobs can safely use the same MediaWiki cache since they have identical requirements.

The comment will clarify that sharing key: mw_static_analysis is by design and prevent confusion down the road. 👍

translatewiki and others added 8 commits December 11, 2025 10:14
improve caching:
- Cache Composer v2 path (~/.cache/composer)
- Scope cache keys with hashFiles('**/composer.lock') so caches are invalidated when deps change, and use restore-keys.

add junit.xml log output for visibility of test failures

replace curl | bash codecov upload with the official action codecov/codecov-action@v4 for security and reliability.

change working-directory from bare ~ which does not work to ${{ github.workspace }} which works in GitHub Actions and also in local runners like 'act'  https://github.com/nektos/act

add name: and id: keys
If you install 'act' on your host, you can use it with Docker to run
all GitHub Actions locally *before* you commit to test changes
https://github.com/nektos/act
…able for all jobs

pdo_sqlite is needed by act for local testing
@freephile

Copy link
Copy Markdown
Contributor Author

Sorry, I just realized that the prior work I was trying to build on was in the mw44 branch. I'll rebase these workflow changes onto the mw44 branch; make the suggested test enhancements; respond to CodeRabbit suggestions; run full GitHub Actions pipelines locally and in my fork with a force push which will finally provide an updated PR.

- add `make parser-mw143` target for testing 1.43
- add REL1_44 to matrixes for static analysis and code style
- add comment that a shared MW Core cache is ok for static analysis and code style tests.
- use `continue-one-error: true` for intentional non-blocking steps
- add README.md for describing the tests

@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)
Makefile (1)

1-1: Optionally add parser-mw143 to .PHONY

The new parser-mw143 target is fine; consider marking it as phony to avoid any future confusion with a real file of the same name:

-.PHONY: ci test cs phpunit phpcs stan psalm parser
+.PHONY: ci test cs phpunit phpcs stan psalm parser parser-mw143

Also applies to: 22-23

.github/workflows/ci.yml (1)

118-125: Parser test condition relies on lexicographic string comparison, which is fragile.

The condition if: matrix.mw >= 'REL1_43' || matrix.mw == 'master' works correctly for the current matrix values but is vulnerable to future version naming schemes. For example, if a branch like REL1_100 is added, the string comparison would fail ('REL1_100' < 'REL1_43' lexicographically).

A more robust approach would be to use an explicit list or a matrix-level boolean flag:

# Option 1: Explicit version list
if: matrix.mw == 'REL1_43' || matrix.mw == 'REL1_44' || matrix.mw == 'master'

# Option 2: Use a matrix flag (recommended for future flexibility)
# In the test job matrix, add a flag like:
#   - mw: 'REL1_43'
#     run-parser-tests: true
#     parser-test-file: 'parserTests-mw143.txt'
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a68e829 and 3f7482c.

📒 Files selected for processing (21)
  • .github/workflows/ci.yml (12 hunks)
  • .gitignore (1 hunks)
  • Makefile (1 hunks)
  • README.md (2 hunks)
  • extension.json (2 hunks)
  • i18n/ce.json (1 hunks)
  • i18n/pt-br.json (1 hunks)
  • src/Adapters/EmbedPresenter/CategoryUsageTracker.php (1 hunks)
  • src/Adapters/EmbedPresenter/ParserFunctionEmbedPresenter.php (1 hunks)
  • src/Adapters/EmbedResourceLoader/ParserFunctionEmbedResourceLoader.php (1 hunks)
  • src/Domain/ContentRenderer/CodeRenderer.php (2 hunks)
  • src/EntryPoints/BitbucketFunction.php (1 hunks)
  • src/EntryPoints/EmbedFunction.php (1 hunks)
  • src/EntryPoints/MediaWikiHooks.php (1 hunks)
  • test-ci.sh (1 hunks)
  • tests/Integration/EmbedFunctionIntegrationTest.php (2 hunks)
  • tests/Integration/EmbedFunctionSystemTest.php (1 hunks)
  • tests/TestEnvironment.php (1 hunks)
  • tests/parser/README.md (1 hunks)
  • tests/parser/parserTests-mw143.txt (1 hunks)
  • tests/parser/parserTests.txt (3 hunks)
✅ Files skipped from review due to trivial changes (2)
  • i18n/ce.json
  • tests/parser/README.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • test-ci.sh
  • .gitignore
🧰 Additional context used
🪛 GitHub Actions: CI
tests/TestEnvironment.php

[error] 30-30: PHPUnit test failure: Call to undefined method MediaWiki\Parser\ParserOutput::getText(). This caused 13 test errors and exit code 2. Likely incompatible MediaWiki version or API change; update tests or code to align with current ParserOutput API. Command failed: 'php tests/phpunit/phpunit.php -c extensions/ExternalContent/ --log-junit tests/junit.xml' (exit code 2).

🪛 LanguageTool
tests/parser/parserTests-mw143.txt

[style] ~50-~50: Using many exclamation marks might seem excessive (in this case: 42 exclamation marks for a text that’s 1015 characters long)
Context: ...#embed:https://localhost/whatever.hax}} !! html <div class="cdx-message cdx-messag...

(EN_EXCESSIVE_EXCLAMATION)

🔇 Additional comments (21)
src/EntryPoints/MediaWikiHooks.php (1)

7-11: LGTM! Namespace updates align with MediaWiki standards.

The fully-qualified MediaWiki namespace imports are correct and consistent with MediaWiki's namespace refactoring.

src/EntryPoints/BitbucketFunction.php (1)

7-7: LGTM! Parser namespace update is consistent.

The fully-qualified Parser import aligns with the project-wide namespace standardization.

tests/Integration/EmbedFunctionIntegrationTest.php (1)

10-10: LGTM! Import and usage updated consistently.

The explicit Title import and updated usage at line 58 properly align with the namespace standardization effort.

Also applies to: 58-58

src/Domain/ContentRenderer/CodeRenderer.php (1)

7-7: LGTM! Html namespace update is correct.

The fully-qualified Html import aligns with MediaWiki's namespace structure.

src/Adapters/EmbedPresenter/ParserFunctionEmbedPresenter.php (1)

7-7: LGTM! Html namespace standardization is correct.

The fully-qualified Html import is consistent with the project-wide namespace updates.

tests/TestEnvironment.php (2)

8-8: LGTM! Title namespace import is correct.

The fully-qualified Title import aligns with MediaWiki's namespace structure.


24-31: The ParserOutput::getText() call is valid in MediaWiki 1.43 and requires no changes. The method accepts an optional array $options = [] parameter. Using getRawText() instead would be incorrect, as it returns cacheable HTML with parser markers still present, not the display-ready HTML that getText() provides. If test failures are occurring, verify the actual error messages, as they are unlikely to be caused by this API call.

src/Adapters/EmbedPresenter/CategoryUsageTracker.php (1)

7-7: LGTM! Parser namespace import is consistent.

The fully-qualified Parser import aligns with the project-wide namespace standardization.

src/EntryPoints/EmbedFunction.php (1)

7-7: LGTM! Parser namespace update is correct.

The fully-qualified Parser import is consistent with the namespace standardization across the codebase.

src/Adapters/EmbedResourceLoader/ParserFunctionEmbedResourceLoader.php (1)

7-22: Namespaced ParserOutput usage is consistent and safe

Switching to MediaWiki\Parser\ParserOutput in the import and constructor keeps behavior unchanged and matches the newer MediaWiki naming; no issues spotted.

tests/Integration/EmbedFunctionSystemTest.php (1)

9-10: Update to namespaced Title/User matches core APIs

Using MediaWiki\Title\Title and MediaWiki\User\User in the tests is consistent with current core APIs and keeps the test behavior identical.

Also applies to: 43-71

tests/parser/parserTests.txt (1)

25-53: Class order change in expected HTML is non-breaking

Only the CSS class ordering in the expected error <div>s changed; content and structure are the same, so this is a safe adjustment to match current output.

README.md (1)

100-106: 4.x requirements, install instructions, and release notes are consistent

The documented PHP/MW requirements, Composer constraint ~4.0, and the 4.0.0 release notes all line up with the new extension version and support policy.

Also applies to: 113-114, 249-255

extension.json (1)

3-3: Confirm intentional drop of MediaWiki 1.39–1.42 support

Bumping to version 4.0.0 and requiring MediaWiki >= 1.43.0 matches the new README/platform requirements, but it will stop this extension from loading on 1.39–1.42 even if it was previously compatible—please confirm this support change is intentional.

Also applies to: 15-19

tests/parser/parserTests-mw143.txt (1)

1-53: New MW 1.43 parser tests mirror existing coverage correctly

These tests reproduce the key scenarios with the MW 1.43-specific class ordering and configs, so they cleanly separate 1.43 behavior from newer versions.

i18n/pt-br.json (1)

8-18: pt-BR messages correctly cover new error and category keys

The added pt-BR translations align with the existing message keys and tracking categories and are syntactically valid JSON.

.github/workflows/ci.yml (5)

7-9: ✓ Concurrency control is correctly configured.

The concurrency group uses github.head_ref || github.ref to deduplicate runs for the same PR/branch while canceling older runs. This is the standard, safe approach.


44-65: ✓ Caching strategy is well-structured with cascading restore-keys.

The MediaWiki cache key includes runner.os and matrix.php to avoid collisions across different environments, and the restore-keys properly cascade from specific to general. The Composer cache uses the standard ~/.cache/composer path for Composer v2 and includes hashFiles('**/composer.lock') for dependency tracking.


90-116: ✓ PHPUnit, junit, and coverage uploads are properly configured.

The continue-on-error: true flag on PHPUnit makes the non-blocking intent explicit, junit.xml is created by the --log-junit flag even on test failure, and coverage upload is correctly gated to the master branch only. The upgrade to codecov/codecov-action@v4 is the secure, recommended approach.


127-199: ✓ Static-analysis and code-style jobs are well-structured.

The matrices correctly focus on REL1_43 and REL1_44, omitting the experimental 'master' branch—a reasonable choice for linting jobs. Step names are clear, extensions are consistent with the test job, and the shared cache key is properly documented.


66-80: ✓ Checkout and working-directory configuration is clear and well-organized.

The two-step checkout pattern (EarlyCopy at the repo root, then extension into MediaWiki tree) avoids cache busting and is consistent across all jobs. Working directory switches are explicit and correct.

Also applies to: 174-187, 248-261

MediaWiki core locks psalm to ^4.3.0

@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 (1)
.github/workflows/ci.yml (1)

166-173: Minor: Composer cache key naming slightly misleading given shared usage.

Both static-analysis and code-style jobs use the identical Composer cache key composer_static_analysis-${{ hashFiles('**/composer.lock') }}. The key name suggests it belongs to static-analysis, but it's intentionally shared with code-style. Consider renaming to something more neutral like composer_shared- or adding an inline comment explaining the sharing (similar to the MediaWiki cache comments above).

Also applies to: 243-250

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f7482c and c41cdd2.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml (12 hunks)
  • test-ci.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test-ci.sh
🔇 Additional comments (6)
.github/workflows/ci.yml (6)

7-9: Concurrency group properly prevents duplicate workflow runs.

The concurrency setup correctly groups runs by workflow name and ref, with cancel-in-progress: true to avoid redundant executions.


44-65: Cache strategy is well-structured with proper restore-keys fallback.

The MediaWiki and Composer caching uses appropriate fallback chains: mw_${{ matrix.mw }}-php${{ matrix.php }}-${{ runner.os }}mw_${{ matrix.mw }}-php${{ matrix.php }}-mw_${{ matrix.mw }}-, and Composer cache moved to ~/.cache/composer with hash-based key invalidation. This reduces build times across runs.


90-116: JUnit and code coverage artifact uploads are properly implemented.

JUnit output is captured and uploaded per matrix entry; code coverage is correctly scoped to master-only runs with conditional codecov-action@v4 upload. The continue-on-error: true flags on both steps allow the workflow to continue even if tests fail, which is appropriate for non-blocking steps.


198-202: Psalm skip condition for PHP 8.4 is reasonable and documented.

Skipping Psalm on PHP 8.4 due to MediaWiki core's psalm 4.x lock is a pragmatic temporary workaround. The condition and inline comment clarify the rationale. Consider tracking this as a follow-up once MediaWiki core upgrades to psalm 5.x.


160-164: Shared MediaWiki cache between static-analysis and code-style is properly documented.

Both jobs use the same key: mw_static_analysis with comments explaining the cache is safe to share. Previous review feedback has been incorporated. Maintain these comments in future edits to prevent accidental cache key divergence.

Also applies to: 237-241


119-125: Critical: Parser test condition will skip master branch due to lexicographic string comparison.

The condition if: matrix.mw >= 'REL1_43' uses lexicographic (alphabetical) string comparison, not semantic version comparison. In GitHub Actions, 'master' >= 'REL1_43' evaluates to false because 'm' < 'R' alphabetically. This means parser tests will not run for the master matrix entry.

Replace the string comparison with explicit version matching:

-      - name: Run parser tests (explicit targets)
-        if: matrix.mw >= 'REL1_43' || matrix.mw == 'master'
+      - name: Run parser tests (explicit targets)
+        if: matrix.mw == 'REL1_43' || matrix.mw == 'REL1_44' || matrix.mw == 'master'

Alternatively, if you plan to support only REL1_43 and later:

-        if: matrix.mw >= 'REL1_43' || matrix.mw == 'master'
+        if: matrix.mw != 'REL1_42'

Likely an incorrect or invalid review comment.

@freephile

Copy link
Copy Markdown
Contributor Author

this iteration on the mw44 branch seems good LGTM

@freephile freephile changed the title This appears to pass all tests for the matrix - except for REL1_41 REL1_43 REL1_44 compatibility Dec 11, 2025
Use runOutputPipeline instead (available since 1.43), as getText
is being removed in MW 1.45.
Also use namespaced imports for ParserOptions and User.

@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 (3)
tests/TestEnvironment.php (3)

13-17: Reconsider extending TestCase with direct instantiation.

The class extends PHPUnit\Framework\TestCase but is instantiated via instance() calling new self(). PHPUnit's TestCase is designed to be constructed by the test runner with specific parameters. Direct instantiation bypasses PHPUnit's lifecycle management and may cause issues if any inherited TestCase methods are invoked.

If TestCase functionality is not required (no assertions, fixtures, etc. are used in this class), consider removing the inheritance to avoid potential issues.

-class TestEnvironment extends TestCase {
+class TestEnvironment {

36-36: Remove trailing whitespace.

Line 36 contains trailing whitespace on an otherwise empty line.


37-43: Simplify code by removing dead fallback for older MediaWiki versions.

The extension requires MediaWiki >= 1.43.0, which guarantees that getContentHolderText() is available. The method_exists() check and fallback to getText() are unnecessary. Simplify to:

-		// getContentHolderText() is available in MediaWiki 1.43+
-		if ( method_exists( $parserOutput, 'getContentHolderText' ) ) {
-			return $parserOutput->runOutputPipeline( $parserOptions )
-			->getContentHolderText();
-		}
-		// MediaWiki 1.44+ removed getText() in favor of getContentHolderText()
-		return $parserOutput->getText();
+		return $parserOutput->runOutputPipeline( $parserOptions )
+			->getContentHolderText();
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c41cdd2 and 76d4676.

📒 Files selected for processing (2)
  • test-ci.sh (1 hunks)
  • tests/TestEnvironment.php (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test-ci.sh
🧰 Additional context used
🧬 Code graph analysis (1)
tests/TestEnvironment.php (1)
src/EmbedExtensionFactory.php (1)
  • getInstance (37-40)
🔇 Additional comments (2)
tests/TestEnvironment.php (2)

8-11: LGTM!

The imports correctly use the MediaWiki namespaced classes (MediaWiki\Parser\ParserOptions, MediaWiki\Title\Title, MediaWiki\User\User) which aligns with the MW 1.43+ compatibility goal.


28-35: Parser setup looks appropriate for test context.

Using User::newSystemUser('TestUser') for ParserOptions and providing a default context page is a reasonable approach for integration tests. The system user avoids dependency on real user accounts.

Use runOutputPipeline instead (available since 1.43), as getText
is being removed in MW 1.45.
Also use namespaced imports for ParserOptions and User.
@codecov-commenter

codecov-commenter commented Dec 15, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.03%. Comparing base (934b8ff) to head (4d962d1).
⚠️ Report is 65 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (934b8ff) and HEAD (4d962d1). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (934b8ff) HEAD (4d962d1)
2 1
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #78      +/-   ##
============================================
- Coverage     98.25%   92.03%   -6.22%     
- Complexity      112      138      +26     
============================================
  Files            20       27       +7     
  Lines           286      402     +116     
============================================
+ Hits            281      370      +89     
- Misses            5       32      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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 (1)
tests/Integration/EmbedFunctionIntegrationTest.php (1)

57-69: ParserOptions and output-pipeline handling look correct; consider clarifying intent / reusing helper

The new ParserOptions + Title usage and the getContentHolderText vs getText branching mirror the compatibility logic in tests/TestEnvironment.php::parse, which is good for MW 1.41–1.44 support.

Two small, optional improvements:

  • Since the return values of runOutputPipeline(...)->getContentHolderText() / getText() are ignored and you rely only on side effects (category tracking), consider either assigning to a throwaway variable or adding a brief comment that the calls are intentionally unused, to avoid looking like an oversight.
  • You might also consider extracting this parse/output-pipeline block into a shared helper (similar to TestEnvironment::parse) to avoid duplicating version-compatibility logic in multiple places.

These are purely readability/DRY suggestions; the current behavior is fine.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76d4676 and a9d53a9.

📒 Files selected for processing (1)
  • tests/Integration/EmbedFunctionIntegrationTest.php (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/Integration/EmbedFunctionIntegrationTest.php (1)
tests/TestEnvironment.php (1)
  • parse (27-44)
🔇 Additional comments (1)
tests/Integration/EmbedFunctionIntegrationTest.php (1)

10-12: New MediaWiki imports are appropriate and consistent

The added ParserOptions, Title, and User imports are all used in testUsageIsTracked and match the MediaWiki namespaces used elsewhere in the tests; no issues here.

@freephile

Copy link
Copy Markdown
Contributor Author

Finally have all tests passing, including MW master

Use runOutputPipeline()->getContentHolderText() instead of getText(); but preserve the latter for backwards compatibility.

Similar to Network extension ProfessionalWiki/Network@5c4470f

The extension requires MediaWiki >= 1.43.0 which guarantees
that getDContentHolderText() is available.

no CI
TestEnvironment is a utility/helper class that provides methods for tests to use, but it's not itself a test case.
It doesn't need to extend TestCase and doing so was incorrect since it's being manually instantiated rather
than run by PHPUnit's test runner.

no CI

@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 (1)
tests/Integration/EmbedFunctionIntegrationTest.php (1)

57-64: Discarded return value may warrant a comment.

Line 64 executes runOutputPipeline()->getContentHolderText() but discards the result. If this is intentional (e.g., to trigger side effects that finalize category tracking), consider adding a brief comment to clarify. Alternatively, if the result might be useful for future assertions, capture it in a variable.

-		$parserOutput->runOutputPipeline( $parserOptions )->getContentHolderText();
+		// Run the output pipeline to finalize parser state before checking categories
+		$parserOutput->runOutputPipeline( $parserOptions )->getContentHolderText();
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a9d53a9 and 9efe8a2.

📒 Files selected for processing (2)
  • tests/Integration/EmbedFunctionIntegrationTest.php (2 hunks)
  • tests/TestEnvironment.php (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/Integration/EmbedFunctionIntegrationTest.php (1)
tests/TestEnvironment.php (1)
  • parse (26-38)
🔇 Additional comments (3)
tests/Integration/EmbedFunctionIntegrationTest.php (1)

10-12: LGTM on the updated imports.

The fully-qualified MediaWiki namespace classes align with MW 1.43+ API conventions and are consistent with changes in TestEnvironment.php.

tests/TestEnvironment.php (2)

8-10: LGTM on the updated imports.

The fully-qualified MediaWiki namespace classes properly align with MW 1.43+ API conventions.


26-37: Clean implementation of MW 1.43+ parser API.

The refactored parse() method correctly uses ParserOptions with a system user and routes through runOutputPipeline()->getContentHolderText(), which is the modern MediaWiki approach for obtaining processed parser output. The getContentHolderText() method is a stable convenience accessor for the rendered content holder, and the pipeline-based pattern aligns with MediaWiki's recommended approach for post-processing parser output.

parser-mw143 is not a physical file
avoid weak string comparison which is vulnerable to failure or ambiguity

@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

♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)

127-151: Static-analysis job: shared MW/composer caches and Psalm gating are reasonable

  • Matrix for REL1_43/PHP 8.3 and REL1_44/PHP 8.4 gives coverage on the supported branches without over‑expanding permutations.
  • setup-php mirrors the test job (including pdo_sqlite and php-ast), which keeps runtime vs static environments consistent.
  • MediaWiki cache:
    • The shared mw_static_analysis cache key between static-analysis and code-style is now clearly documented as intentional.
    • Since both jobs consume the same MW core without mutating it, this shared key is acceptable and saves install time; just keep the comment accurate if the jobs diverge in the future.
  • Composer cache:
    • Central composer_shared-${{ hashFiles('**/composer.lock') }} key across the analysis/style jobs is fine, given they rely on the same lockfiles.
  • EarlyCopy checkout + “Install MediaWiki (if needed)” with working-directory: ${{ github.workspace }} matches the test job and improves runner/act compatibility.
  • Psalm:
    • Skipping Psalm on PHP 8.4 because MW locks Psalm to ^4.3 is a pragmatic guardrail.
    • This is a good place for a future follow‑up once MediaWiki bumps Psalm (e.g., a TODO or tracking issue), but the current condition is correct.

Overall this job is well‑structured and consistent with the test job; no blocking issues from these changes.

Also applies to: 152-165, 166-173, 174-188, 189-197, 198-203

🧹 Nitpick comments (2)
Makefile (1)

1-1: New parser-mw143 target is consistent and safe

The additional phony target and parser-mw143 rule cleanly wire up the MW 1.43‑specific parser tests and match how CI calls parserTests-mw143.txt. No functional issues here.

Static analysis warnings about missing phony all / clean are repo‑wide style concerns rather than regressions from this change; only address them if you want to appease checkmake (e.g., by adding aggregator / no‑op targets later).

Also applies to: 19-23

.github/workflows/ci.yml (1)

7-9: Test job: concurrency, matrix, caching, coverage, and parser tests look coherent

  • The concurrency group using ${{ github.workflow }}-${{ github.head_ref || github.ref }} is a solid way to cancel redundant runs per ref.
  • Matrix entries for REL1_43 (PHP 8.3), REL1_44 (PHP 8.4), and master (PHP 8.4, experimental) align with the stated compatibility goals.
  • Adding pdo_sqlite and php-ast in setup-php matches later usage (sqlite in MW, php-ast for static tools) and should be safe in CI.
  • MediaWiki caching:
    • Keyed by MW version, PHP, and runner OS with restore‑keys by MW/PHP is a good balance of isolation and reuse.
    • Excluding mediawiki/extensions/ and mediawiki/vendor/ ensures core is cached while extension + vendor are refreshed per run.
  • Composer cache:
    • Caching ~/.cache/composer per PHP version + hashFiles('**/composer.lock') will give stable re‑use while still invalidating on lockfile changes.
  • Split checkout (EarlyCopy for scripts and a second checkout into mediawiki/extensions/ExternalContent) is a clean pattern and plays well with the MediaWiki installer script.
  • Switching Install MediaWiki to run with working-directory: ${{ github.workspace }} is the right fix for both GitHub‑hosted runners and act.
  • PHPUnit:
    • A first run with JUnit logging and continue-on-error: true guarantees test results are captured and artifacts uploaded even on failures.
    • A second run with coverage gated to matrix.mw == 'master' keeps the heavier coverage work scoped to master only.
    • Using Codecov’s v4 action with continue-on-error: true means coverage upload issues won’t break the build, which is appropriate.
  • Parser tests:
    • The explicit REL1_43 branch to use parserTests-mw143.txt and the default path for REL1_44/master match the new Makefile target and parser test files.
    • Conditions on matrix.mw make the intent clear and match the matrix values.

Only optional thought: for master you now run PHPUnit twice (once for JUnit, once for coverage). If CI time ever becomes a concern, you could consolidate into a single run that writes both JUnit and Clover outputs, but what you have is perfectly acceptable.

Also applies to: 16-29, 36-41, 44-56, 57-65, 66-80, 81-89, 90-99, 100-117, 118-125

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9efe8a2 and bed3485.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml (12 hunks)
  • Makefile (2 hunks)
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile

[warning] 1-1: Missing required phony target "all"

(minphony)


[warning] 1-1: Missing required phony target "clean"

(minphony)

🔇 Additional comments (1)
.github/workflows/ci.yml (1)

204-227: Code-style job: mirrors static-analysis structure; cache and setup choices look good

  • Matrix for code-style matches static-analysis (REL1_43/PHP 8.3 and REL1_44/PHP 8.4), which keeps style checks aligned with supported targets.
  • PHP setup and extensions (including pdo_sqlite and php-ast) mirror other jobs, avoiding environment drift.
  • MediaWiki and composer caches are intentionally shared with static-analysis and documented, which is acceptable as long as both jobs continue to use the same MW core and composer setup.
  • The EarlyCopy checkout + conditional MediaWiki install from ${{ github.workspace }} keeps this job consistent with the others and compatible with local runners.
  • Running composer install in mediawiki/extensions/ExternalContent before vendor/bin/phpcs is the right order.

The naming tweak to “PHP CodeSniffer” also makes the last step’s purpose clearer. No further changes needed here.

Also applies to: 229-242, 243-250, 251-265, 266-271, 272-273

@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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bed3485 and b1e386c.

📒 Files selected for processing (1)
  • tests/Integration/EmbedFunctionIntegrationTest.php (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/Integration/EmbedFunctionIntegrationTest.php (2)
tests/TestEnvironment.php (1)
  • parse (26-38)
src/EmbedExtensionFactory.php (1)
  • getInstance (37-40)
🔇 Additional comments (2)
tests/Integration/EmbedFunctionIntegrationTest.php (2)

10-12: LGTM! Standardized FQCN imports for MW 1.43+ compatibility.

The fully-qualified class name imports for ParserOptions, Title, and User are necessary for the updated parser API usage and align with the PR's goal to standardize MediaWiki imports.


70-74: LGTM! Assertions correctly updated.

The assertions now reference $parserOutput consistently, which properly reflects the refactored parser invocation pattern.

Comment thread tests/Integration/EmbedFunctionIntegrationTest.php Outdated
The runOutputPipeline() call is necessary to populate categories and other metadata, but we need to use the returned object for the assertions.
@freephile

Copy link
Copy Markdown
Contributor Author

bump

@freephile

Copy link
Copy Markdown
Contributor Author

note: because this commit is only on 'master', I still get the 'invalid magic word' error from update.php using version "~3.0" rather than 'dev-master'. This branch includes that fix (like master) and so I look forward to the new tag when it comes.

Copilot AI 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.

Pull request overview

This pull request upgrades the ExternalContent extension to support MediaWiki 1.43 and 1.44, marking a major version bump to 4.0.0. The changes primarily focus on namespace modernization, CI/CD improvements, and handling differences in MediaWiki's Codex message rendering between versions.

Changes:

  • Updated namespace imports from global to MediaWiki-namespaced classes (Parser, Title, User, Html, ContentHandler, ParserOutput, ParserOptions)
  • Enhanced GitHub Actions CI with improved caching, concurrency control, and secure codecov upload
  • Added version-specific parser tests to handle different Codex CSS class ordering between MW 1.43 and 1.44+
  • Added internationalization updates (Brazilian Portuguese expansion, new Chechen locale)
  • Updated minimum MediaWiki version from 1.39 to 1.43

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
extension.json Bumped version to 4.0.0 and raised minimum MediaWiki requirement to 1.43.0
README.md Updated platform requirements, installation instructions, and added 4.0.0 release notes
.github/workflows/ci.yml Overhauled CI with concurrency groups, expanded matrices (REL1_43, REL1_44), improved caching, and secure codecov integration
src/EntryPoints/*.php Updated imports to use MediaWiki\Parser\Parser namespace
src/Domain/ContentRenderer/CodeRenderer.php Updated Html import to MediaWiki\Html\Html and removed trailing whitespace
src/Adapters/**/*.php Updated Parser, ParserOutput, and Html imports to use MediaWiki namespaces
tests/TestEnvironment.php Updated to use namespaced classes and new runOutputPipeline() API for MW 1.43+
tests/Integration/*.php Updated imports to use MediaWiki\Title\Title, MediaWiki\User\User, and MediaWiki\Parser\ParserOptions
tests/parser/parserTests.txt Updated expected HTML to reflect MW 1.44+ Codex class ordering
tests/parser/parserTests-mw143.txt Added MW 1.43-specific parser tests with legacy Codex class ordering
tests/parser/README.md Added documentation explaining version differences and test execution
Makefile Added parser-mw143 target for running MW 1.43 parser tests
test-ci.sh Added helper script for local CI testing with 'act'
.gitignore Added entries for local CI/testing artifacts
i18n/pt-br.json Expanded translations with additional message keys
i18n/ce.json Added new Chechen locale with full translations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
Comment on lines 197 to +241
key: mw_static_analysis
restore-keys: |
mw_static_analysis

Copilot AI Jan 28, 2026

Copy link

Choose a reason for hiding this comment

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

The cache key 'mw_static_analysis' is shared across different MediaWiki versions (REL1_43 and REL1_44) in the matrix. This will cause cache conflicts where one version's MediaWiki installation may be used for the other version. The cache key should include the matrix.mw variable to differentiate between versions, for example: 'mw_static_analysis_${{ matrix.mw }}'.

Suggested change
key: mw_static_analysis
restore-keys: |
mw_static_analysis
key: mw_static_analysis_${{ matrix.mw }}
restore-keys: |
mw_static_analysis_${{ matrix.mw }}

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
Comment on lines +109 to +116
files: coverage.xml

- name: Run parser tests
run: php tests/parser/parserTests.php --file=extensions/ExternalContent/tests/parser/parserTests.txt
if: matrix.mw >= 'REL1_43'
- name: Upload coverage artifact (master only)
if: matrix.mw == 'master'
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.mw }}-php${{ matrix.php }}
path: coverage.xml

Copilot AI Jan 28, 2026

Copy link

Choose a reason for hiding this comment

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

The path to the coverage.xml file may be incorrect. The file is written to 'coverage.xml' relative to the 'mediawiki' working directory (line 102), which means it's at 'mediawiki/coverage.xml' from the workspace root. The codecov-action and upload-artifact actions run from the workspace root, so the path should be 'mediawiki/coverage.xml' instead of 'coverage.xml'.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml
Comment on lines 132 to +164
key: mw_static_analysis
restore-keys: |
mw_static_analysis

Copilot AI Jan 28, 2026

Copy link

Choose a reason for hiding this comment

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

The cache key 'mw_static_analysis' is shared across different MediaWiki versions (REL1_43 and REL1_44) in the matrix. This will cause cache conflicts where one version's MediaWiki installation may be used for the other version. The cache key should include the matrix.mw variable to differentiate between versions, for example: 'mw_static_analysis_${{ matrix.mw }}'.

Suggested change
key: mw_static_analysis
restore-keys: |
mw_static_analysis
key: mw_static_analysis_${{ matrix.mw }}
restore-keys: |
mw_static_analysis_${{ matrix.mw }}

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/ci.yml

- name: Run PHPUnit
run: php tests/phpunit/phpunit.php -c extensions/ExternalContent/
- name: Run PHPUnit (junit)

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.

I am not sure about Junit. We are not consuming it anywhere in the CI pipeline, so it is not needed here.

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.

I'm not sure how the code coverage pipeline works, but the --log-junit option to PHPUnit produces a JUnit compatible log file which can be ingested by more coverage analysis tools.

Comment thread .github/workflows/ci.yml
- name: Run PHPUnit
run: php tests/phpunit/phpunit.php -c extensions/ExternalContent/
- name: Run PHPUnit (junit)
continue-on-error: true

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.

We should fail the CI pipeline if PHPUnit doesn't pass. This sliences the error.

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.

I have to come back to look at this in more detail to understand what I did but I believe the intention to "not fail" was simply to make coverage non-blocking... while test failures are blocking. In any case, project policies and preferences are to be respected.

Comment thread .github/workflows/ci.yml
- name: Upload code coverage (master only) securely
if: matrix.mw == 'master'
continue-on-error: true
uses: codecov/codecov-action@v4

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 needs a CODECOV_TOKEN. @malberts do we have one for this repo?

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.

Maybe just omit for now? I don't want to deal with this now and getting compat fixed is still nice

Comment thread .github/workflows/ci.yml
- name: Run parser tests
run: php tests/parser/parserTests.php --file=extensions/ExternalContent/tests/parser/parserTests.txt
if: matrix.mw >= 'REL1_43'
- name: Upload coverage artifact (master only)

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.

If we already have Codecov report, should we upload the coverage artifact from the CI?

fix path to junit.xml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

6 participants