Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Added telemetry, test and bug fix for true up notifications #12170

Merged
merged 9 commits into from
Feb 22, 2023

Conversation

Afsoon
Copy link
Contributor

@Afsoon Afsoon commented Feb 7, 2023

Summary

This PR includes:

  • Add Telemetry when an admin clicks on True Up Notifications and their respective test to ensure the event is correct.
  • Bug fix where the invite modal now renders conditionally the CTA based on license data. I found this bug during the development of the telemetry ticket.

Ticket Link

Bug: https://mattermost.atlassian.net/browse/MM-50380
Telemetry: https://mattermost.atlassian.net/browse/MM-50343

Release Note

Bug fix where the true up notification in invite modal now render the CTA correctly

@Afsoon Afsoon added the 2: Dev Review Requires review by a core commiter label Feb 7, 2023
@Afsoon Afsoon self-assigned this Feb 7, 2023
Copy link
Contributor

@neallred neallred left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @Afsoon ! Just a few typos, some verbiage to sync up, and a possible simplification on the overage hook.

expandableLink,
trackEventFn,
getRequestState,
isExpendable,
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo nit: Change the various usages of expendable to expandable

@@ -85,15 +98,24 @@ const OverageUsersBannerNotice = () => {
id='licensingPage.overageUsersBanner.noticeDescription'
defaultMessage='Notify your Customer Success Manager on your next true-up check. <a>Contact Sales</a>'
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Since we are setting the inner link text dynamically, I tihnk we should change the defaultMessage and i18n/en.json string to say ... check. <a></a>

}
}, [dispatch, getRequestState, licenseId, shouldRequest]);

useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: since the value of isExpandable depends on the subscription stats call being made and defaults to false, and since the default state of the isExpandable value is already false, I think we can simplify cta to be a useMemo without any useState or useEffect, like this:

const cta = useMemo(() => (
  isExpandable ? formatMessage({
                id: 'licensingPage.overageUsersBanner.ctaExpandSeats',
                defaultMessage: 'Purchase additional seats',
            })
            : formatMessage({
                id: 'licensingPage.overageUsersBanner.cta',
                defaultMessage: 'Contact Sales',
            })
), [isExpandable])

We can use whatever formatting and forms of return for the useMemo, just picked the ternary because it was easy to type in the Github review comment box.

@marianunez marianunez added the 3: QA Review Requires review by a QA tester label Feb 10, 2023
@mattermost-build
Copy link
Contributor

Successfully triggered E2E testing!
GitLab pipeline | Test dashboard

@yasserfaraazkhan yasserfaraazkhan added the Setup Cloud + CWS Test Server Setup a test server linked to the CWS test portal label Feb 13, 2023
@mm-cloud-bot mm-cloud-bot removed the Setup Cloud + CWS Test Server Setup a test server linked to the CWS test portal label Feb 13, 2023
@yasserfaraazkhan yasserfaraazkhan added the Setup Cloud Test Server Setup a test server using Mattermost Cloud label Feb 13, 2023
@neallred neallred assigned neallred and unassigned Afsoon Feb 14, 2023
@yasserfaraazkhan
Copy link
Contributor

/update-branch

@yasserfaraazkhan
Copy link
Contributor

/e2e-test

@mattermost-build
Copy link
Contributor

Successfully triggered E2E testing!
GitLab pipeline | Test dashboard

@yasserfaraazkhan
Copy link
Contributor

Hi @neallred ,
I tried running the e2e tests locally, for me these were failing and the Stage or group is not mentioned, I think it will not run in ci too. Please let me know if any flag is needed for these to run.

Screenshot 2023-02-15 at 4 01 43 PM

@neallred
Copy link
Contributor

Thanks for the callout! I'll take a look.

@github-actions
Copy link

github-actions bot commented Feb 16, 2023

Test Results

       1 files     814 suites   14m 22s ⏱️
6 876 tests 6 875 ✔️ 1 💤 0
7 004 runs  7 003 ✔️ 1 💤 0

Results for commit 16df072.

♻️ This comment has been updated with latest results.

@yasserfaraazkhan
Copy link
Contributor

Hi @neallred
I've used cypress to check the cta when 5% and 10 % users threshold. Please let me know if there are other impacted flows we might want to run through.

Screenshot 2023-02-21 at 1 35 28 PM

Screenshot 2023-02-21 at 1 38 21 PM

Screenshot 2023-02-21 at 1 38 39 PM

@marianunez
Copy link
Member

Hi @neallred
I've used cypress to check the cta when 5% and 10 % users threshold. Please let me know if there are other impacted flows we might want to run through.

@yasserfaraazkhan I believe that this PR was fixing a bug in the invite modal where it also shows a CTA if they are over the amount of licensed seats. From the original PR description:

Bug fix where the invite modal now renders conditionally the CTA based on license data. I found this bug during the development of the telemetry ticket.

@yasserfaraazkhan
Copy link
Contributor

Screenshot 2023-02-22 at 4 01 08 PM

Hi Nathan, Maria the CTA appears for admin. The user count is same in global banner, console and invite cta

@neallred neallred merged commit d727121 into master Feb 22, 2023
@neallred neallred deleted the true-up-telemetry-and-bug branch February 22, 2023 14:42
@mattermost-build mattermost-build removed the Setup Cloud Test Server Setup a test server using Mattermost Cloud label Feb 22, 2023
@mm-cloud-bot
Copy link

Test server destroyed

1 similar comment
@mm-cloud-bot
Copy link

Test server destroyed

@neallred neallred added CherryPick/Approved Meant for the quality or patch release tracked in the milestone 4: Reviews Complete All reviewers have approved the pull request and removed CherryPick/Approved Meant for the quality or patch release tracked in the milestone 3: QA Review Requires review by a QA tester labels Feb 22, 2023
@amyblais
Copy link
Member

/cherry-pick cloud

@mattermost-build
Copy link
Contributor

Cherry pick is scheduled.

mattermost-build pushed a commit to mattermost-build/mattermost-webapp that referenced this pull request Feb 22, 2023
…st#12170)

* Added telemetry, test and bug fix for true up notifications
* gov skus should not show true-up UI

---------

Co-authored-by: neallred <neallred@protonmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
(cherry picked from commit d727121)
@mattermost-build mattermost-build added the CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone label Feb 22, 2023
@amyblais amyblais added Changelog/Done Required changelog entry has been written Docs/Needed Requires documentation labels Feb 22, 2023
amyblais pushed a commit that referenced this pull request Feb 22, 2023
…12247)

* Added telemetry, test and bug fix for true up notifications
* gov skus should not show true-up UI

---------

Co-authored-by: neallred <neallred@protonmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
(cherry picked from commit d727121)

Co-authored-by: Said Atrahouch <said.atrahouch@gmail.com>
@justinegeffen
Copy link
Contributor

@neallred, can you confirm whether there are changes to the telemetry actions that should be documented? Thank you!

@neallred
Copy link
Contributor

I don't see any existing telemetry category covering this, so I think changes are needed. I would place it underneath https://docs.mattermost.com/manage/telemetry.html#event-data, under the "Non-personally Identifiable Diagnostic Information, distinguished by end users and System Admins" section, as its own item, maybe something like True Up Diagnostics: requested help from sales with license true up; attempted to download true up packet.

justinegeffen added a commit to mattermost/docs that referenced this pull request Mar 15, 2023
@justinegeffen justinegeffen added Docs/Done Required documentation has been written and removed Docs/Needed Requires documentation labels Mar 15, 2023
justinegeffen added a commit to mattermost/docs that referenced this pull request Mar 15, 2023
amyblais added a commit to mattermost/docs that referenced this pull request Mar 16, 2023
* Update conf.py

* Update bulk-export-data.rst (#6269)

Update for mattermost/mattermost#22145

* Update audit-log.rst (#6268)

* Update audit-log.rst

Updated incorrect badge.

* Update source/comply/audit-log.rst

* Update true-up review documentation. (#6191)

* Update true-up review documentation.

* Change wording, make plural.

* update wording again.

* Add back old true up section, noting the version with the new process, add a section going over the new process for mattermost versions 7.9 or higher.

* Update title formatting

* Update title

* Fix tips.

* Add reporting period image to new section.

* Update self-hosted-subscriptions.rst

* change registered user to active user.

* Update self-hosted-subscriptions.rst

---------

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>
Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update send-messages.rst (#6272)

Docs for mattermost/mattermost-webapp#11069

* Update insights.rst (#6276)

* Update insights.rst

* Update source/welcome/insights.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

---------

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update insights.rst

* Update send-messages.rst (#6277)

* v7.9 Changelog (#6246)

* Update self-managed-changelog.md

* Update open-source-components.rst

* Update important-upgrade-notes.rst

* Update release-lifecycle.rst

* Update version-archive.rst

* Update extended-support-release.rst

* Update prepare-to-upgrade-mattermost.rst

* Update important-upgrade-notes.rst

* Update self-managed-changelog.md

* Update important-upgrade-notes.rst

* Update self-managed-changelog.md

* Apply suggestions from code review

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update important-upgrade-notes.rst

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update important-upgrade-notes.rst

* Update self-managed-changelog.md

* Update software-hardware-requirements.rst

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update source/install/self-managed-changelog.md

Co-authored-by: Winson Wu <93531870+wuwinson@users.noreply.github.com>

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update important-upgrade-notes.rst

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update important-upgrade-notes.rst

* Update self-managed-changelog.md

---------

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>
Co-authored-by: Winson Wu <93531870+wuwinson@users.noreply.github.com>

* Update share-and-collaborate.rst (#6281)

* Create trouble-postgres.rst (#6275)

* Create trouble-postgres.rst

* Update trouble-postgres.rst

* Update trouble-postgres.rst

* Update trouble-postgres.rst

* Update telemetry.rst (#6283)

Update for mattermost/mattermost-webapp#12170

---------

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>
Co-authored-by: Conor Macpherson <116016004+ConorMacpherson@users.noreply.github.com>
Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>
Co-authored-by: Winson Wu <93531870+wuwinson@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Done Required changelog entry has been written CherryPick/Done Successfully cherry-picked to the quality or patch release tracked in the milestone Docs/Done Required documentation has been written release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants