aboutsummaryrefslogtreecommitdiffstats
path: root/includes/jobqueue/JobSpecification.php
Commit message (Collapse)AuthorAgeFilesLines
* Add documentation about 'requestId' param in Job parametersDreamy Jazz2025-03-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Why: * The 'requestId' parameter for jobs is interpreted as the value of Telemetry::getRequestId and is auto-populated with that value if not provided. * In a patch to the CentralAuth extension, namely 255a2af7b693cec3e2e6149d0128d3af80a05093, a 'requestId' parameter was added to a new job as a way to store an ID in a database row. ** This clashed with the Telemetry::getRequestId value and caused the job to be seen as invalid (as the request ID should have been a string). * This has been fixed in the CentralAuth extension, but we should make the docs clearer that the 'requestId' parameter is special and should not be used as a custom parameter for a job. What: * Update the doc block comments in the Job and JobSpecification classes to note this 'requestId' parameter is special. Bug: T389585 Change-Id: Ifb6fb58d267ca0a5cb3a0a42fdbe41f4fb21b26e
* Namespace all remaining files in includes/jobqueueJames D. Forrester2025-03-201-0/+6
| | | | | Bug: T353458 Change-Id: I95690a312e356c45dbeed607d32fb0e4626690cf
* Remove trivial 1-line PHPDocs that just repeat the codethiemowmde2025-01-161-3/+0
| | | | | | | | | | | | | I assume these are all either auto-generated by an IDE or the language-level type declarations have been added later. In any case the comments don't add any new information to what the code already says. This is just extra clutter that makes the code harder to read, I would argue. There are many, many more comments like this. In this patch I intentionally focus on the most trivial 1-line comments. Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
* Use explicit nullable type on parameter argumentsUmherirrender2024-10-161-1/+1
| | | | | | | | | | | Implicitly marking parameter $... as nullable is deprecated in php8.4, the explicit nullable type must be used instead Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a Break one long line in SpecialPage.php Bug: T376276 Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
* jobqueue: Mark JobSpecification as newableMáté Szabó2024-10-041-0/+1
| | | | | | | | | | | | | | | | Why: - JobSpecification is the preferred way to enqueue jobs without instantiating a full Job subclass instance, and the only way to enqueue a job in the context of a foreign wiki. - As such, it's used by several extensions. However, it's not explicitly marked as newable. What: - Mark JobSpecification as newable. Change-Id: I3dca96857c875da1ee6f0f6054a12aa6ec276697
* jobqueue: combine Logger channels, improve docs, add missing ingroup tagsTimo Tijhof2024-03-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | * combine `JobQueueFederated` and `JobQueueRedis` into a single `JobQueue` channel. * Remove duplicate descriptions from file blocks in favour of class doc blocks. This reduces needless duplication and was often incorrect or outdated, and helps (ironically) to make the file header more consistently visually ignorable. Various files in this patch contained bogus copy-pasta descriptions from unrelated classes, and re-defined `defgroup JobQueue` many times, showing exactly how this is defacto ignored and counter-productive to maintain in two places. Remove `ingroup` from file blocks in class files as otherwise the file is indexed twice (e.g. in Doxygen) which makes navigation on doc.wikimedia.org rather messy for classes in this group. Ref <https://gerrit.wikimedia.org/r/q/message:ingroup+is:merged> Change-Id: I926a3aec2bc98fefa1075c4a794c46108579ae3f
* JobSpecification: Inherit request IDGergő Tisza2023-11-301-0/+6
| | | | | | | | | | | | | | Make JobSpecification inherit the request ID of the queuing request just like Job does. This makes it easier to find log events for actions that are triggered by a web request but happen via jobs. Especially useful for enqueueable updates which might or might not happen via jobs depending on the load of the system at the moment. Bug: T351729 Change-Id: I965ee211b00b2b33970651368930b5c59704a827 Depends-On: Iccf0f3bf666b9a77fbbd5874fe2f56bfffc9bd4c Depends-On: I9613c8c293ac3fb4b1ac25c229bb4dc83e2f34fa
* jobqueue: Deprecate ::toSerializableArray() and remove unusedDerick Alangi2023-07-081-10/+2
| | | | | | | | | | | | JobSpecification::toSerializableArray() has no usage so should be deprecated and removed. Also, JobSpecification::getTitle() has long been deprecated and can now be removed as there are no callers. NOTE: Some minor typo fix in documentation. Change-Id: I83bb9c70d7942d376d585b119b685250c45c1e88
* Reorg: Namespace the Title classJames D. Forrester2023-03-021-0/+1
| | | | | | | | | | | | | | | | | | | This is moderately messy. Process was principally: * xargs rg --files-with-matches '^use Title;' | grep 'php$' | \ xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1' * rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \ xargs rg --files-with-matches 'Title\b' | \ xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1' * composer fix Then manual fix-ups for a few files that don't have any use statements. Bug: T166010 Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
* Replace deprecated JobQueueGroup::singleton()Umherirrender2022-01-271-1/+1
| | | | Change-Id: Icdb301d352d302f70fefba9b40df2368cb217fd2
* Remove Title param typehints from jobsPetr Pchelko2021-06-071-16/+29
| | | | Change-Id: I8d8407d704eac97d4b0574369e315e28e23a89a8
* Return deduplication to CategoryMembershipJobPetr Pchelko2019-10-291-1/+8
| | | | | | | | | | | After I86d26e494924eec24e7b1fb32c424ac1284be478 the job is no longer instantiated on submission, only upon execution, so deduplication flags and dedup info are no longer available to kafka queue. Bug: T204761 Depends-On: Ieb2604e65177736606aed351c6658b7df748dcee Change-Id: Ibf95638a2ad218a83347db6749e2e7c9e8dbe0db
* jobqueue: Remove 'title' and 'namespace' from JobSpecification dedup infoPetr Pchelko2019-10-021-2/+0
| | | | | | | | | | | | | After recent refactors of the jobs, the job params will contain the title information if it's relevant. So, the getDeduplicationInfo method of teh job class no longer includes page namespace/title explicitly, but it was never removed from the JobSpecification class. See fc5d51f12936 (I9c9d0726d4066bb0a). Bug: T204761 Change-Id: Ieb2604e65177736606aed351c6658b7df748dcee
* Use [...] instead of array(...) in PHP comments and documentationFomafix2019-06-171-2/+2
| | | | Change-Id: I0c83783051bf35fe785bc01644eeb2946902b6b2
* jobqueue: add GenericParameterJob and RunnableJob interfaceAaron Schulz2019-04-081-3/+13
| | | | | | | | | | Simplify the code of jobs that do not care about titles and removes the direct Title dependency from JobQueue. Remove getTitle() from IJobSpecification itself. Move all the Job::factory calls into a single JobQueue::factoryJob() method. Depends-on: Iee78f4baeca0c0b4d6db073f2fbcc56855114ab0 Change-Id: I9c9d0726d4066bb0aa937665847ad6042ade13ec
* jobqueue: simplify the signature of Job::factory() and Job::__construct()Aaron Schulz2019-03-291-1/+1
| | | | | | | | | | | | | | Remove the $title argument from these methods to simplify subclasses that do not have a meaningful title to use. The Job::getTitle() method can be overriden by subclasses to return something meaningful. The old call signature is still supported for backwards compatibility. This will automatically determine what getTitle() returns as before. Use "Blankpage" as the "not applicable" title for jobs instead of one that looks like some error occured. Change-Id: I3d5bd012d9cef1e7daaccfb0d5d319552eb89fb6
* Move interface IJobSpecification to own fileUmherirrender2019-02-041-63/+0
| | | | Change-Id: Iabb10f8473b2ef0f4aea2aaca0dad39745028ece
* Fix PhanTypeMismatchDeclaredParamUmherirrender2018-07-071-1/+1
| | | | | | Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
* Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenientBartosz Dziewoński2018-05-301-6/+2
| | | | | | | | | | | | | | Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/ Replace with: '\1 ?? ' (Everywhere except includes/PHPVersionCheck.php) (Then, manually fix some line length and indentation issues) Then manually reviewed the replacements for cases where confusing operator precedence would result in incorrect results (fixing those in I478db046a1cc162c6767003ce45c9b56270f3372). Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
* A few doc comment fixupsTim Starling2017-12-041-1/+0
| | | | | | | | | | | | | | | | * Remove some creation dates, they are not protected by GPL * Remove duplicate @defgroup API * Remove @ingroup from some @file doc comments on class files. It is not useful to list class files alongside classes in the doxygen module menu. Add @ingroup to some more class files that had @ingroup on their file, that was probably the author's intent. * In PackedOverlayImageGallery, use the file comment as a class comment * Don't put @defgroup and @file in the same comment. @defgroup makes the whole doc comment describe the group. * Instead of putting AnsiTermColorer in two groups, use hierarchical groups. Change-Id: If54f6e0b2bc1ea6de42045885cf836ee67b8e961
* Clean up remaining get_class() usesTimo Tijhof2017-03-071-1/+1
| | | | | | | | * get_class() -> __CLASS__ (same as self::class) * get_called_class() -> static::class * get_class($this) -> static::class Change-Id: I1888a1897ecf4548a2e5a67a942e5c080dd7e3d3
* Many more function case mismatchesReedy2016-03-191-1/+1
| | | | Change-Id: I5d3a5eb8adea1ecbf136415bb9fd7a162633ccca
* Convert all array() syntax to []Kunal Mehta2016-02-171-9/+9
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* Automatically deduplicate root jobs on insertionAaron Schulz2015-06-031-0/+10
| | | | | | * This makes lazyPush() simple to use in more cases Change-Id: I22e74485eaf3120e5669c5ee55dc7ab7310d7300
* Let deduplicateRootJob() accept JobSpecification for consistencyAaron Schulz2015-05-231-23/+30
| | | | Change-Id: I872c2af40028e918fe6d9a8cd32ac97c70bffdae
* Removed duplicated jobs in triggerOpportunisticLinksUpdate()Aaron Schulz2015-05-051-1/+1
| | | | | | | * They get deduplicated on final insertion, but de-duplication them on initial insertion (EnqueueJob) to avoid any build-up there. Change-Id: Ia06f2bdf59a7e57fddb22890aa0b39420c0bfa7d
* Fixed some <code> tags for doxygenAaron Schulz2015-04-291-2/+2
| | | | Change-Id: I550b8760556e4916ee9b63ee244bbbcb4d926142
* Avoid using local main page title in JobSpecificationAaron Schulz2015-04-131-1/+1
| | | | | | | * They may not work well on the wiki that runs the jobs Bug: T92789 Change-Id: I496974b11bd865ede9dd6d2cd534e0abdd7fa3f7
* Added EnqueueJob class that handles routing jobs to queuesAaron Schulz2015-03-041-4/+32
| | | | | Bug: T89308 Change-Id: Iadb34f24d8bbe94c0f9f119e530c0bbe1060df0a
* Inprove the exception message in JobSpecification::validateParamsMarius Hoch2014-03-181-1/+1
| | | | Change-Id: Ifcaa5e89e6b5dd4d89ca26203400082bff6fd85a
* Renamed /job to /jobqueueAaron Schulz2014-03-141-0/+189
Change-Id: I4c8a2b42140630838867c77a70d45ba14b5d95e2