Commit graph

1082 commits

Author SHA1 Message Date
Ed Sanders b4e4f30234 ThreadItemStore: Remove "ButTryHarder" from method name
This appears to reference the retry that happens due to
REPEATABLE_READ, but that seems like an implementation
detail so not really useful to have in in the function
name, nor does it disambiguate it from another function.

Change-Id: Iacc95b74f25c166545734818efb1b30e18a1754e
2024-02-21 15:56:32 +00:00
Ed Sanders 5ba0bfa026 Remove temporary newsectionlink_enable config
This was intended as a temporary config to facilitate a
staged rollout (T331635) which has now completed.

Change-Id: I432ec0a24b8e8c12b62556ff6703abff32a2fced
2024-02-19 17:34:23 +00:00
jenkins-bot 85f75fb8ed Merge "Parser: Minor code cleanup" 2024-02-16 12:40:19 +00:00
Subramanya Sastry 3b2de5b10e Properly handle preview scenario for Parsoid rendering
* Removed a wikiech-specific hack and use the now available
  ParserOutput flag.

Change-Id: Ia06025c131485a9dc67afd8258fa4b3753d165b9
2024-02-14 15:32:47 -06:00
Bartosz Dziewoński fc4d70f9f5 ThreadItemStore: Add ->caller() in queries
It makes it easier to find the queries in debug logs in production.

Change-Id: I80f94d1fc8c49227218b07234e162445cc43ca00
2024-02-09 19:16:55 +01:00
Bartosz Dziewoński 6a1f2accee Parser: Minor code cleanup
We had some unused variables and roundabout checks.

Change-Id: I454b60ffa05c1cc12288c5de88c849a25aa35447
2024-02-08 16:59:04 +01:00
jenkins-bot 297f4f01dd Merge "Parser: Fix the main loop getting stuck on some signatures" 2024-02-07 22:01:56 +00:00
jenkins-bot c1049da7d5 Merge "Use Parsoid HTML to drive notifications" 2024-02-07 21:36:56 +00:00
Bartosz Dziewoński 9db35873a4 Parser: Fix the main loop getting stuck on some signatures
In certain cases the parser could go back rather than forward after
finding a signature, causing it to find the same signature forever
until it ran out of memory.

Test cases coming later in a separate patch.

Bug: T356884
Change-Id: I8ac72b05e5e4ed45e6119c012a69708c9d8eda29
2024-02-07 22:33:57 +01:00
Bartosz Dziewoński f7a8ba08fb Ignore transcluded items when finding permalinks
* Keep the information about this in the API result, which we were
  previously omitting
* Use it instead of duplicating the logic client-side

Bug: T356131
Change-Id: I7e7342e9d94a171b5ef56e646871c18c8c39c44c
2024-02-04 00:07:37 +01:00
Ed Sanders 8b99c1fbbe Add more search methods to findNewestRevisionsByHeading
In production, indexing the full history of every page will take
too long, so we can't rely on being able to find the target heading
text in the history of the current page.

When this search fails, fall back to the following searches:
* The heading appears in the current revision of a sub-page
* The heading appears anywhere on the wiki, but only once

Bug: T356276
Change-Id: I90e92cb9c85aaf6fb2355f842450981bbe6abf2d
2024-02-01 18:32:36 +00:00
Ed Sanders 8069585489 CommentParser: Ignore generated timestamp links
This will be present in parser cache output and can
sometimes be mistaken for user page links.

Bug: T356142
Change-Id: I800b23d8466f72affcadfa336aab07abf7f8d79e
2024-01-30 10:29:36 +00:00
C. Scott Ananian e2c9ca37b0 Use Parsoid HTML to drive notifications
This reuses the existing comment parser code in HookUtils and makes the
DataUpdatesHooks and EventDispatcher code consistent.

Bug: T354792
Change-Id: I58a71b26b3f47898a68a29098a8105ee844403dd
2024-01-18 19:23:13 -05:00
jenkins-bot 184cd048f1 Merge "Refactor CommentFormatter->addTopicContainer()" 2024-01-18 01:16:07 +00:00
jenkins-bot 55daf9b617 Merge "Re-enable: "Temporarily disable isPreview in Parsoid's rendering""" 2024-01-17 19:47:11 +00:00
Subramanya Sastry 3f2f5dd237 Re-enable: "Temporarily disable isPreview in Parsoid's rendering""
This reverts commit 1cf6000d18.

Reason for revert: Want to do another round of visual diff testing
on wikitech as an anonymous user. Will revert this after test is done.

Change-Id: Ic3facb7ecd9c932be348d47d6a38cff71cd7e1db
2024-01-17 18:02:16 +00:00
Ed Sanders c076f170c4 Update TODO documentation around parsing
Change-Id: I14fb4874fdc3e97418b5f41665334e122c17d862
2024-01-10 18:29:40 +00:00
Novem Linguae 3436e2d9e9 Refactor CommentFormatter->addTopicContainer()
To get ready for the subtopic subscriptions feature, this patch
separates the code that adds the topic container from the code
that adds the subscribe button.

The idea is that in the future, an H3 would need a subscribe
button, but not a topic container. Whereas an H2 would need both.

Bug: T275943
Change-Id: I6a82773ed200dcb4083ac38a4d41838f639c097e
2023-12-24 13:34:30 -08:00
jenkins-bot 6ff126eab5 Merge "CommentFormatter: Do not add wrapper if the heading has attributes" 2023-12-20 17:17:18 +00:00
Bartosz Dziewoński 6f92654137 CommentFormatter: Do not add wrapper if the heading has attributes
Bug: T353489
Change-Id: Idf49b40cd745b804dbad3c09960507790be20ae3
2023-12-20 16:56:12 +01:00
jenkins-bot 2d2bcc05ce Merge "ContentCommentItem.php: Documentation fixes" 2023-12-18 17:21:36 +00:00
Ed Sanders 84bc45adf1 ContentCommentItem.php: Documentation fixes
Change-Id: I5ee1c3e1b79f4e9bdab417c68ff447313ecb752d
2023-12-15 17:05:22 +00:00
jenkins-bot 8e2d172960 Merge "CommentParser: Replace new uses of Title with TitleValue" 2023-12-15 16:21:19 +00:00
jenkins-bot bf9fc18120 Merge "Move finding transclusion source from ContentThreadItem to CommentParser" 2023-12-15 16:17:13 +00:00
jenkins-bot a77338fd6d Merge "Revert "Temporarily disable isPreview in Parsoid's rendering"" 2023-12-14 17:24:02 +00:00
Subramanya Sastry 1cf6000d18 Revert "Temporarily disable isPreview in Parsoid's rendering"
This reverts commit d004c001be.

Reason for revert: Visual diff done and results gathered.

Change-Id: Iefb0c74a121346286a353dae6cb795b86aa636ce
2023-12-14 14:16:41 +00:00
jenkins-bot 797bd2ea0b Merge "ThreadItemStore: Omit redundant updates to avoid warnings" 2023-12-14 11:06:45 +00:00
Bartosz Dziewoński ab2a83601a Use SQL expression builder instead of buildLike()
Follow-up to c82783a5b6.

Change-Id: If844b601b3887d5f853fb9f56be2741896114698
2023-12-14 11:55:34 +01:00
Bartosz Dziewoński 1e5dc67c36 ThreadItemStore: Omit redundant updates to avoid warnings
Bug: T353432
Change-Id: Ib095d622e549139efdd050cadc87ac9dd6a1f318
2023-12-14 10:54:16 +00:00
Subramanya Sastry d004c001be Temporarily disable isPreview in Parsoid's rendering
This will let us render reply links on wikitech and run visual diffs
(which runs in anonymous user mode). This will be reverted after
the visual diff test run.

Change-Id: Ibf175a7f5b1e68f66c257fc26ba9e4b55f752fbd
2023-12-12 14:08:46 -06:00
Subramanya Sastry 8671171b35 Remove checks for missing title info in ParserOutput extensiondata
This data was added to core in I328f533e6cdb11c0c3a873d23bab1a113dfa39be
and it will have been in production for 4 weeks next week which is
enough for all content to have rolled over.

Change-Id: I3d568eed56446f26aa329bfa554d609b8bcb973a
2023-12-12 14:08:46 -06:00
Bartosz Dziewoński cc9cccbd35 CommentParser: Replace new uses of Title with TitleValue
Follow-up to Ic718a964e309ae3a8e15e299081f46d4db860731.

Change-Id: Ida70ee080de44ec36f11c3c40816f6a198b63798
2023-12-11 22:19:13 +01:00
Bartosz Dziewoński a27e27fc68 Move finding transclusion source from ContentThreadItem to CommentParser
Reasons:
* Various other methods dealing with ranges already live there
* It would be neat if ContentThreadItem was just a value class
  without a lot of logic, similar to DatabaseThreadItem,
  particularly for writing unit tests
* The methods access global state through Title, which can't
  be fixed while they're in ContentThreadItem (see I9dfccc83)

The computation is now always done, instead of only when needed,
but that's a small drawback, since it's fast (fast enough that
I don't see the difference in the time taken when running tests),
and we were already computing it for all comments in many places.

Change-Id: Ic718a964e309ae3a8e15e299081f46d4db860731
2023-12-11 22:18:30 +01:00
Umherirrender 64bcb583e9 Use namespaced classes
Done automatically via script
Change to extension.json done manually

Change-Id: Ied7bbddd357290ac6be6bf480be0ee9116e77365
2023-12-11 16:38:02 +01:00
jenkins-bot d69dc24161 Merge "Ignore signatures with invalid timestamps" 2023-12-07 18:00:09 +00:00
Ed Sanders c82783a5b6 Find a heading by title in archives
* Looks for heading IDs matching "h-<heading text>-%" that once
  existed on the target page.
* For such IDs, finds where those items currently exist,
  presumably in an archive.

Pros:
* Doesn't need to know anything about the local wiki's archiving
  conventions, so can be deployed universally.

Cons:
* ID conflicts will return matches in unrelated archives, e.g.
  MassMessages.

Bug: T349653
Change-Id: Ie94efd0503e9f4689d3421babe445f9f4e2b4fb7
2023-12-06 18:39:28 +00:00
Ed Sanders 4733eb0362 Show new location of missing comments in notification
Bug: T304579
Change-Id: I5c9229a25875f0bb73c2a4dbfd0e1ac25f9c893e
2023-12-06 18:39:27 +00:00
Ed Sanders 4051c7faf4 Ignore signatures with invalid timestamps
Bug: T352455
Change-Id: Ie499db4594bfa23b618907383d0ac583849ff582
2023-12-05 13:23:15 +00:00
jenkins-bot 957788d9d5 Merge "Use upstream Title::inNamespace() instead of manual comparisons" 2023-12-04 23:09:28 +00:00
jenkins-bot d4d595c1b8 Merge "Check language fallbacks in isLanguageRequiringReplyIcon" 2023-12-01 21:29:23 +00:00
Ed Sanders 40ce262d7e Check language fallbacks in isLanguageRequiringReplyIcon
Bug: T352289
Change-Id: I0a1466c871143af85e7eeb07572021c387074705
2023-12-01 13:57:08 +00:00
gerritbot 5a51c63687 Update UserOptionsLookup's FQN
User-options related classes are being moved to the MediaWiki\User\Options namespace in MediaWiki Core; reflect that change here.

Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: Iaf161106c323461929abe9b8a021bbb3e34c4ae7
2023-11-30 17:35:15 +00:00
jenkins-bot fdfc9a266e Merge "Remove small pieces of unused code from PageHooks class" 2023-11-28 20:22:10 +00:00
thiemowmde 12e7fba827 Remove small pieces of unused code from PageHooks class
Change-Id: I557bfb0f688d3e9455b5187df3cbbe67697fbd55
2023-11-28 15:39:20 +00:00
thiemowmde 00ad50c673 Use upstream Title::inNamespace() instead of manual comparisons
This might be a matter of personal preference. Not sure if it's
worth it. Both is well readable. On the other hand, the method
exists. Why not use it?

Change-Id: Id66fc6c888db6ae1cf28e60a51f90d9ae2cdb6ee
2023-11-28 09:49:00 +01:00
Subramanya Sastry bea2b1478d Work around Parsoid's messy handling of some extensions
* See T351461#9358034 for details

Bug: T351461
Change-Id: If438e99284018e3b78f4c2fc22ce714322877cf7
2023-11-28 03:00:27 +00:00
Subramanya Sastry e42450cd4f Revert "ParserOutputPostCacheTransform: Don't reprocess content"
This reverts commit 7aaaf51dfd.

Reason for revert: This is not right and doesn't work either.
See T351461#9358034 for why this strategy will not work right now.
We need a different strategy to prevent duplicate transforms if
they continue.

Change-Id: I97efee9197359ecdccdf89a0be850a707a11cc98
2023-11-26 22:06:39 -06:00
jenkins-bot 9699e57275 Merge "SpecialDiscussionToolsDebug: Replace Title::getPageViewLanguage()" 2023-11-22 21:55:13 +00:00
Subramanya Sastry 7aaaf51dfd ParserOutputPostCacheTransform: Don't reprocess content
* getText() could be called multiple times on a ParserCache object
  which would fire the ParserOutputPostCacheTransform handler
  multiple times.

  But, I could not track down how this could happen right now.

* As a separate issue, while conceptually there are no restrictions
  against calling getText() multiple times, there is a semantics and
  performance issue if that did actually happen. getText() does a
  bunch of transformations and makes no effort to avoid duplicate
  work. It will accumulate more transformations over time via the
  OutputTranform pipeline and it is preferable for getText() and/or
  the OutputTransform pipeline to guarantee semantics where the
  pipeline won't be run multiple times on the same content. That will
  free both hook handlers (like this) and the transforms themselves
  to avoid checks as in this patch.

  This patch should be reverted once such a change is made to core.

Bug: T351461
Change-Id: If5dfa0954e3fd2b7dbea1ed29b475be07f0f3986
2023-11-20 13:31:43 +00:00
jenkins-bot 43df071836 Merge "Document generated CSS classes" 2023-11-16 21:03:28 +00:00