- Issue created by @yas
- Status changed to Needs work
10 months ago 7:40am 28 February 2024 - Status changed to Needs review
10 months ago 9:13am 28 February 2024 - πΊπΈUnited States yas California πΊπΈ
@baldwinlouie
Can you please review the patch? Especially I want you to review the code such as
$cloud_config_storage = $this->entityTypeManager()->getStorage('cloud_config');
, which looks invalid, and alsoError::logException()
refactoring.Please refer the test results by https://git.drupalcode.org/project/cloud/-/pipelines/105757 and ignore the following error message:
------ --------------------------------------------------------------------- Line modules/cloud_service_providers/k8s/k8s.module ------ --------------------------------------------------------------------- 790 Call to static method getOptionsListByRegion() on an unknown class Drupal\Core\DateTime\TimeZoneFormHelper. π‘ Learn more at https://phpstan.org/user-guide/discovering-symbols ------ ---------------------------------------------------------------------
I believe the code
return TimeZoneFormHelper::getOptionsListByRegion()
is valid however please correct me if I'm wrong.Thanks!
- Merge request !2242Issue #3424222 by yas: Comply with Drupal coding standards (30) (phpstan) β (Merged) created by yas
- πΊπΈUnited States yas California πΊπΈ
@baldwinlouie
FYI, I fixed the following error by including the namespace for
Drupal\Core\DateTime\TimeZoneFormHelper::getOptionsListByRegion()
------ --------------------------------------------------------------------- Line modules/cloud_service_providers/k8s/k8s.module ------ --------------------------------------------------------------------- 790 Call to static method getOptionsListByRegion() on an unknown class Drupal\Core\DateTime\TimeZoneFormHelper. π‘ Learn more at https://phpstan.org/user-guide/discovering-symbols ------ ---------------------------------------------------------------------
- πΊπΈUnited States yas California πΊπΈ
- Status changed to Needs work
10 months ago 5:43am 1 March 2024 - πΊπΈUnited States baldwinlouie
@yas, Thank you for working on this patch.
I think the
Error::logException()
looks good. My concern is the updates for revision handling.I downloaded and ran this patch to check the
revision
handling.The usage of
$entity_storage->getRevision($revision_id)
causes a 500 error becausegetRevision()
method doesn't exist.I've been playing with how to use the
loadRevision
fromRevisionableStorageInterface
. I think the following modifications should work.Consider the usage in
updateCloudLaunchTemplate
inEc2BatchOperation.php
. The following adjustments made it work. You can recreate this error if you try to `Refresh` AWS launch template. The code that refreshes aws launch templates interacts with Revisions.1. Anywhere you need to load entities with revisions, add
PHPDoc comment
to add typehinting./** @var \Drupal\Core\Entity\RevisionableStorageInterface $entity_storage */ $entity_storage = $entity_type_manager->getStorage('cloud_launch_template');
2. Change
$entity_storage->getRevision
back to$entity_storage->loadRevision($revision_id);
.What do you think?
- Status changed to Needs review
10 months ago 8:37am 1 March 2024 - πΊπΈUnited States yas California πΊπΈ
@baldwinlouie
Thank you for your confirmation and suggestion. I added the type hint to avoid the phpstan warnings. I reverted to loadRevision and refactor to use getRevision() if possible.
Can you please review the patch again? Thanks!
- πΊπΈUnited States baldwinlouie
@yas, thank you for updating the patch. I posted my second round of comments. Basically, all `getRevision()` should be changed to `loadRevision()`. Otherwise you will encounter errors such as the following screenshot
To reproduce this error.
1. Go to any AWS Launch Template and click "Edit"
2. Then click the "Revisions" tab.With the current `getRevision()` code, the "Revisions" tab will error out.
- πΊπΈUnited States yas California πΊπΈ
@baldwinlouie
Thank you for your review. I am sorry for my misunderstanding. I confirmed the patch on local environment, and it works. Can you please check the patch again? Thanks!
- Status changed to RTBC
10 months ago 10:50pm 1 March 2024 - πΊπΈUnited States baldwinlouie
@yas, thank you for the update! The patch looks good to me now!
- πΊπΈUnited States yas California πΊπΈ
@baldwinlouie
Thank you for your review. I'll merge the patch to
7.x
, and close this issue as Fixed. - Status changed to Fixed
10 months ago 12:29am 2 March 2024 - Merge request !2245Issue #3424222 by yas, baldwinlouie: Hotfix - Comply with Drupal coding standards (30) (phpstan) β (Merged) created by yas
- πΊπΈUnited States yas California πΊπΈ
@baldwinlouie
I found a bug and fixed it. I'll merge the hotfix to
7.x
branchand close this issue as Fixed. Thanks! - Status changed to RTBC
10 months ago 7:28am 3 March 2024 - Status changed to Fixed
10 months ago 7:28am 3 March 2024 - Status changed to Needs work
10 months ago 10:46am 3 March 2024 - πΊπΈUnited States yas California πΊπΈ
I found the following error; so I'll fix it.
TypeError: Drupal\aws_cloud\Service\AwsCloud\AwsCloudOperationsService::__construct(): Argument #1 ($entity_type_manager) must be of type Drupal\Core\Entity\EntityTypeManagerInterface, Drupal\cloud\Plugin\cloud\config\CloudConfigPluginManager given, called in /var/www/cloud_orchestrator/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php on line 260 in Drupal\aws_cloud\Service\AwsCloud\AwsCloudOperationsService->__construct() (line 162 of /var/www/cloud_orchestrator/docroot/modules/contrib/cloud/modules/cloud_service_providers/aws_cloud/src/Service/AwsCloud/AwsCloudOperationsService.php).
- Merge request !2246Issue #3424222 by yas: Hotfix2 - Comply with Drupal coding standards (30) (phpstan) β (Merged) created by yas
- Status changed to Needs review
10 months ago 10:54am 3 March 2024 - πΊπΈUnited States yas California πΊπΈ
I tested the patch, so it should work.
- πΊπΈUnited States yas California πΊπΈ
@baldwinlouie
I'll merge the hotfix to
7.x
branch and close this issue as Fixed. Thanks! - Status changed to RTBC
10 months ago 10:55am 3 March 2024 - Status changed to Fixed
10 months ago 10:55am 3 March 2024 Automatically closed - issue fixed for 2 weeks with no activity.