[07:40:38] [1/2] Apparently this is all you need to (unsafely) support `LIKE` and `RLIKE` operators in Bucket. I just don't know how to do this without leaving a big security hole in the software. This `RawSQLExpression` looks very dangerous lol. [07:40:38] [2/2] https://cdn.discordapp.com/attachments/1006789349498699827/1414153374584012810/image.png?ex=68be8876&is=68bd36f6&hm=3bc83314abe4f751709ba3566ee8eb9cc70a01f941ec0672c4ed27454d23ebb5& [07:52:30] @blankeclair @abaddriverlol [07:56:19] i'm fairly sure there's smth like buildLike? [08:05:39] I couldn't get it to work somehow. Maybe I should give it another try. [08:08:07] [1/2] Oh I remember. `buildLike` returns a string, but the SQL statement builder expects a `LikeValue` and throws this error `⧼Value for 'LIKE' expression must be of LikeValue type⧽.`. [08:08:07] [2/2] Passing `LikeValue` was what I tried originally, but that would get escaped. [08:09:29] Anyways I should probably not get too curious on this front where I have no idea what I'm doing and go back to writing CSS grid guides. [08:10:37] til RLIKE is a thing [08:10:42] immediate thought is redos [09:11:20] Maybe raise this with Amir [10:43:13] You have `IExpression::LIKE` and `new LikeValue()` which is prolly in the realm of what you're after [12:50:54] [1/5] something like [12:50:54] [2/5] ```php [12:50:55] [3/5] $dbw->expr( $fieldName, IExpression::LIKE, new LikeValue( $dbw->anyString(), $value, $dbw->anyString() ) ); [12:50:55] [4/5] ``` [12:50:55] [5/5] should probably work for LIKE (not sure about RLIKE) [12:51:59] On that note, why is Bucket using the primary DB for select queries [16:50:35] @cosmicalpha was the medik issue resolved [16:50:57] medik is fixed [16:50:59] I believe so, yes [16:51:18] WikibaseRepository, CommentStreams, SemanticDrilldown and SemanticScribunto are currently broken afaik [16:51:22] I'll patch the two latter ones [17:16:34] SemanticDrilldown and SemanticScribunto should now be fixed on beta and prod [17:52:16] Didn't WMF Abandon comment streams? [17:52:27] It was a terrible idea from the get go but [17:52:51] I thought it was a third party extension [17:53:21] I could've sworn it was a WMF thing [17:53:25] Maybe I'm misremembering [17:54:18] Oh looks like one of the authors used to work for WMF so maybe that's where I got confused [18:00:18] wiki.gg did recently switch away from CommentStreams so I would assume they are not as updated as they should be [18:02:13] StructuredDiscussions/Flow they did [18:02:49] Wikibase is fixed on 1.44 now also btw. [18:04:47] Seems we may have gotten CommentStreams working as well. [18:42:41] was done by a wmf staffer [18:42:55] but as far as i'm aware it was a personal extension or rather not connect to the WMF [18:56:16] [1/2] How bad is it to release an extension without tests? [18:56:16] [2/2] Normally I would but Scribunto's testing tools are borked/never got updated: https://phabricator.wikimedia.org/T403432 [18:57:52] that error kinda looks like the test is supposed to be run as an integration test but it isn't [19:08:11] Yeah UnitTests are not allowed to access MediaWikiServices [19:16:10] [1/4] Hmm, seems that way. Although I did specify the test to inherit from `LuaEngineUnitTestBase`. Seems like it could be some sort of outdated behavior. [19:16:10] [2/4] Anyway, running it as if it were to be an integration test spits this though: [19:16:10] [3/4] ```1) LuaStandalone: BigIntegerTest[1]: Verify the lib is loaded and exists [19:16:11] [4/4] RuntimeException: Database backend disabled``` [19:19:18] I'm running this on Docker, I'm not sure if I'm meant to do something else [19:21:42] try adding it to `@group Database` [19:22:09] like e.g. [19:32:19] Niice, it's working! Although it seems like it's skipping 1 test out of 3? But I only have a single test from Lua [23:38:32] [1/30] Thank you! I think I got `LIKE` and `NOT LIKE` working. I had to build a custom query parsing function to find all the `%` and `_`. I didn't bother to code escaping (e.g. `\%` or `\_`), though. [23:38:32] [2/30] ``` [23:38:33] [3/30] private static function constructLikePattern( $dbw, $pattern ): array { [23:38:33] [4/30] $result = []; [23:38:33] [5/30] $currentString = ''; [23:38:34] [6/30] $length = strlen( $pattern ); [23:38:34] [7/30] $escapeChar = [ [23:38:34] [8/30] '%' => $dbw->anyString(), [23:38:34] [9/30] '_' => $dbw->anyChar(), [23:38:35] [10/30] ]; [23:38:35] [11/30] for ( $i = 0; $i < $length; $i++ ) { [23:38:35] [12/30] $char = $pattern[$i]; [23:38:36] [13/30] if ( isset( $escapeChar[$char] ) ) { [23:38:36] [14/30] if ( $currentString !== '' ) { [23:38:37] [15/30] $result[] = $currentString; [23:38:37] [16/30] $currentString = ''; [23:38:38] [17/30] } [23:38:38] [18/30] $result[] = $escapeChar[$char]; [23:38:39] [19/30] } else { [23:38:39] [20/30] $currentString .= $char; [23:38:40] [21/30] } [23:38:40] [22/30] } [23:38:41] [23/30] if ( $currentString !== '' ) { [23:38:41] [24/30] $result[] = $currentString; [23:38:42] [25/30] } [23:38:42] [26/30] return $result; [23:38:43] [27/30] } [23:38:43] [28/30] ``` [23:38:44] [29/30] https://cdn.discordapp.com/attachments/1006789349498699827/1414394436233990365/image.png?ex=68bf68f7&is=68be1777&hm=673241eb77d6714bef1edae2e692528f09aecbf63894de7ef7f5199aa1c9ed0f& [23:38:44] [30/30] https://cdn.discordapp.com/attachments/1006789349498699827/1414394436712005764/image.png?ex=68bf68f7&is=68be1777&hm=0b3f945f968516d0f0bb497eea689d4a9ee2077ddb980c0086873a87ea7b3129& [23:58:22] [1/2] had this happen on my miraheze and the meta miraheze [23:58:22] [2/2] https://cdn.discordapp.com/attachments/1006789349498699827/1414399427514339459/image.png?ex=68bf6d9d&is=68be1c1d&hm=8698b35ecf369d3f4579a2aaed0e8c68f5296bebd222c4470f62f9e2ebd231df&