[VS Code] SemVer version check is calculated wrong for ee versions
Note: This is the VS Code version of [LS] Semver check is calculated wrong for ee ve... (gitlab-org/editor-extensions/gitlab-lsp#1265 - closed)
Summary
In the extension we grab the GitLab instance version. This endpoint returns a string. In the case of Dedicated and certain other cases, the version string might contain a -ee suffix, e.g. 17.5.0-ee.
We then process the version strings using the semver library, using the gte function.
This function is not intended to handle the suffixes that gitlab appends to the version. We should pass the string through coerce which produces a proper SemVer compatible version.
Steps to reproduce
This one is tricky to properly reproduce - it would require setting up an entire 17.5.0 Dedicated instance.
Instead, I've demonstrated the behavior here: https://playcode.io/2532013. It should be enough to run this and view the code in question.
What is the current bug behavior?
When using GitLab 17.5.0 and an instance that returns -ee in the version check (e.g. Dedicated), the /clear command would handled as a clearChat type message. clearChat was removed from the monolith in this version so this operation would fail.
What is the expected correct behavior?
When using GitLab 17.5.0, the /clear command would handled as a general type message.