Skip to content

Commit

Permalink
Release 2.1.3 (#589)
Browse files Browse the repository at this point in the history
* Use ReactDOM webpack external (#586)

* release bump 2.1.3

* remove npm i --verbose

* Fix linter errors (#590)

Co-authored-by: Ben Schumacher <[email protected]>
  • Loading branch information
mickmister and hanzei authored Oct 31, 2022
1 parent d13f5a5 commit 1be093c
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 23 deletions.
11 changes: 5 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,38 @@ linters-settings:
simplify: true
goimports:
local-prefixes: github.com/mattermost/mattermost-plugin-github
golint:
min-confidence: 0
govet:
check-shadowing: true
enable-all: true
disable:
- fieldalignment
misspell:
locale: US
revive:
rules:
- name: error-strings
disabled: true

linters:
disable-all: true
enable:
- bodyclose
- deadcode
- errcheck
- gocritic
- gofmt
- goimports
- golint
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- revive
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unused
- varcheck
- whitespace

issues:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ endif
## Ensures NPM dependencies are installed without having to run this all the time.
webapp/node_modules: $(wildcard webapp/package.json)
ifneq ($(HAS_WEBAPP),)
cd webapp && $(NPM) install --verbose
cd webapp && $(NPM) install
touch $@
endif

Expand Down
4 changes: 2 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"description": "GitHub plugin for Mattermost.",
"homepage_url": "https://github.com/mattermost/mattermost-plugin-github",
"support_url": "https://github.com/mattermost/mattermost-plugin-github/issues",
"release_notes_url": "https://github.com/mattermost/mattermost-plugin-github/releases/tag/v2.1.2",
"release_notes_url": "https://github.com/mattermost/mattermost-plugin-github/releases/tag/v2.1.3",
"icon_path": "assets/icon.svg",
"version": "2.1.2",
"version": "2.1.3",
"min_server_version": "6.5.0",
"server": {
"executables": {
Expand Down
6 changes: 3 additions & 3 deletions server/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package client

import (
"encoding/json"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
Expand Down Expand Up @@ -73,7 +73,7 @@ func (c *Client) GetConfiguration() (*plugin.Configuration, error) {
}
defer resp.Body.Close()

respBody, err := ioutil.ReadAll(resp.Body)
respBody, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -110,7 +110,7 @@ func (c *Client) GetToken(userID string) (*oauth2.Token, error) {
}
defer resp.Body.Close()

respBody, err := ioutil.ReadAll(resp.Body)
respBody, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions server/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package client
import (
"bytes"
"encoding/json"
"io/ioutil"
"io"
"net/http"
"testing"

Expand Down Expand Up @@ -57,7 +57,7 @@ func TestGetConfiguration(t *testing.T) {
require.NoError(t, err)

pluginAPI := &plugintest.API{}
pluginAPI.On("PluginHTTP", mock.AnythingOfType("*http.Request")).Return(&http.Response{StatusCode: http.StatusOK, Body: ioutil.NopCloser(b)})
pluginAPI.On("PluginHTTP", mock.AnythingOfType("*http.Request")).Return(&http.Response{StatusCode: http.StatusOK, Body: io.NopCloser(b)})
defer pluginAPI.AssertExpectations(t)

client := NewPluginClient(pluginAPI)
Expand Down Expand Up @@ -91,7 +91,7 @@ func TestGetToken(t *testing.T) {
require.NoError(t, err)

pluginAPI := &plugintest.API{}
pluginAPI.On("PluginHTTP", mock.AnythingOfType("*http.Request")).Return(&http.Response{StatusCode: http.StatusOK, Body: ioutil.NopCloser(b)})
pluginAPI.On("PluginHTTP", mock.AnythingOfType("*http.Request")).Return(&http.Response{StatusCode: http.StatusOK, Body: io.NopCloser(b)})
defer pluginAPI.AssertExpectations(t)

client := NewPluginClient(pluginAPI)
Expand Down
3 changes: 1 addition & 2 deletions server/plugin/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package plugin

import (
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
Expand Down Expand Up @@ -48,7 +47,7 @@ func TestWithRecovery(t *testing.T) {
resp := w.Result()
if resp.Body != nil {
defer resp.Body.Close()
_, err := io.Copy(ioutil.Discard, resp.Body)
_, err := io.Copy(io.Discard, resp.Body)
require.NoError(t, err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion server/plugin/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (p *Plugin) Subscribe(ctx context.Context, githubClient *github.Client, use
}

if flags.ExcludeOrgMembers && !p.isOrganizationLocked() {
return errors.Errorf("Unable to set --exclude-org-member flag. The GitHub plugin is not locked to a single organization.")
return errors.New("Unable to set --exclude-org-member flag. The GitHub plugin is not locked to a single organization.")
}

var err error
Expand Down
12 changes: 7 additions & 5 deletions server/plugin/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ const mdCommentRegexPattern string = `(<!--[\S\s]+?-->)`

// There is no public documentation of what constitutes a GitHub username, but
// according to the error messages returned in https://github.com/join, it must:
// 1. be between 1 and 39 characters long.
// 2. contain only alphanumeric characters or non-adjacent hyphens.
// 3. not begin or end with a hyphen.
// 1. be between 1 and 39 characters long.
// 2. contain only alphanumeric characters or non-adjacent hyphens.
// 3. not begin or end with a hyphen.
//
// When matching a valid GitHub username in the body of messages, it must:
// 4. not be preceded by an underscore, a backtick (that cryptic \x60) or an
// alphanumeric character.
// 4. not be preceded by an underscore, a backtick (that cryptic \x60) or an
// alphanumeric character.
//
// Ensuring the maximum length is not trivial without lookaheads, so this
// regexp ensures only the minimum length, besides points 2, 3 and 4.
// Note that the username, with the @ sign, is in the second capturing group.
Expand Down
1 change: 1 addition & 0 deletions webapp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ module.exports = {
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
redux: 'Redux',
'react-redux': 'ReactRedux',
'prop-types': 'PropTypes',
Expand Down

0 comments on commit 1be093c

Please sign in to comment.