From 6c460dbe7ca3935af4b0484fc363a3853109b41a Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:21:45 -0400 Subject: [PATCH 01/13] Update instance_server.go --- server/instance_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/instance_server.go b/server/instance_server.go index 14b04d844..371e22061 100644 --- a/server/instance_server.go +++ b/server/instance_server.go @@ -72,7 +72,7 @@ func (jsi jiraServerInstance) GetJIRAClient(jiraUser JIRAUser) (returnClient *ji if returnErr == nil { return } - returnErr = errors.WithMessage(returnErr, "failed to get a JIRA client for "+jiraUser.Name) + returnErr = errors.WithMessage(returnErr, "failed to get a Jira client for "+jiraUser.Name) }() if jiraUser.Oauth1AccessToken == "" || jiraUser.Oauth1AccessSecret == "" { From b0b4b41cbea242d08dd152ed66b1cb80a2884d1e Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:22:25 -0400 Subject: [PATCH 02/13] JIRA -> Jira in error text --- server/instance_cloud.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/instance_cloud.go b/server/instance_cloud.go index 49dbf08d9..5cda1c566 100644 --- a/server/instance_cloud.go +++ b/server/instance_cloud.go @@ -77,7 +77,7 @@ func (jci jiraCloudInstance) GetJIRAClient(jiraUser JIRAUser) (*jira.Client, err //TODO decide if we ever need this as the default client // client, err = jci.getJIRAClientForServer() if err != nil { - return nil, errors.WithMessage(err, "failed to get JIRA client for user "+jiraUser.Name) + return nil, errors.WithMessage(err, "failed to get Jira client for user "+jiraUser.Name) } return client, nil From b8ea534151ce805a4bea2b156b4ae37a33446c87 Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:41:00 -0400 Subject: [PATCH 03/13] JIRA > Jira, text update for Jira Server URL help text --- plugin.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin.json b/plugin.json index 2b3b4912e..b9bce7a7b 100644 --- a/plugin.json +++ b/plugin.json @@ -1,7 +1,7 @@ { "id": "jira", - "name": "JIRA", - "description": "Atlassian JIRA plugin for Mattermost.", + "name": "Jira", + "description": "Atlassian Jira plugin for Mattermost.", "version": "2.0.0", "server": { "executables": { @@ -22,9 +22,9 @@ "help_text": "Select the username that this integration is attached to." }, { "key": "JiraServerURL", - "display_name": "JIRA Server URL", + "display_name": "Jira Server URL", "type": "text", - "help_text": "URL of the JIRA Server to connect to, e.g. \"https://jira.internal.my-company-name.com\"" + "help_text": "The URL for a self-hosted Jira server, e.g. \"https://jira.internal.my-company-name.com\"" }, { "key": "Secret", "display_name": "Secret", @@ -32,6 +32,6 @@ "help_text": "This secret is used to authenticate to Mattermost.", "regenerate_help_text": "Regenerates the secret for the webhook URL endpoint. Regenerating the secret invalidates your existing JIRA integrations." }], - "footer": "Use this webhook URL to set up the JIRA integration. See [documentation](https://about.mattermost.com/default-jira-plugin) to learn more.\n\n`https://SITEURL/plugins/jira/webhook?secret=WEBHOOKSECRET&team=TEAMURL&channel=CHANNELURL`" + "footer": "Use this webhook URL to set up the Jira integration. See [documentation](https://about.mattermost.com/default-jira-plugin) to learn more.\n\n`https://SITEURL/plugins/jira/webhook?secret=WEBHOOKSECRET&team=TEAMURL&channel=CHANNELURL`" } } From 845ebfd12c8ebc9dcffcd8a99852cfc897ca41c3 Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:43:01 -0400 Subject: [PATCH 04/13] Update kv.go --- server/kv.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/server/kv.go b/server/kv.go index 67266158a..2dea2c09c 100644 --- a/server/kv.go +++ b/server/kv.go @@ -89,7 +89,7 @@ func (p *Plugin) StoreJIRAInstance(ji Instance, current bool) (returnErr error) return } returnErr = errors.WithMessage(returnErr, - fmt.Sprintf("failed to store JIRA instance:%+v", ji)) + fmt.Sprintf("failed to store Jira instance:%+v", ji)) }() err := p.kvSet(md5key(prefixJIRAInstance, ji.GetURL()), ji) @@ -116,7 +116,7 @@ func (p *Plugin) StoreJIRAInstance(ji Instance, current bool) (returnErr error) } } - p.debugf("Stored: JIRA instance (current:%v): %#v", current, ji) + p.debugf("Stored: Jira instance (current:%v): %#v", current, ji) return nil } @@ -124,7 +124,7 @@ func (p *Plugin) StoreJIRAInstance(ji Instance, current bool) (returnErr error) func (p *Plugin) LoadCurrentJIRAInstance() (Instance, error) { ji, err := p.loadJIRAInstance(keyCurrentJIRAInstance) if err != nil { - return nil, errors.WithMessage(err, "failed to load current JIRA instance") + return nil, errors.WithMessage(err, "failed to load current Jira instance") } return ji, nil @@ -133,7 +133,7 @@ func (p *Plugin) LoadCurrentJIRAInstance() (Instance, error) { func (p *Plugin) LoadJIRAInstance(key string) (Instance, error) { ji, err := p.loadJIRAInstance(md5key(prefixJIRAInstance, key)) if err != nil { - return nil, errors.WithMessage(err, "failed to load JIRA instance "+key) + return nil, errors.WithMessage(err, "failed to load Jira instance "+key) } return ji, nil @@ -168,7 +168,7 @@ func (p *Plugin) loadJIRAInstance(fullkey string) (Instance, error) { return jsi.InitWithPlugin(p), nil } - return nil, errors.New(fmt.Sprintf("JIRA instance %s has unsupported type: %s", fullkey, jsi.Type)) + return nil, errors.New(fmt.Sprintf("Jira instance %s has unsupported type: %s", fullkey, jsi.Type)) } func (p *Plugin) StoreKnownJIRAInstances(known map[string]string) (returnErr error) { @@ -177,7 +177,7 @@ func (p *Plugin) StoreKnownJIRAInstances(known map[string]string) (returnErr err return } returnErr = errors.WithMessage(returnErr, - fmt.Sprintf("failed to store known JIRA instances %+v", known)) + fmt.Sprintf("failed to store known Jira instances %+v", known)) }() return p.kvSet(keyKnownJIRAInstances, known) @@ -187,7 +187,7 @@ func (p *Plugin) LoadKnownJIRAInstances() (map[string]string, error) { known := map[string]string{} err := p.kvGet(keyKnownJIRAInstances, &known) if err != nil { - return nil, errors.WithMessage(err, "failed to load known JIRA instances") + return nil, errors.WithMessage(err, "failed to load known Jira instances") } return known, nil } @@ -198,7 +198,7 @@ func (p *Plugin) StoreUserInfo(ji Instance, mattermostUserId string, jiraUser JI return } returnErr = errors.WithMessage(returnErr, - fmt.Sprintf("failed to store JIRA user, mattermostUserId:%s, user:%#v", mattermostUserId, jiraUser)) + fmt.Sprintf("failed to store Jira user, mattermostUserId:%s, user:%#v", mattermostUserId, jiraUser)) }() err := p.kvSet(keyWithInstance(ji, mattermostUserId), jiraUser) @@ -211,7 +211,7 @@ func (p *Plugin) StoreUserInfo(ji Instance, mattermostUserId string, jiraUser JI return err } - p.debugf("Stored: JIRA user, keys:\n\t%s (%s): %+v\n\t%s (%s): %s", + p.debugf("Stored: Jira user, keys:\n\t%s (%s): %+v\n\t%s (%s): %s", keyWithInstance(ji, mattermostUserId), mattermostUserId, jiraUser, keyWithInstance(ji, jiraUser.Name), jiraUser.Name, mattermostUserId) @@ -225,7 +225,7 @@ func (p *Plugin) LoadJIRAUser(ji Instance, mattermostUserId string) (JIRAUser, e err := p.kvGet(keyWithInstance(ji, mattermostUserId), &jiraUser) if err != nil { return JIRAUser{}, errors.WithMessage(err, - fmt.Sprintf("failed to load JIRA user for mattermostUserId:%s", mattermostUserId)) + fmt.Sprintf("failed to load Jira user for mattermostUserId:%s", mattermostUserId)) } if len(jiraUser.Key) == 0 { return JIRAUser{}, ErrUserNotFound @@ -238,7 +238,7 @@ func (p *Plugin) LoadMattermostUserId(ji Instance, jiraUserName string) (string, err := p.kvGet(keyWithInstance(ji, jiraUserName), &mattermostUserId) if err != nil { return "", errors.WithMessage(err, - "failed to load Mattermost user ID for JIRA user: "+jiraUserName) + "failed to load Mattermost user ID for Jira user: "+jiraUserName) } if len(mattermostUserId) == 0 { return "", ErrUserNotFound From 48e23045600b0896e9adf1138f63edd750cd0c99 Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:43:44 -0400 Subject: [PATCH 05/13] Update message_posted.go --- server/message_posted.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/message_posted.go b/server/message_posted.go index e8d759128..4d4a4adde 100644 --- a/server/message_posted.go +++ b/server/message_posted.go @@ -53,7 +53,7 @@ func (p *Plugin) MessageHasBeenPosted(c *plugin.Context, post *model.Post) { } if channel.Type != model.CHANNEL_OPEN { - err = errors.New("ignoring JIRA comment in " + channel.Name) + err = errors.New("ignoring Jira comment in " + channel.Name) return } @@ -80,7 +80,7 @@ func (p *Plugin) MessageHasBeenPosted(c *plugin.Context, post *model.Post) { _, _, err := jiraClient.Issue.AddComment(issue, comment) if err != nil { - p.errorf("MessageHasBeenPosted: failed to add the comment to JIRA, error: %v", err) + p.errorf("MessageHasBeenPosted: failed to add the comment to Jira, error: %v", err) } } } From 32c626b5a63a679c286be965e0b48569a51f8e7b Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:44:31 -0400 Subject: [PATCH 06/13] JIRA > Jira --- server/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/user.go b/server/user.go index ce6e9f3f1..044b9a7dd 100644 --- a/server/user.go +++ b/server/user.go @@ -93,7 +93,7 @@ func httpUserDisconnect(p *Plugin, w http.ResponseWriter, r *http.Request) (int, -

Disconnected from JIRA. Please close this page.

+

Disconnected from Jira. Please close this page.

` From 423c794e1c2ed74fd31f22c0390b7e5b7adbed74 Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:44:54 -0400 Subject: [PATCH 07/13] Update user_oauth1.go --- server/user_oauth1.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/user_oauth1.go b/server/user_oauth1.go index 765b3ff4d..4e47b7e3a 100644 --- a/server/user_oauth1.go +++ b/server/user_oauth1.go @@ -23,13 +23,13 @@ func httpOAuth1Complete(p *Plugin, w http.ResponseWriter, r *http.Request) (int, jis, ok := ji.(*jiraServerInstance) if !ok { return http.StatusInternalServerError, - errors.New("Must be a JIRA Server instance, is " + ji.GetType()) + errors.New("Must be a Jira Server instance, is " + ji.GetType()) } requestToken, verifier, err := oauth1.ParseAuthorizationCallback(r) if err != nil { return http.StatusInternalServerError, - errors.WithMessage(err, "failed to parse callback request from JIRA") + errors.WithMessage(err, "failed to parse callback request from Jira") } requestSecret, err := p.LoadOneTimeSecret(requestToken) From 63e16b5f1cd8f7dcecab564d5b33c8337de88c32 Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:45:10 -0400 Subject: [PATCH 08/13] Update utils.go --- server/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/utils.go b/server/utils.go index 092cffa2f..d2819f4f4 100644 --- a/server/utils.go +++ b/server/utils.go @@ -48,7 +48,7 @@ func (p *Plugin) CreateBotDMPost(userId, message, postType string) (returnErr er func (p *Plugin) loadJIRAProjectKeys(jiraClient *jira.Client) ([]string, error) { list, _, err := jiraClient.Project.GetList() if err != nil { - return nil, errors.WithMessage(err, "Error requesting list of JIRA projects") + return nil, errors.WithMessage(err, "Error requesting list of Jira projects") } projectKeys := []string{} From 4e0e0dd683c5d1b601b610a1f089adf5871e1a9f Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:45:41 -0400 Subject: [PATCH 09/13] JIRA > Jira --- server/webhook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/webhook.go b/server/webhook.go index 6eff335b8..ae5e887b4 100644 --- a/server/webhook.go +++ b/server/webhook.go @@ -91,7 +91,7 @@ func httpWebhook(p *Plugin, w http.ResponseWriter, r *http.Request) (int, error) // TODO add JWT support cfg := p.getConfig() if cfg.Secret == "" || cfg.UserName == "" { - return http.StatusForbidden, fmt.Errorf("JIRA plugin not configured correctly; must provide Secret and UserName") + return http.StatusForbidden, fmt.Errorf("Jira plugin not configured correctly; must provide Secret and UserName") } err := r.ParseForm() From c63e722b3e5337885cff88a04bdefaf7f7c1dfb6 Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:46:06 -0400 Subject: [PATCH 10/13] JIRA > Jira --- server/user_atlassian_connect.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/user_atlassian_connect.go b/server/user_atlassian_connect.go index 113da7435..1a84bc210 100644 --- a/server/user_atlassian_connect.go +++ b/server/user_atlassian_connect.go @@ -28,7 +28,7 @@ func httpACUserConfig(p *Plugin, w http.ResponseWriter, r *http.Request) (int, e } jci, ok := ji.(*jiraCloudInstance) if !ok { - return http.StatusBadRequest, errors.New("Must be a JIRA Cloud instance, is " + ji.GetType()) + return http.StatusBadRequest, errors.New("Must be a Jira Cloud instance, is " + ji.GetType()) } _, tokenString, err := jci.parseHTTPRequestJWT(r) @@ -62,7 +62,7 @@ func httpACUserConfigSubmit(p *Plugin, w http.ResponseWriter, r *http.Request) ( } jci, ok := ji.(*jiraCloudInstance) if !ok { - return http.StatusBadRequest, errors.New("Must be a JIRA Cloud instance, is " + ji.GetType()) + return http.StatusBadRequest, errors.New("Must be a Jira Cloud instance, is " + ji.GetType()) } jwtToken, _, err := jci.parseHTTPRequestJWT(r) @@ -116,7 +116,7 @@ func httpACUserConfigSubmit(p *Plugin, w http.ResponseWriter, r *http.Request) ( - granted Mattermost user ` + mmuser.GetDisplayName(model.SHOW_NICKNAME_FULLNAME) + " (" + mmuser.Username + `) access to JIRA as ` + displayName + " (" + username + `) + granted Mattermost user ` + mmuser.GetDisplayName(model.SHOW_NICKNAME_FULLNAME) + " (" + mmuser.Username + `) access to Jira as ` + displayName + " (" + username + `) `)) if err != nil { From b975c52d023ee17deeb09ce73f6b1ff0fecca0ac Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:47:11 -0400 Subject: [PATCH 11/13] Update create_issue.jsx --- .../components/post_menu_actions/create_issue/create_issue.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/components/post_menu_actions/create_issue/create_issue.jsx b/webapp/src/components/post_menu_actions/create_issue/create_issue.jsx index ab695f536..54f6b0f7b 100644 --- a/webapp/src/components/post_menu_actions/create_issue/create_issue.jsx +++ b/webapp/src/components/post_menu_actions/create_issue/create_issue.jsx @@ -63,7 +63,7 @@ export default class CreateIssuePostMenuAction extends PureComponent { role='menuitem' onClick={this.connectClick} > - {'Connect to JIRA'} + {'Connect to Jira'} ); } From 2b026f8f10d90e8325ff5c22462f3aa5f1f3352c Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:48:45 -0400 Subject: [PATCH 12/13] Update http.go --- server/http.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/http.go b/server/http.go index d92e30237..0855486a8 100644 --- a/server/http.go +++ b/server/http.go @@ -32,7 +32,7 @@ const ( func (p *Plugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request) { config := p.getConfig() if config.UserName == "" { - http.Error(w, "JIRA plugin not configured correctly; must provide UserName", http.StatusForbidden) + http.Error(w, "Jira plugin not configured correctly; must provide UserName", http.StatusForbidden) return } @@ -75,7 +75,7 @@ func handleHTTPRequest(p *Plugin, w http.ResponseWriter, r *http.Request) (int, case routeIncomingWebhook, routeIncomingIssueEvent: return httpWebhook(p, w, r) - // Oauth1 (JIRA Server) + // Oauth1 (Jira Server) case routeOAuth1Complete: return httpOAuth1Complete(p, w, r) case routeOAuth1PublicKey: From 78f49139582f2d372a318113ce4e936a544d23e3 Mon Sep 17 00:00:00 2001 From: Jason Blais <13119842+jasonblais@users.noreply.github.com> Date: Wed, 1 May 2019 14:49:36 -0400 Subject: [PATCH 13/13] JIRA > Jira --- server/templates/atlassian-connect.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/templates/atlassian-connect.json b/server/templates/atlassian-connect.json index b1f28d075..6a4553013 100644 --- a/server/templates/atlassian-connect.json +++ b/server/templates/atlassian-connect.json @@ -2,7 +2,7 @@ { "key": "{{ .Key }}", "name": "Mattermost Plugin ({{ .ExternalURL }})", - "description": "Integrates JIRA with Mattermost for in-place interactions and notifications", + "description": "Integrates Jira with Mattermost for in-place interactions and notifications", "vendor": { "name": "Mattermost", "url": "https://github.com/mattermost"