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.