Problem/Motivation

  • update_process_project_info
  • update_calculate_project_data
  • update_calculate_project_update_status

Steps to reproduce

Proposed resolution

Create UpdateCalculator service
public getProjectData
protected processProjectInfo
protected updateProjectStatus
Create an UpdateProject value object
Create an UpdateServerProjectInfo value object

Remaining tasks

Review

User interface changes

N/A

Introduced terminology

N/A

API changes

Data model changes

N/A

Release notes snippet

N/A

Issue fork drupal-3580705

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nicxvan created an issue. See original summary.

nicxvan’s picture

Issue summary: View changes
dww’s picture

Not duplicate, but definitely related to #3100110: Convert update_calculate_project_update_status() into a class. I haven’t had time or urgency to circle back to that issue. I sort of remember not fully agreeing with where it ended up, but there’s a lot of prior work in there that needs to either be refreshed and finished or at least considered before proceeding here.

My initial concern with this plan (and its siblings) is we already have some weird services that are sort of incomplete and interact with each other in “interesting” ways. I wasn't around core for a few years when folks started OOP-ifying this module. I don't love any of how it’s currently split up. I'd love to take some time (which I don't have in the next ~3 weeks) to really think about it and come up with a more wholistic plan for how we should organize all this. I'd rather do that before we start introducing new services.

nicxvan’s picture

We will do our best not to make this worse, but we do want to deprecate and move these functions.

nicxvan’s picture

Didn't do deprecations for new parameters, not sure how to handle a final and private constructor either.

I also didn't inject key value expirable, still need to do that.

I didn't update the CR yet.

nicxvan’s picture

For the private final classes I just added the new parameter.
I added the deprecation.

I also added a custom CR for this that needs updating.

nicxvan’s picture

Status: Active » Needs review

This is ready for review.

nicxvan’s picture

Status: Needs review » Needs work

Strict types is causing a couple of failures, I can't review why right now though.

nicxvan’s picture

Status: Needs work » Needs review

I reached out to @godotislate in slack for help and here helped be find the cause in the build tests.

It turns out it's actually pretty deep in the extension so not something to fix here.

@godotislate said it would be OK to drop strict types and leave a comment.

Edit: definitely need to give @godotislate credit, but I'm on my phone and not logged into new.d.o

nicxvan’s picture

Status: Needs review » Needs work

Got a few things to address, thanks!

nicxvan’s picture

Ok I addressed most of the feedback, we still need to introduce the value object for project information.

nicxvan’s picture

Ok I pushed the first value object, it introduced some failures though to track down.

nicxvan’s picture

I added the updateproject value object, one of the logic branches changed and I haven't tracked it down yet.

nicxvan’s picture

Issue summary: View changes

nicxvan changed the visibility of the branch 3580705-deprecate-update.compare-functions to hidden.

nicxvan changed the visibility of the branch 3580705-update.comparev2 to hidden.

nicxvan’s picture

Status: Needs work » Needs review

Ok I think this is ready for review, I created two value objects for the main method.

This issue is large, but we only touch 3 functions so hopefully it's ok, we add two value objects to help with the boundary of project comparison. The only logic changes were converting from an array to an object.

I took inspiration from the issue mentioned in 3, but kept the UpdateProject as a strict value object.

This could use further refactoring, but that should be done in follow ups.