Skip to content

Conversation

@deer-wmde
Copy link
Contributor

@deer-wmde deer-wmde commented Jan 25, 2024

https://phabricator.wikimedia.org/T341797

  • upgrades Laravel to v10
  • upgrades phpunit to v10

note: dispatchNow has been replaced by dispatchSync (but only in the code, not for the console command! https://github.com/mxl/laravel-job/blob/master/src/Commands/DispatchNow.php)

@deer-wmde deer-wmde marked this pull request as ready for review February 16, 2024 11:30
Copy link
Contributor

@m90 m90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty solid already. I left a few questions inline, nothing blocking.

* Example:
*
* php artisan job:dispatchNow CirrusSearch\\ForceSearchIndex id 1 0 1000
* php artisan job:dispatchSync CirrusSearch\\ForceSearchIndex id 1 0 1000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we want dispatch instead. If I understand it correctly dispatchSync will not use the existing queue setup, but somehow bypass this. Right now, I would think we want this to run together with the other jobs instead.

But maybe this is also something we should look into with https://phabricator.wikimedia.org/T342866

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized this console command is completely separate from the framework anyway... https://github.com/mxl/laravel-job/blob/master/src/Commands/DispatchNow.php

But still I think you are right, dispatch is probably a better choice most of the time. I'll change the comments accordingly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some more critical instances where I'd leave it though, MediawikiUpdate.php for example https://github.com/wbstack/api/blob/e59eda7de24f1baccbb7a02c285f684eebe93ecd/app/Jobs/MediawikiUpdate.php

* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a drive by improvement or something we have to when using Laravel 10?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't tell if it's strictly necessary but looked like current best practice to me in regards to https://laravel.com/docs/10.x/upgrade#model-dates-property

I think this particular change was copied from the corresponding section of app/Models/User.php

Copy link
Contributor

@m90 m90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕙

@deer-wmde deer-wmde merged commit 00c5872 into main Feb 26, 2024
@deer-wmde deer-wmde deleted the de/laravel-10 branch February 26, 2024 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants