-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Implement Mediawiki REST API render #1947
Conversation
2d9609a
to
0e33df9
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1947 +/- ##
==========================================
+ Coverage 74.28% 74.42% +0.14%
==========================================
Files 39 41 +2
Lines 3095 3136 +41
Branches 679 689 +10
==========================================
+ Hits 2299 2334 +35
- Misses 678 683 +5
- Partials 118 119 +1 ☔ View full report in Codecov by Sentry. |
@VadimKovalenkoSNF This is the last PR, hope you can fix it and put to review today. |
54a7e56
to
e075a8b
Compare
@@ -38,22 +38,4 @@ describe('forceRender', () => { | |||
console.log('Zimcheck not installed, skipping test') | |||
} | |||
}) | |||
|
|||
test('Scrape article from bm.wikipedia.org should throw error when using VisualEditor render', async () => { |
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.
Unfortunately, this set of tests should be removed - they caused issues in CI pipeline related to memory corruption. One of the examples of this problem can be found in these logs - https://github.com/openzim/mwoffliner/actions/runs/6854615228/job/18637919124#step:7:1589
I also faced with terminate called after throwing an instance of 'Xapian::DatabaseLockError' Aborted (core dumped)
and Node error process completed with exit code 139
. Probably, that happened because we forced the application to throw an error here without the right clearing of the Redis state and/or dangling process.exit(1) invocation.
@@ -18,7 +18,8 @@ export const parameterDescriptions = { | |||
keepEmptyParagraphs: 'Keep all paragraphs, even empty ones.', | |||
mwWikiPath: 'Mediawiki wiki base path (per default "/wiki/")', | |||
mwActionApiPath: 'Mediawiki API path (per default "/w/api.php")', | |||
mwRestApiPath: 'Mediawiki Rest API path (per default "/api/rest_v1")', | |||
mwRestApiPath: 'Wikimedia Rest API path (per default "/api/rest_v1")', | |||
mwMediaWikiRestApiPath: 'Mediawiki Rest API path (per default "w/rest.php/v1/page/")', |
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.
This is probably not the best naming, but I have to follow the convention that mw
stands for Mediawiki singleton in mwoffliner, and MediaWikiRestApiPath
should be named like this because this is how this API was named originally.
@@ -0,0 +1,85 @@ | |||
import MediaWiki from '../../src/MediaWiki.js' | |||
|
|||
describe('Checking Mediawiki capabilities', () => { |
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.
This test suit should have been introduced a while ago as a convenient way to check the capabilities of different wikis, as well as testing of the specific receipts. Before trying to scrape some wiki, this is a good place to start.
40c5227
to
900f58d
Compare
Fixes #1601
Successor of #1926
Depends on #1929