Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-10713: Remove VersionChecker service #193

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions config/optional/rest.resource.helfi_debug_package_version.yml

This file was deleted.

11 changes: 0 additions & 11 deletions documentation/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,3 @@ See [src/Plugin/DebugDataItem/Composer.php](/src/Plugin/DebugDataItem/Composer.p
At minimum, you need:
- A plugin class that implements `\Drupal\helfi_debug\DebugDataItemInterface`
- A plugin specific template (`debug-item--{plugin_id}.html.twig`). See [templates/debug-item.html.twig](/templates/debug-item.html.twig) for more information.

## Package version checker

The `/api/v1/version` endpoint can be used to fetch the latest version of a composer package.

For example:

Request `GET /api/v1/version?package=drupal/helfi_api_base&version=1.2.0` will respond with:

- The latest version number
- Whether the given version is the latest version
10 changes: 10 additions & 0 deletions helfi_api_base.install
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,13 @@ function _helfi_api_base_process_links(ContentEntityInterface $entity, string $f
$entity->save();
}
}

/**
* UHF-10713 Remove VersionChecker.
*/
function helfi_api_base_update_9023(): void {
\Drupal::entityTypeManager()
->getStorage('rest_resource_config')
->load('helfi_debug_package_version')
->delete();
}
2 changes: 2 additions & 0 deletions helfi_api_base.permissions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ view remote entities:
title: View remote entities
edit remote entities:
title: Edit remote entities
access debug page:
title: Access debug page
2 changes: 1 addition & 1 deletion helfi_api_base.routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ helfi_api_base.debug_list:
_title: 'Debug'
_controller: '\Drupal\helfi_api_base\Controller\DebugController::build'
requirements:
_permission: 'restful get helfi_debug_package_version'
_permission: 'access debug page'
14 changes: 0 additions & 14 deletions helfi_api_base.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,6 @@ services:
class: Drupal\helfi_api_base\DebugDataItemPluginManager
parent: default_plugin_manager

Drupal\helfi_api_base\Package\VersionChecker: '@helfi_api_base.package_version_checker'
helfi_api_base.package_version_checker:
class: Drupal\helfi_api_base\Package\VersionChecker
arguments: []
tags:
- { name: service_collector, call: add, tag: helfi_api_base.version_checker }

Drupal\helfi_api_base\Package\HelfiPackage: '@helfi_api_base.helfi_package_version_checker'
helfi_api_base.helfi_package_version_checker:
class: Drupal\helfi_api_base\Package\HelfiPackage
arguments: ['@http_client']
tags:
- { name: helfi_api_base.version_checker }

Drupal\helfi_api_base\EventSubscriber\EnvironmentResponseSubscriber: '@helfi_api_base.environment_response_subscriber'
helfi_api_base.environment_response_subscriber:
class: Drupal\helfi_api_base\EventSubscriber\EnvironmentResponseSubscriber
Expand Down
12 changes: 12 additions & 0 deletions src/Exception/VersionCheckException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace Drupal\helfi_api_base\Exception;

/**
* Indicated failure to check versions.
*/
class VersionCheckException extends \RuntimeException {
hyrsky marked this conversation as resolved.
Show resolved Hide resolved

}
89 changes: 0 additions & 89 deletions src/Package/HelfiPackage.php

This file was deleted.

43 changes: 0 additions & 43 deletions src/Package/Version.php

This file was deleted.

56 changes: 0 additions & 56 deletions src/Package/VersionChecker.php

This file was deleted.

38 changes: 0 additions & 38 deletions src/Package/VersionCheckerInterface.php

This file was deleted.

Loading
Loading