Commit graph

4665 commits

Author SHA1 Message Date
thiemowmde 7c75d44b8a Rename ReferencesFormatter to ReferenceListFormatter
I always found the name a little ambiguous. The fact that it outputs
an actual HTML list and not just some "references" – whatever that
means – is relevant, in my opinion.

Change-Id: I0d169455c8d2b42d62da4dccb8376c09fb6902bc
2024-02-07 18:20:02 +01:00
Adam Wight 74f66bc478 Avoid creating a MWReferenceModel if not needed
It's fine to copy attributes directly from the reference node rather
than go through the specialized model object.

Bug: T336417
Change-Id: Idaca192137dc762ddced2ee8446a7d838f97e317
2024-02-07 15:24:12 +01:00
Translation updater bot df2a713934 Localisation updates from https://translatewiki.net.
Change-Id: I86fedb483ef06b978e9e16cbc23cad0a72bf905e
2024-02-05 08:49:22 +01:00
thiemowmde 5eea8ebd90 Simplify ErrorReporter PHPUnit test setup
This was slightly overengineered ever since I4b1f890 and slowly became
more and more complicated over time, notably when withConsecutive was
replaced in Icb951b4. Turns out this was never really needed. It's
impossible to get more than one tracking category from this code path.

While we might add more tracking categories later that will most
probably not happen in this code path.

Change-Id: Ie32d17bac8d3518c985b18f83a846c3fb2bd053f
2024-02-01 17:28:44 +01:00
Translation updater bot 8333e70453 Localisation updates from https://translatewiki.net.
Change-Id: Ic325aea9e6f28d870f3bfe5ad4962419723267ce
2024-02-01 09:01:15 +01:00
Adam Wight b0b628afd5 First tests for ve.dm.MWReferenceModel
Begin a QUnit test module for the reference model.  Tests demonstrate
that a new ref and a normal ref reuse from the full document both
behave as expected.

Bug: T336417
Change-Id: I1337806d41b50329ba971c8e68e1a62b52cc9a52
2024-01-31 13:52:40 +01:00
Translation updater bot f7d1ecb84b Localisation updates from https://translatewiki.net.
Change-Id: I4c21c3ea065de3e17672e19a7cb86907b4467d1c
2024-01-31 08:28:49 +01:00
jenkins-bot de17c57b98 Merge "[lint] Satisfy max-len rule" 2024-01-30 15:47:54 +00:00
mareikeheuer b411dc50a2 Write e2e test for Cite-VisualEditor integration in Cypress
Implemented the test case as described in the ticket.
Deviated from ticket's approach for creating a new page by manual creation instead of API,
to verify the end-to-end functionality through the interface & ensure the entire proccess works seamlessly.

Bug: T353439
Change-Id: I8f863ae0bd8fdb1fb0f1b103d98ba9f2306f3df2
2024-01-30 14:48:14 +01:00
Adam Wight 9535126304 [lint] Satisfy max-len rule
These changes mostly improve the code, and align the lint rules with
the MediaWiki base.

Change-Id: Ib4b0595fd9a9298039b8b44a0f1d4a9e90731527
2024-01-30 12:18:52 +01:00
Adam Wight 4a6b78ac0c Verify that the test page was created
Make sure that we're waiting for the page creation to finish, and
assert that the API request was successful.  This is mostly a
diagnostic improvement to help debug flaky tests.

Bug: T355602
Change-Id: I398cffa724e9b6d733df46676478cc98dccd884d
2024-01-30 09:46:53 +01:00
Translation updater bot 723571b5d3 Localisation updates from https://translatewiki.net.
Change-Id: Ic56560791c1d93bde35617b594126fec2c578f9a
2024-01-28 16:05:40 +01:00
Subramanya Sastry 15f5cc71be Add dummy html/parsoid sections for three failing tests
* This is to worka round some confusing html2html failures in CI
  for these tests (that are not reproducible locally for me).

Change-Id: I07725155ef5e04eb4346a90c34cbacbd70e88ea6
2024-01-26 23:56:41 -06:00
jenkins-bot b4d8b9ccc6 Merge "Enable all Parsoid test modes for citeParserTests.txt" 2024-01-26 23:18:46 +00:00
Subramanya Sastry b3dff81b6d Enable all Parsoid test modes for citeParserTests.txt
* Updated the known failures file.

Depends-On: I093aeed933fe5927e031c879d48e0191e8ef4685
Depends-On: I0df36653de4c70c7a4669b874f43385a18ac5e9d
Depends-On: Id81e2f4331ce73145389e717b7c78f49b29743bf
Depends-On: I7fb86778cfb674ecc76f748786fa08d8f6ac9c65
Change-Id: I101564587dc7959cd620f0b2cc4f8e436bfba6da
2024-01-25 22:11:49 +00:00
jenkins-bot 53bc13024b Merge "Cypress Improvements" 2024-01-25 15:26:54 +00:00
jenkins-bot abb007b133 Merge "Ensure CiteParsoidTest registers our Cite implementation" 2024-01-24 20:33:11 +00:00
C. Scott Ananian 129b222e97 Ensure CiteParsoidTest registers our Cite implementation
These tests pass today because Parsoid is providing an
alternative implementation of Cite, but that means this
test case isn't actually testing the code in this repo.

Bug: T354215
Change-Id: I42521026bab36035ae5eded7c05716234a5a29ea
2024-01-24 20:09:36 +00:00
mareikeheuer 2fac0fca74 Cypress Improvements
General improvements
Ensure proper module loading in Cypress tests to prevent failures by waiting for specific modules to be loaded
Delete the selenium test suite.

Bug: T353436
Change-Id: Ieb71b122d3c6513f1a15d6574967e2bb9c21a393
2024-01-24 12:01:10 +01:00
thiemowmde 16711d681b Group and nest stylesheets now they are .less files
Change-Id: Iedd9748cf9f38847ef4553459d533a67a0950645
2024-01-21 15:59:20 +01:00
thiemowmde 80c8eaf3ce Convert (almost) all .css files to .less
Intentionally no other change is made (yet). This is for a later,
separate patch.

Intentionally not touching the huge list of per-language
ext.cite.style.*.css files for the moment. Again, I would prefer to
do this in a separate patch.

Change-Id: I4e392c7bd1c69849a6c7946676a64c749ddbcd60
2024-01-21 15:39:08 +01:00
Umherirrender e3bbe96939 Stop writing to tablesUsed in tests
Bug: T351733
Change-Id: I2d9d7f5358b6d370a904305a0d9e152375a5aaf9
2024-01-20 12:23:34 +01:00
Subramanya Sastry ff699c31aa Sync up Cite repo with Parsoid
This now aligns with Parsoid commit a8db16f33a638931f91ba75d639bb9d661cb979b

Change-Id: Ibd53e38121231a3501dbbfce1c1e1db370740c0b
2024-01-19 12:24:59 -06:00
jenkins-bot b14d007859 Merge "Hook up Parsoid implementation of Cite" 2024-01-19 17:23:33 +00:00
C. Scott Ananian 234da84418 Hook up Parsoid implementation of Cite
This commit also moves certain parser tests involving <ref> from
the Parsoid repo to citeParserTests.txt in this repo.

Bug: T354215
Change-Id: Ie5b211d2af01a56684473723c68a9ab2775542e3
2024-01-19 11:57:11 -05:00
jenkins-bot 030e9a2a7e Merge "Fix event logging for the reference previews baseline" 2024-01-18 13:16:31 +00:00
Translation updater bot 2c84fbbc08 Localisation updates from https://translatewiki.net.
Change-Id: I34a16a2997cfad7578aa05a5704059a78c66b134
2024-01-18 09:24:42 +01:00
C. Scott Ananian b1cc92b9a1 Add DOM stubs; change namespace of imported Parsoid code to Cite\Parsoid
The namespace change avoids a conflict with the existing Parsoid
implementation in Wikimedia\Parsoid\Ext\Cite and matches the current
Cite codebase better.  We also need to add some phan stubs to allow
Cite to use Parsoid's generic DOM implementation classes, and some
type assertions to satisfy phan.

Bug: T354215
Change-Id: Ic904601b29555c9485a804f131061f207970ddd4
2024-01-17 16:04:30 -05:00
C. Scott Ananian 4f2f6a31e6 Delint imported Parsoid code
Parsoid's phpcs configuration is slightly different from the one in
this repository; this commit just keeps CI happy with the imported
code.

Change-Id: I9ce2993e8a9416f331b5157dfcfb01fb6e31baaf
2024-01-17 15:48:21 -05:00
C. Scott Ananian 8ef2a4a635 Migrate Parsoid implementation of Cite extension to src/Parsoid
Further commits will be necessary to complete the migration, but
this merge commit imports all of the existing history of the Cite
extension.  It was generated using the following command on a checkout
of Parsoid:

  git filter-repo --path src/Ext/Cite --path src/lib/ext/Cite \
    --path lib/ext/Cite --path lib/ext/Cite.js --path lib/ext.Cite.js \
    --path js/lib/ext.Cite.js --path modules/parser/ext.Cite.js \
    --tag-rename '':'parsoid-' \
    --path-rename src/Ext/Cite:src/Parsoid \
    --path-rename src/lib/ext/Cite:src/Parsoid

And then, in the Cite repository:

  git remote add parsoid ../path/to/parsoid/checkout
  git merge parsoid/master --allow-unrelated-histories

Bug: T354215
Change-Id: I54edd9cf7951ca024c66fe357e8777eed85ab13b
2024-01-17 15:47:33 -05:00
jenkins-bot bfd2cac6a1 Merge "Port Cite web test suite to Cypress" 2024-01-17 13:17:06 +00:00
WMDE-Fisch b59eef1cfe Fix event logging for the reference previews baseline
The current tracking is wrong for several reasons. Mainly because
of a race condition if the Popups extension fininshed loading
before the Cite tracking script is executed. But further more
wgPopupsReferencePreviews was not a good choice to see if the user
sees previews or not.

The logging now uses the monoschema and only checks for enabled
previews when the click events are fired. The chances that Popups
finished initilizing then are much higher then. We still can see
if the init is not finished and the variable not set though.

Also we won't track the overall pageviews in here but use the
generic pageview_hourly from the data lake instead.

Bug: T353798
Depends-On: I1c434f0098ae23bd62256686a658e3d5ef7f70b9
Change-Id: I7a9524274efb58286f520c6148d5463bb0a78dbf
2024-01-17 13:11:17 +01:00
mareikeheuer 0f801ea550 Port Cite web test suite to Cypress
Steps to implement:

 Copy over and adapt setup files, to install Cypress in the Cite code base.
 Port tests/selenium/specs/backlinks.js and supporting file cite.page.js to run under the Cypress environment, in a second patchset.
 Run the new suite in CI, replacing the previous selenium integration.
 Delete the selenium test suite.

Bug: T353436
Change-Id: Ie76371e18d8612daa7c7be741432c6f3e0b783b5
2024-01-17 11:45:04 +01:00
thiemowmde 6c1de9de24 Show warning when dir="…" don't match
Same as I294b59f in the Cite codebase.

An additional, necessary change is that we need to track all dir="…"
values in the ReferencesData object, even if we aren't going to use
the value from a <ref name="…" dir="…" /> reuse without content.
This is the same what's done in the ReferenceStack in the Cite
codebase.

Bug: T202593
Depends-On: I294b59f989f553932b40d08308906dd72d92d2cd
Change-Id: Ida38ae6a41e8550089cf7a37a549080d17943521
2024-01-16 20:59:31 +00:00
jenkins-bot a37b808f56 Merge "Only increment sequence when we really mean it" 2024-01-16 11:23:04 +00:00
Translation updater bot 33f5611e1c Localisation updates from https://translatewiki.net.
Change-Id: If1cd1df28a06c68d35ee4b03e6ad3c9e7b01820a
2024-01-16 08:25:24 +01:00
Translation updater bot 7f71ada8f8 Localisation updates from https://translatewiki.net.
Change-Id: I14dfb64deb13f0113940b6e295fba232f941e2f6
2024-01-15 08:23:57 +01:00
jenkins-bot cf776d8ce0 Merge "Documenting state of subref reuse rollback" 2024-01-10 12:55:20 +00:00
Adam Wight fa4a3c9405 Only increment sequence when we really mean it
I prefer this to having a mix of roll forward/roll back logic.

Change-Id: I9ac7c2ecf302c4d245a8fda7ed57f14cfb26757c
2024-01-10 13:40:41 +01:00
Adam Wight 9d64d837f1 Simplify "follow" block
There was no need to create a new variable here.

Change-Id: I034bc47c07be3ee716c9a1019addb93f0fb2910a
2024-01-10 13:14:06 +01:00
jenkins-bot 04e1dc66f7 Merge "Move extendsCount into parent ref item" 2024-01-10 11:53:11 +00:00
Adam Wight c36d1b90a5 Move extendsCount into parent ref item
Eliminates a complex shared structure in favor of more encapsulation.

Change-Id: I70efabf0ee263ac578472e16dc35047b0601b7ff
2024-01-10 11:55:16 +01:00
jenkins-bot 58b7f2e16f Merge "Test explicitly for parent ref existence" 2024-01-10 10:35:54 +00:00
Translation updater bot 9156975dae Localisation updates from https://translatewiki.net.
Change-Id: I0d9d5f9812c30d615bf8b150204ab5cab2d30858
2024-01-10 08:32:37 +01:00
Adam Wight e4b964eec7 Documenting state of subref reuse rollback
Some interesting stuff is happening, seems to have revealed bugs:
* Rolled-back warnings are still present on the ref
* Subref reuse numbering starts at 0 instead of 1, and formatting is cringe.

But subref rollback does seem to work!

Change-Id: If6321b34d27370553ba85e63dd1e2ae6a3b7c099
2024-01-09 18:05:05 +01:00
Adam Wight 12cd4b979e Test explicitly for parent ref existence
This test was obscured by testing for a field on the parent, but that
would exist if and only if the parent also existed.  Clarify the
guard condition and introduce a named local variable for the parent.

Change-Id: I03079f45cf5ba00d54642c89ac4232a944b2f353
2024-01-09 17:30:10 +01:00
thiemowmde 9f6dd63ef4 Don't search for [[MediaWiki:cite_link_label_group-]]
Such a message shouldn't exist, and doesn't:
https://global-search.toolforge.org/?q=.&regex=1&namespaces=8&title=Cite+link+label+group-

Additional notes:
* Rename the method to make it more obvious that it's not a cheap
  getter, but doing something slightly more expensive.
* Use more appropriate array_key_exists to check if a cache entry
  already exists.
* Also add a bit more documentation.

Bug: T297430
Bug: T353227
Change-Id: Ia5827bbf6fd700b87a749aac17320796428f0688
2024-01-09 17:00:07 +01:00
Adam Wight 89099e93d6 Rename internal variables
We can be more specific than "value".

Bug: T353451
Change-Id: I8f958a04d7fb6f5a0f10f3c3974b38257ab86f16
2024-01-09 09:53:21 +00:00
Adam Wight 0e01e39061 Encapsulate ref: groupRefs returned as objects
This patch only affects the consumers of groupRefs.

Bug: T353451
Change-Id: I1eff735dbc26dda07aa8ac7af9ea4ddc0906f5a4
2024-01-09 10:22:04 +01:00
Adam Wight f148c65078 Encapsulate ref: pushRef returns an object
This patch affects a few methods which use the output of pushRef.

Bug: T353451
Change-Id: I10b3fe89406c11cdaede92f18a4b96586ecaf5a0
2024-01-09 10:18:57 +01:00