Enforce minimum server version comment in `plugin/api.go`.

Description

In plugin/api.go, we document the minimum required server version to use an API, e.g.:

This means that the API was first added to Mattermost 5.8, and simply won't be available in earlier versions.

Let's add a build-check that ensures this comment is present and well formatted as the last comment prior to all methods on the API interface. Methods without an explicit comment are implicitly supported in Mattermost 5.2 and later and should be updated as part of this ticket to be explicit. Once this issue is resolved, new API methods without a well-formed minimum server version comment should fail the build.

Use Go reflection to solve this problem. Do not rely on grep.

QA Test Steps

  • Edit plugin/api.go and change a comment on the file to omit / misformat the `Minimum server version...`

  • run `make govet`

  • Ensure the vetting fails with an error about the above syntax.

  • Fix the syntax issue

  • run `make govet`

  • Ensure the vetting passes

Reporter

None

Mana

None

Assignee

Mattermost Community

QA Assignee

Prapti Shrestha

Reporter

Jesse Hallam

Epic Link

None

Fix versions

Mattermost Team

Toolkit

Sprint

None

Labels

None

QA Testing Areas

Other (write in QA test steps)

Components

None
Configure