Skip to content

JetBrains: Add easy access to current plugin version

Administrator requested to merge dv/jetbrains-add-dynamic-version-access into main

Created by: vdavid

Completes this task in https://github.com/sourcegraph/sourcegraph/issues/35178: "Create a Java method that can give us version information for our current extension version"

We had a version number at three places:

  1. client/jetbrains/package.json
  2. client/jetbrains/gradle.properties
  3. client/jetbrains/src/main/java/com/sourcegraph/config/ConfigUtil.java

It was a bit confusing having to update version numbers at three places. We didn't seem to use 1. anywhere, but it's a required field with a format of "x.x.x", so I set it to "0.0.0" to indicate that we're not using this.

We already had ConfigUtil#getVersion() that used to return the version number with a "v" in front (for example, "v1.2.4") and it used a hard-coded string that was already out of date ("v1.2.2"). I renamed this to getPluginVersion() to clarify its purpose, and modified it to return the pure version (for example, "1.2.4"), and to get it dynamically to the value set in gradle.properties.

Test plan

This change causes no changes in the behavior. Demoing that the "copy URL" and related features that used the version number still work: https://www.loom.com/share/2780f77f117f426f8ce7b10e16470d1e

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading