-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Track LLM app plugin version in a constant
This will be exposed in the plugin health check from version 0.3.0 onwards, and will be very useful to enable backwards compatibility in the @grafana/experimental package. See grafana/grafana-llm-app#62 for the health check PR and #82 for an example of why knowing the version will be useful.
- Loading branch information
Showing
6 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,7 @@ | |
}, | ||
"dependencies": { | ||
"@types/uuid": "^8.3.3", | ||
"semver": "^7.5.4", | ||
"uuid": "^8.3.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,19 @@ | ||
import { logWarning } from "@grafana/runtime"; | ||
|
||
import { SemVer } from "semver"; | ||
|
||
export const LLM_PLUGIN_ID = 'grafana-llm-app'; | ||
export const LLM_PLUGIN_ROUTE = `/api/plugins/${LLM_PLUGIN_ID}`; | ||
|
||
// The LLM app was at version 0.2.0 before we added the health check. | ||
// If the health check fails, or the details don't exist on the response, | ||
// we should assume it's this older version. | ||
export let LLM_PLUGIN_VERSION = new SemVer('0.2.0'); | ||
|
||
export function setLLMPluginVersion(version: string) { | ||
try { | ||
LLM_PLUGIN_VERSION = new SemVer(version); | ||
} catch (e) { | ||
logWarning('Failed to parse version of grafana-llm-app; assuming old version is present.') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters