mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 13:39:19 -06:00
Improve check on Tempo version (#74547)
This commit is contained in:
parent
5e0b20266e
commit
a939dfadf2
@ -228,16 +228,8 @@ export class TempoDatasource extends DataSourceWithBackend<TempoQuery, TempoJson
|
||||
try {
|
||||
return semver.gte(actualVersion, featuresToTempoVersion[featureName]);
|
||||
} catch {
|
||||
// An error could happen if Tempo is running locally. In that case, the version is not a semantic version
|
||||
// and instead it is in the form `<branch>-<revision>`, possibly with a `-WIP` suffix (e.g., `main-12bdeff-WIP`).
|
||||
// Thus, if the version is in the form `<branch>-<revision>`, assume that we are on the most updated
|
||||
// Tempo version and thus any feature should be considered enabled
|
||||
if (/^.*-[a-zA-Z0-9_]+(-WIP)?$/.test(actualVersion)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
console.error(`Cannot compare ${actualVersion} and ${featuresToTempoVersion[featureName]}`);
|
||||
return false;
|
||||
// We assume we are on a development and recent branch, thus we enable all features
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user