Support plugins for different methods of fetching the version value

Created on 3 March 2023, almost 2 years ago
Updated 26 June 2024, 6 months ago

Problem/Motivation

Currently the only way to get the version into the toolbar is by setting an environment variable and then configuring the module to look up the value of said variable.

In upcoming versions we would like to support different methods of fetching the version, for example from Git information or a locally stored text file.

A first step in this direction would be to

  • wrap the current version-fetching logic in a plugin class,
  • expose all available plugins in the module settings,
  • empower admins to choose the plugin to use
  • fetch the version using the selected plugin
🌱 Plan
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany marcoliver Neuss, NRW, Germany

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @marcoliver
  • Merge request !33345830 Add plugin system → (Open) created by marcoliver
  • 🇩🇪Germany manuelbitmade

    @marcoliver Looks great, I have one suggestion though: I think it might be good to have the logic of actually getting the current version in some kind of manager class instead of it being directly inside the hook_toolbar hook. I would imagine this would be preferable if someone wants to for example display the version somewhere else. While at it we could also add an "alter" hook so the version string can be altered. This is optional but might be a lifesaver for situations where you don't have complete control over the version set in the environment.

    That said it would be a perfect next release with the current implementation!

  • 🇩🇪Germany marcoliver Neuss, NRW, Germany

    Hi Manuel,

    thanks for the input! I created a small service class that now contains the whole business of finding the configured service and at the end simply returns the appropriate version string. So now the toolbar hook only calls the getVersion() function on that service.

    I think the alter hook could be handled in a separate issue.

    Feel free to let me know if the new service is okay for you and I'll go ahead and create a new release.

  • Assigned to manuelbitmade
Production build 0.71.5 2024