-
Notifications
You must be signed in to change notification settings - Fork 7
REL1_43 REL1_44 compatibility #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 16 commits
71aedca
26cce25
df37c59
e85048f
33300cc
1ff9144
51c460d
c670288
7aa9268
9117772
0d66497
bc4927d
5d4ec00
80bfb0b
3f7482c
c41cdd2
4ee24c1
76d4676
a9d53a9
07b0db2
b7868a4
9efe8a2
1dc19de
a63aa76
bed3485
b1e386c
4d962d1
852e97d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,10 @@ on: | |||||||||||||
| push: | ||||||||||||||
| pull_request: | ||||||||||||||
|
|
||||||||||||||
| concurrency: | ||||||||||||||
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||||||||||||||
| cancel-in-progress: true | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| test: | ||||||||||||||
| name: "PHPUnit: MW ${{ matrix.mw }}, PHP ${{ matrix.php }}" | ||||||||||||||
|
|
@@ -13,21 +17,12 @@ jobs: | |||||||||||||
| fail-fast: false | ||||||||||||||
| matrix: | ||||||||||||||
| include: | ||||||||||||||
| - mw: 'REL1_39' | ||||||||||||||
| php: 8.1 | ||||||||||||||
| experimental: false | ||||||||||||||
| - mw: 'REL1_40' | ||||||||||||||
| php: 8.1 | ||||||||||||||
| experimental: false | ||||||||||||||
| - mw: 'REL1_41' | ||||||||||||||
| php: 8.2 | ||||||||||||||
| experimental: false | ||||||||||||||
| - mw: 'REL1_42' | ||||||||||||||
| php: 8.2 | ||||||||||||||
| experimental: false | ||||||||||||||
| - mw: 'REL1_43' | ||||||||||||||
| php: 8.3 | ||||||||||||||
| experimental: false | ||||||||||||||
| - mw: 'REL1_44' | ||||||||||||||
| php: 8.4 | ||||||||||||||
| experimental: false | ||||||||||||||
| - mw: 'master' | ||||||||||||||
| php: 8.4 | ||||||||||||||
| experimental: true | ||||||||||||||
|
|
@@ -43,7 +38,7 @@ jobs: | |||||||||||||
| uses: shivammathur/setup-php@v2 | ||||||||||||||
| with: | ||||||||||||||
| php-version: ${{ matrix.php }} | ||||||||||||||
| extensions: mbstring, intl | ||||||||||||||
| extensions: mbstring, intl, pdo_sqlite, php-ast | ||||||||||||||
| tools: composer | ||||||||||||||
|
|
||||||||||||||
| - name: Cache MediaWiki | ||||||||||||||
|
|
@@ -54,49 +49,80 @@ jobs: | |||||||||||||
| mediawiki | ||||||||||||||
| !mediawiki/extensions/ | ||||||||||||||
| !mediawiki/vendor/ | ||||||||||||||
| key: mw_${{ matrix.mw }}-php${{ matrix.php }} | ||||||||||||||
| key: mw_${{ matrix.mw }}-php${{ matrix.php }}-${{ runner.os }} | ||||||||||||||
| restore-keys: | | ||||||||||||||
| mw_${{ matrix.mw }}-php${{ matrix.php }}- | ||||||||||||||
| mw_${{ matrix.mw }}- | ||||||||||||||
|
|
||||||||||||||
| - name: Cache Composer cache | ||||||||||||||
| - name: Cache composer cache | ||||||||||||||
| id: cache-composer | ||||||||||||||
| uses: actions/cache@v4 | ||||||||||||||
| with: | ||||||||||||||
| path: ~/.composer/cache | ||||||||||||||
| key: composer-php${{ matrix.php }} | ||||||||||||||
| path: ~/.cache/composer | ||||||||||||||
| key: composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} | ||||||||||||||
| restore-keys: | | ||||||||||||||
| composer-${{ matrix.php }}- | ||||||||||||||
|
|
||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||
| - name: Checkout (EarlyCopy) | ||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||
| with: | ||||||||||||||
| path: EarlyCopy | ||||||||||||||
|
|
||||||||||||||
| - name: Install MediaWiki | ||||||||||||||
| if: steps.cache-mediawiki.outputs.cache-hit != 'true' | ||||||||||||||
| working-directory: ~ | ||||||||||||||
| working-directory: ${{ github.workspace }} | ||||||||||||||
| run: bash EarlyCopy/.github/workflows/installMediaWiki.sh ${{ matrix.mw }} ExternalContent | ||||||||||||||
|
|
||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||
| - name: Checkout extension into MediaWiki tree | ||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||
| with: | ||||||||||||||
| path: mediawiki/extensions/ExternalContent | ||||||||||||||
|
|
||||||||||||||
| - name: Composer allow-plugins | ||||||||||||||
| run: composer config --no-plugins allow-plugins.composer/installers true | ||||||||||||||
|
|
||||||||||||||
| - run: composer update | ||||||||||||||
| - name: Composer update (extension + deps) | ||||||||||||||
| run: composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader | ||||||||||||||
|
|
||||||||||||||
| - name: Run update.php | ||||||||||||||
| run: php maintenance/update.php --quick | ||||||||||||||
|
|
||||||||||||||
| - name: Run PHPUnit | ||||||||||||||
| run: php tests/phpunit/phpunit.php -c extensions/ExternalContent/ | ||||||||||||||
| - name: Run PHPUnit (junit) | ||||||||||||||
| continue-on-error: true | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||||||||||||||
| run: php tests/phpunit/phpunit.php -c extensions/ExternalContent/ --log-junit tests/junit.xml | ||||||||||||||
|
|
||||||||||||||
| - name: Run PHPUnit with code coverage | ||||||||||||||
| run: php tests/phpunit/phpunit.php -c extensions/ExternalContent/ --coverage-clover coverage.xml | ||||||||||||||
| - name: Upload PHPUnit JUnit result | ||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||
| with: | ||||||||||||||
| name: phpunit-junit-${{ matrix.mw }}-php${{ matrix.php }} | ||||||||||||||
| path: tests/junit.xml | ||||||||||||||
|
freephile marked this conversation as resolved.
Outdated
|
||||||||||||||
|
|
||||||||||||||
| - name: Run PHPUnit with code coverage (master only) | ||||||||||||||
| if: matrix.mw == 'master' | ||||||||||||||
| run: php tests/phpunit/phpunit.php -c extensions/ExternalContent/ --coverage-clover coverage.xml | ||||||||||||||
|
|
||||||||||||||
| - name: Upload code coverage | ||||||||||||||
| run: bash <(curl -s https://codecov.io/bash) | ||||||||||||||
| - name: Upload code coverage (master only) securely | ||||||||||||||
| if: matrix.mw == 'master' | ||||||||||||||
| continue-on-error: true | ||||||||||||||
| uses: codecov/codecov-action@v4 | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs a
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||||||||||
| with: | ||||||||||||||
| 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) | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||||||||||||||
| if: matrix.mw == 'master' | ||||||||||||||
| uses: actions/upload-artifact@v4 | ||||||||||||||
| with: | ||||||||||||||
| name: coverage-${{ matrix.mw }}-php${{ matrix.php }} | ||||||||||||||
| path: coverage.xml | ||||||||||||||
|
Comment on lines
+109
to
+116
|
||||||||||||||
|
|
||||||||||||||
| - name: Run parser tests (explicit targets) | ||||||||||||||
| if: matrix.mw >= 'REL1_43' || matrix.mw == 'master' | ||||||||||||||
| run: | | ||||||||||||||
| if [[ "${{ matrix.mw }}" == "REL1_43" ]]; then | ||||||||||||||
| php tests/parser/parserTests.php --file=extensions/ExternalContent/tests/parser/parserTests-mw143.txt | ||||||||||||||
| else | ||||||||||||||
| php tests/parser/parserTests.php --file=extensions/ExternalContent/tests/parser/parserTests.txt | ||||||||||||||
| fi | ||||||||||||||
|
|
||||||||||||||
| static-analysis: | ||||||||||||||
| name: "Static Analysis: MW ${{ matrix.mw }}, PHP ${{ matrix.php }}" | ||||||||||||||
|
|
@@ -106,6 +132,8 @@ jobs: | |||||||||||||
| include: | ||||||||||||||
| - mw: 'REL1_43' | ||||||||||||||
| php: '8.3' | ||||||||||||||
| - mw: 'REL1_44' | ||||||||||||||
| php: '8.4' | ||||||||||||||
|
|
||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -118,7 +146,7 @@ jobs: | |||||||||||||
| uses: shivammathur/setup-php@v2 | ||||||||||||||
| with: | ||||||||||||||
| php-version: ${{ matrix.php }} | ||||||||||||||
| extensions: mbstring | ||||||||||||||
| extensions: mbstring, intl, pdo_sqlite, php-ast | ||||||||||||||
| tools: composer, cs2pr | ||||||||||||||
|
|
||||||||||||||
| - name: Cache MediaWiki | ||||||||||||||
|
|
@@ -129,24 +157,32 @@ jobs: | |||||||||||||
| mediawiki | ||||||||||||||
| !mediawiki/extensions/ | ||||||||||||||
| !mediawiki/vendor/ | ||||||||||||||
| # Shared cache key across static-analysis and code-style jobs | ||||||||||||||
| # Safe to share because both jobs use the same MW core code | ||||||||||||||
| key: mw_static_analysis | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cache key collision: static-analysis and code-style share the same MediaWiki cache. Both jobs use 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. adding a comment to indicate that a shared cache is intentional There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 The comment will clarify that sharing |
||||||||||||||
| restore-keys: | | ||||||||||||||
| mw_static_analysis | ||||||||||||||
|
Comment on lines
132
to
+164
|
||||||||||||||
| key: mw_static_analysis | |
| restore-keys: | | |
| mw_static_analysis | |
| key: mw_static_analysis_${{ matrix.mw }} | |
| restore-keys: | | |
| mw_static_analysis_${{ matrix.mw }} |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
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 }}'.
| key: mw_static_analysis | |
| restore-keys: | | |
| mw_static_analysis | |
| key: mw_static_analysis_${{ matrix.mw }} | |
| restore-keys: | | |
| mw_static_analysis_${{ matrix.mw }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| .phpunit.result.cache | ||
| composer.lock | ||
| vendor/ | ||
| vendor/ | ||
|
|
||
| # Local CI/testing artifacts (act, generated directories, logs) | ||
| .actrc | ||
| *.log | ||
| mediawiki/ | ||
| EarlyCopy/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| { | ||
| "@metadata": { | ||
| "authors": [ | ||
| "Умар" | ||
| ] | ||
| }, | ||
| "external-content-desc": "Бакъо ло арахьара чулацам чубаккха, масала, «markdown» файлаш, хьан вики агӀонаш тӀехь", | ||
| "external-content-fetch-failed": "Файл схьаэца аьтто ца баьлла", | ||
| "external-content-domain-not-allowed": "Оцу доменера файлаш дӀахӀотто бакъо йац", | ||
| "external-content-extension-not-allowed": "Оцу форматан файлаш дӀахӀотто бакъо йац", | ||
| "external-content-url-missing-host": "URL чохь хост йац", | ||
| "external-content-url-missing-path": "URL-адрес чохь бац файлан некъ", | ||
| "external-content-url-not-bitbucket": "Bitbucket-ан нийса йоцу URL", | ||
| "external-content-url-missing-repository": "URL-адресехь йац репозиторин цӀе", | ||
| "external-content-tracking-category": "Арахьара чулацам болу агӀонаш", | ||
| "external-content-tracking-category-desc": "ХӀокху агӀонан тӀехь чубиллина арахьара чулацам бу", | ||
| "external-content-broken-tracking-category": "Боьхна арахьара чулацам болу агӀонаш", | ||
| "external-content-broken-tracking-category-desc": "ХӀокху агӀонна арахьара чулацам чубаккха аьтто ца баьлла" | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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-junitoption to PHPUnit produces a JUnit compatible log file which can be ingested by more coverage analysis tools.