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

[Telemetry] Show opt-in changes for OSS users #50831

Merged
merged 28 commits into from
Nov 18, 2019

Conversation

joelgriffith
Copy link
Contributor

Summary

Fixes #50773.

This ensure that we always show telemetry changes in 7.5, and saves the fact that we've served notice in our index.

Still pending are a tests and some final tweaks, but functionality is there.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

@joelgriffith joelgriffith added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.5.0 v7.6.0 labels Nov 15, 2019
* under the License.
*/

/* eslint @elastic/eui/href-or-on-click:0 */
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 a bit left-handed, but we need to call internals that they've seen this notice when they're navigating via anchor tags.

Copy link
Member

Choose a reason for hiding this comment

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

It's not clear which line this comment setting refers to. Can this be done with an eslint-disable-line ?

const allowChangingOptInStatus = npStart.core.injectedMetadata.getInjectedVar(
'allowChangingOptInStatus'
) as boolean;

telemetryNotifyUserAboutOptInDefault = npStart.core.injectedMetadata.getInjectedVar(
'telemetryNotifyUserAboutOptInDefault'
) as boolean;
Copy link
Member

Choose a reason for hiding this comment

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

I'm not so sure on this naming, usually boolean variables need an is/should prefix for clarity.

Maybe telemetryNotifyUserAboutOptInDefault ?

I think we want to keep the telemetry prefix because of the way the injectedVars are not namespaced by plugin

@joelgriffith joelgriffith requested a review from a team as a code owner November 15, 2019 23:51
} as GetParams);

expect(telemetry.userHasSeenNotice).to.be(true);
});
Copy link
Member

Choose a reason for hiding this comment

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

The only thing I think the test code is missing is a clean-up step to remove the telemetry:telemetry document after the test did its update

Copy link
Member

Choose a reason for hiding this comment

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

Also, I didn't see an easy way to test that this API works with a non-privileged user.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@joelgriffith
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

LGTM for platform changes

@@ -43,6 +43,7 @@ import { SampleDataCard } from './sample_data';
interface Props {
urlBasePath: string;
onSkip: () => void;
optInSeen: () => any;
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: naming. This is an event handler. optInSeen -> onOptInSeen (like onSkip here). Same goes for propagaging from home.js

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@joelgriffith joelgriffith merged commit 97c2bc9 into master Nov 18, 2019
Copy link
Member

@Bamieh Bamieh left a comment

Choose a reason for hiding this comment

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

LGTM

joelgriffith pushed a commit that referenced this pull request Nov 18, 2019
* WIP: Notice banner for OSS folks

* Add telemetryNotifyUserAboutOptInDefault to injected vars

* add userHasSeenNotice check

* More WIP on banner notice component

* Text changes on screens

* make userHasSeenNotice flag work

* Finalzed splash text + checking new flag

* Consolidating banner calls and saving status of opt-in notice

* Conditionally remove the banner and add some code docs

* Fixing prior welcome tests

* api integration test for user has seen opt in

* change post method to put in ui

* unit test for get_telemetry_notify_user_about_optin_default

* Ignore TS woes

* Adding new tests and snapshots for opt-in banner component

* Notice banner test

* Translation miss

* More opt-in tests

* increase types usage

* roll back core server api change

* update snapshot

* Prop name change + snapshot updates
joelgriffith pushed a commit that referenced this pull request Nov 18, 2019
* WIP: Notice banner for OSS folks

* Add telemetryNotifyUserAboutOptInDefault to injected vars

* add userHasSeenNotice check

* More WIP on banner notice component

* Text changes on screens

* make userHasSeenNotice flag work

* Finalzed splash text + checking new flag

* Consolidating banner calls and saving status of opt-in notice

* Conditionally remove the banner and add some code docs

* Fixing prior welcome tests

* api integration test for user has seen opt in

* change post method to put in ui

* unit test for get_telemetry_notify_user_about_optin_default

* Ignore TS woes

* Adding new tests and snapshots for opt-in banner component

* Notice banner test

* Translation miss

* More opt-in tests

* increase types usage

* roll back core server api change

* update snapshot

* Prop name change + snapshot updates
jloleysens added a commit to jloleysens/kibana that referenced this pull request Nov 18, 2019
…-fallback

* 'master' of github.com:elastic/kibana: (116 commits)
  [Maps] move apply global filter settting from layer to source (elastic#50523)
  [SIEM] Fix: Empty `Source` / `Destination` shown when only ports are populated (elastic#50843)
  [Maps] Delay vector tile layer syncing until spritesheet is loaded (elastic#48955)
  [Maps] prevent users from overflowing URL when filtering by shape (elastic#50747)
  [DOCS] Mark Beats central management as discontinued (elastic#49423)
  [page_objects/common_page] convert to ts (elastic#50771)
  [NP Kibana Migrations ] kibana plugin home (elastic#50444)
  [DOCS] Shareables naming convention (elastic#50497)
  [ML] DF Analytics - auto-populate model_memory_limit (elastic#50714)
  Increase alerting test stability and reduce flakiness (elastic#50246)
  [ML] Remaning new_job_new folder (elastic#50917)
  [Telemetry] Show opt-in changes for OSS users (elastic#50831)
  [ML] Fix lat_long anomalies table links menu and value formatting (elastic#50916)
  [Dev] Fix serialising a really big string (elastic#50915)
  Better explanation about the Prettier recommendation (extension vs. NPM module) (elastic#50629)
  [Monitoring] Use a basic monitoring user for tests (elastic#47865)
  [Monitoring] Gracefully handle issue with filebeat indices (elastic#48929)
  [Monitoring] Improve permissions required around setup mode (elastic#50421)
  Additional validation for elasticsearch username (elastic#48247)
  Revert changes to use_kibana_ui_setting (elastic#50877)
  ...

# Conflicts:
#	src/legacy/core_plugins/console/server/request.test.ts
@spalger spalger deleted the chore/oss-telemetry-banner-notice branch December 4, 2019 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v7.5.0 v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ensure OSS builds receive notice of telemetry and link to opt-out
5 participants