Skip to content

build: bump to 1.0.0-beta.4 and migrate checkForUpdates to InstalledPluginRef #39

@bigpuritz

Description

@bigpuritz

Context

Upstream PR plugwerk/plugwerk#506 (closes plugwerk/plugwerk#504) is a breaking SPI change shipping in 1.0.0-beta.4:

PlugwerkUpdateChecker.checkForUpdates now takes List<InstalledPluginRef> instead of Map<String, String>. The wire-API is unchanged — only the SPI input shape changes.

Affected files in this repo

gh search code found two call sites:

  • plugwerk-java-cli-example/plugwerk-java-cli-example-app/src/main/java/io/plugwerk/example/cli/command/UpdateCommand.java
  • plugwerk-springboot-thymeleaf-example/src/main/java/io/plugwerk/example/webapp/controller/PluginInstalledController.java

Both call marketplace.updateChecker().checkForUpdates(installed) where installed is a Map<String, String>. After the bump the parameter must be a List<InstalledPluginRef>.

Migration

// before
Map<String, String> installed = pluginManager.getPlugins().stream()
    .collect(Collectors.toMap(p -> p.getPluginId(), p -> p.getDescriptor().getVersion()));
List<UpdateInfo> updates = marketplace.updateChecker().checkForUpdates(installed);

// after
import io.plugwerk.spi.model.InstalledPluginRef;

List<InstalledPluginRef> installed = pluginManager.getPlugins().stream()
    .map(p -> new InstalledPluginRef(p.getPluginId(), p.getDescriptor().getVersion()))
    .toList();
List<UpdateInfo> updates = marketplace.updateChecker().checkForUpdates(installed);

Tasks

  • Bump the Plugwerk dependency version to 1.0.0-beta.4 (in whichever gradle/libs.versions.toml / pom.xml / equivalent the examples use)
  • Migrate UpdateCommand.java (CLI example)
  • Migrate PluginInstalledController.java (Spring Boot Thymeleaf example)
  • Update any README snippets that still show the Map<String, String> shape (grep -RIn 'checkForUpdates' .)
  • Verify both example projects build and run against the new beta

Why a separate issue

The breaking change must land in the main repo first (PR #506). Once 1.0.0-beta.4 is published, this repo can pick up the new artifact and migrate. Doing it in lockstep avoids a window where examples don't compile.

Source

Upstream: plugwerk/plugwerk#504 (issue), plugwerk/plugwerk#506 (PR).

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions