Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MM-17888 Check plugin Helpers minimum server version comments #12663

Merged
merged 16 commits into from
Oct 30, 2019
Merged

MM-17888 Check plugin Helpers minimum server version comments #12663

merged 16 commits into from
Oct 30, 2019

Conversation

pbitty
Copy link
Contributor

@pbitty pbitty commented Oct 8, 2019

Summary

This implements a CI check that ensures Minimum server version comments in the plugin.Helpers methods match the effective minimum version of all the API calls that they make.

Ticket Link

Resolves #11912.

@pbitty
Copy link
Contributor Author

pbitty commented Oct 8, 2019

Sorry, this is a big PR. I've tried to break up each change into a logical commit, so that it's easier to review. I got pretty deep into this and I think it's time to get an outside perspective.

@pbitty pbitty changed the title MM-17888 Check Plugin Helpers Minimum Server Version MM-17888 Check plugin Helpers minimum server version comments Oct 8, 2019
@pbitty
Copy link
Contributor Author

pbitty commented Oct 8, 2019

Sorry for the force-push. I was trying to get the commits to appear in the right order after doing some rebase cleanup earlier. I am done now.

@hanzei hanzei requested a review from lieut-data October 8, 2019 06:28
@hanzei hanzei added the 2: Dev Review Requires review by a developer label Oct 8, 2019
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

package main
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the logic that was formerly in main.go.

Copy link
Member

@lieut-data lieut-data left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome, @pbitty!

One, non-blocking question: are the checks transitive? That is, if a helper uses another helper, or calls a method that uses a helper/api, will it infer the version appropriately?

@lieut-data lieut-data requested a review from cpoile October 9, 2019 17:51
@lieut-data lieut-data added 3: QA Review Requires review by a QA tester. May occur at the same time as Dev Review Hacktoberfest labels Oct 9, 2019
@pbitty
Copy link
Contributor Author

pbitty commented Oct 9, 2019

Good question! No, they are not transitive. That's an interesting problem. I am happy to try to implement that, but it might be worth doing it in another Issue and/or PR.

What do you think?

Copy link
Member

@cpoile cpoile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, amazing work @pbitty ! (Love the username, btw.) . Thanks for putting in the effort for this.

One non-blocking question for @lieut-data.

res.Warnings = append(res.Warnings, renderWithFilePosition(
fset,
pos,
fmt.Sprintf("documented minimum server version too high on method %s", name)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something we want to enforce? (Just wondering if there may be a non-API reason why a function might be labelled higher than what is strictly required.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, my thoughts were that a helper might want to require a higher version in which a fix to an API was made, hence the warning. It's a purely theoretical concern right now.

@pbitty
Copy link
Contributor Author

pbitty commented Oct 11, 2019

No problem! I'm happy this is working.

@lieut-data , if you would like to make this a transitive check, I am happy to give it a shot. If you decide to create an Issue for it, feel free to assign it to me.

@lieut-data
Copy link
Member

@pbitty, I think this is great as-is -- let's let it soak for a while, and we can revisit the transitive idea separately.

@lieut-data lieut-data removed the 2: Dev Review Requires review by a developer label Oct 11, 2019
@prapti
Copy link

prapti commented Oct 15, 2019

@lieut-data does this PR need separate tests or does https://mattermost.atlassian.net/browse/MM-17889 cover this one as well?

@lieut-data
Copy link
Member

@prapti
Copy link

prapti commented Oct 15, 2019

@lieut-data great! Thanks for pointing that one out.
Do you think additional QA verification needed? I'm looking at the Jira ticket linked to this PR's [issue](#11912 and not sure if QA testing is needed, mostly because minimum server version comments was verified for https://mattermost.atlassian.net/browse/MM-17889.

@lieut-data
Copy link
Member

@prapti, this is a subtly different improvement, in which we're adding these comments to the plugin helpers specifically, not just the API. I do think it's still useful for QA verification.

@hanzei hanzei added this to the v5.18.0 milestone Oct 15, 2019
@mattermod
Copy link
Contributor

This issue has been automatically labelled "stale" because it hasn't had recent activity.
A core team member will check in on the status of the PR to help with questions.
Thank you for your contribution!

/cc @jasonblais @hanzei

@prapti prapti added QA/Review Done QA review is completed but other reviews are outstanding (exception to usual process) and removed 3: QA Review Requires review by a QA tester. May occur at the same time as Dev Review labels Oct 29, 2019
@hanzei hanzei self-assigned this Oct 30, 2019
@hanzei hanzei added the 4: Reviews Complete All reviewers have approved the pull request label Oct 30, 2019
@hanzei hanzei merged commit 7d0d7c3 into mattermost:master Oct 30, 2019
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation and removed Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Oct 31, 2019
jozuenoon pushed a commit to jozuenoon/mattermost-server that referenced this pull request Nov 2, 2019
* master: (70 commits)
  Run unused against codebase (mattermost#12968)
  [MM-12623] Create CLI command "config reset" (mattermost#10296)
  Migrate tests from store/storetest/status_store.go to use test… (mattermost#12873)
  Fix golangci-lint target (mattermost#12985)
  [MM-16437] Plugin crashes the server when calling WriteHeader with an invalid http code (mattermost#11276)
  MM-18060: Include deleted posts in compliance export. (mattermost#12957)
  [MM-18331] When patching a bot send websocket notification (mattermost#12373)
  [MM-19473] Fix data race on user login (mattermost#12870)
  license, openGraph tests: convert to testify (mattermost#12919)
  oauth_test: use testify (mattermost#12949)
  [MM-18830] Unhelpful error message when adding bot to a channel before adding to team (mattermost#12844)
  emoji_test: update to use testify (mattermost#12932)
  MM-19310 - Wrong validation message when Bot name ends in a . (mattermost#12905)
  Migrate tests from store/storetest/oauth_store.go to use testify (mattermost#12875)
  Include extra metadata when clicking an interactive button (mattermost#12697)
  MM-19553: Generate valid passwords on bulk import. (mattermost#12871)
  Convert api4/webhook_test.go t.Fatal calls into require/assert calls (mattermost#12904)
  Fix golangci-lint target for non GOPATH installations (mattermost#12934)
  MM-17888 Check plugin Helpers minimum server version comments (mattermost#12663)
  [MM-18898] Stringify plugin.Log* parameters (mattermost#12700)
  ...
@amyblais amyblais added Changelog/Done Required changelog entry has been written Docs/Needed Requires documentation labels Nov 18, 2019
@amyblais amyblais assigned aaronrothschild and unassigned hanzei Nov 21, 2019
@aaronrothschild aaronrothschild removed their assignment Feb 13, 2020
@aaronrothschild aaronrothschild removed the Docs/Needed Requires documentation label Feb 13, 2020
@pbitty pbitty deleted the MM-17888_enforce_minimum_server_version branch February 7, 2024 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Done Required changelog entry has been written Hacktoberfest QA/Review Done QA review is completed but other reviews are outstanding (exception to usual process)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Programmatically check plugin helpers minimum server version comment
8 participants