From 735cbf8018be82cd956ba707a79690864bc2a5a4 Mon Sep 17 00:00:00 2001 From: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Date: Sun, 12 May 2024 10:29:56 +0100 Subject: [PATCH 1/4] ci: remove telemetry for ci runs (#160) --- .github/workflows/install.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/install.yml b/.github/workflows/install.yml index d747e2bd..99855cee 100644 --- a/.github/workflows/install.yml +++ b/.github/workflows/install.yml @@ -23,7 +23,7 @@ jobs: - name: Install Pop run: | . "$HOME/.cargo/env" - cargo install --locked --path ./crates/pop-cli + cargo install --locked --no-default-features --features contract,parachain --path ./crates/pop-cli - name: Run Pop install run: | . "$HOME/.cargo/env" @@ -40,7 +40,7 @@ jobs: - name: Install Pop run: | . "$HOME/.cargo/env" - cargo install --locked --path ./crates/pop-cli + cargo install --locked --no-default-features --features contract,parachain --path ./crates/pop-cli - name: Run Pop Install run: | . "$HOME/.cargo/env" @@ -56,7 +56,7 @@ jobs: - name: Install Pop run: | . "$HOME/.cargo/env" - cargo install --locked --path ./crates/pop-cli + cargo install --locked --no-default-features --features contract,parachain --path ./crates/pop-cli - name: Run Pop Install run: | . "$HOME/.cargo/env" @@ -73,7 +73,7 @@ jobs: - name: Install Pop run: | . "$HOME/.cargo/env" - cargo install --locked --path ./crates/pop-cli + cargo install --locked --no-default-features --features contract,parachain --path ./crates/pop-cli - name: Run Pop install run: | . "$HOME/.cargo/env" @@ -90,7 +90,7 @@ jobs: - name: Install Pop run: | . "$HOME/.cargo/env" - cargo install --locked --path ./crates/pop-cli + cargo install --locked --no-default-features --features contract,parachain --path ./crates/pop-cli - name: Run Pop install run: | . "$HOME/.cargo/env" From 45ad437a4405708531e16fc33adcbdfb0afa06f0 Mon Sep 17 00:00:00 2001 From: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Date: Sun, 12 May 2024 11:54:21 +0100 Subject: [PATCH 2/4] docs: update docs link (#159) --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b64a5158..9fcebdc3 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,11 @@ You can install Pop CLI as follows: ```shell cargo install --locked --git https://github.com/r0gue-io/pop-cli ``` -> For detailed instructions on how to install Pop CLI, please refer to our documentation: https://learn.onpop.io/pop/v/pop-cli/welcome/installing-pop-cli -> :information_source: A [crates.io](https://crates.io/crates/pop-cli) version will be available soon! + +> :information_source: For detailed instructions on how to install Pop CLI, please refer to our +> documentation: https://learn.onpop.io/v/cli/welcome/installing-pop-cli +> +> A [crates.io](https://crates.io/crates/pop-cli) version will be available soon! ## Getting Started @@ -33,6 +36,7 @@ pop new parachain my-app ``` `pop-cli` supports diverse project templates, to use a specific one use the flag `--template`: + ```sh # Create an assets parachain pop new parachain my-app pop -t assets From 0ac5411814f595338f8fa6f5dcaaea6054869dbe Mon Sep 17 00:00:00 2001 From: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Date: Sun, 12 May 2024 21:51:51 +0100 Subject: [PATCH 3/4] ci: add code coverage (#158) * ci: add code coverage * chore: add codecov.yml --- .github/workflows/{build.yml => ci.yml} | 27 +++++++++++++++++++++++-- codecov.yml | 14 +++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) rename .github/workflows/{build.yml => ci.yml} (71%) create mode 100644 codecov.yml diff --git a/.github/workflows/build.yml b/.github/workflows/ci.yml similarity index 71% rename from .github/workflows/build.yml rename to .github/workflows/ci.yml index c6d53a6d..93b03b7d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Build & Test Pop-CLI +name: ci on: push: @@ -49,8 +49,31 @@ jobs: git-user: ${{ env.GITHUB_ACTOR }} - name: Run unit tests - run: cargo test --lib + run: cargo test --lib --bins + coverage: + needs: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: "./.github/actions/init" + with: + git-user: ${{ env.GITHUB_ACTOR }} + + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + + - name: Generate code coverage + run: cargo llvm-cov --all-features --workspace --lib --bins --codecov --output-path codecov.json + + - name: Upload to codecov.io + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: codecov.json + fail_ci_if_error: true + contract-integration-tests: needs: lint runs-on: ubuntu-latest diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..c2d6709a --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +# https://docs.codecov.com/docs/common-recipe-list +coverage: + status: + project: + default: + target: auto + threshold: 0% +comment: + layout: " diff, flags, files" + behavior: default + require_changes: false + require_base: false + require_head: true + hide_project_coverage: false From 85353aee086912ab2eb756d9fb9baf24563ea148 Mon Sep 17 00:00:00 2001 From: Peter White <23270067+peterwht@users.noreply.github.com> Date: Sun, 12 May 2024 15:12:00 -0600 Subject: [PATCH 4/4] docs(telemetry): readme explaining what and why we collect (#157) * feat(telemetry): add telemetry for CLI metrics * feat(telemetry): opt-in handler, better error handling and telemetry usage * feat(telemetry): add reporting for errors * refactor(telemetry): reduce duplicated code, add comments, and general refactoring -- incomplete checkpoint * refactor(telemetry): refactor new parachain, and telemetry handling * fix(telemetry): fix error telemetry reporting * test(telemetry): unit tests for telemetry * fix(telemetry): borrowing issue with multi-threads * refactor(telemetry): handle tel_data better * feat(telemetry): add no_telemetry feature flag to disable telemetry * chore: use edition.workspace in toml files * chore: miscallaneous cleanups, documentation, and refactoring * refactor(telemetry): change opt-in to opt-out * chore: cleanup whitespace and comments * refactor: improve feature (#145) * test: ensure errors propagated (#143) * test: relocate integration tests (#144) * test: relocate integration tests * ci: reduce run time * refactor: remove unused import * refactor: improve feature isolation * refactor: remove unnecessary path prefixes * refactor: invert feature Using `--features=no_telemetry` still resulted in inclusion of pop-telemetry in the dependency tree. Using `telemetry` also makes conditional compilation much simpler. * chore(telemetry): update endpoint and website-id * refactor(telemetry): default values in `Telemetry::new` with helper `init` * chore(telemetry): resolve regressions * docs(telemetry): add telemetry docs explaining what we collect and why. * docs(telemetry): add license and small adjustment to readme * docs(telemetry): small adjustments to READMEs --------- Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com> Co-authored-by: Bruno Galvao Co-authored-by: AlexD10S --- README.md | 7 ++++ crates/pop-telemetry/README.md | 72 +++++++++++++++++++++++++++++++++ crates/pop-telemetry/src/lib.rs | 1 + 3 files changed, 80 insertions(+) create mode 100644 crates/pop-telemetry/README.md diff --git a/README.md b/README.md index 9fcebdc3..2c6f5f9c 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,13 @@ cargo install --locked --git https://github.com/r0gue-io/pop-cli > > A [crates.io](https://crates.io/crates/pop-cli) version will be available soon! +### Telemetry + +Pop CLI collects anonymous usage metrics to help us understand how the tool is being used and how we can improve it. +We do not collect any personal information. If you wish to disable telemetry +or read more about our telemetry practices please see +our [telemetry](crates/pop-telemetry/README.md) documentation. + ## Getting Started ### Parachains diff --git a/crates/pop-telemetry/README.md b/crates/pop-telemetry/README.md new file mode 100644 index 00000000..e8500e3f --- /dev/null +++ b/crates/pop-telemetry/README.md @@ -0,0 +1,72 @@ +# Telemetry + +Anonymous Usage Metrics Collection with Umami + +## Umami + +Umami is an analytics platform that is privacy-focused and open-source. It is a great alternative to Google Analytics. +We self-host Umami in the EU to safeguard all anonymous data. + +You can read more about Umami [here](https://umami.is/). + +## Why Collect Anonymous Usage Metrics? + +We understand the importance of privacy and are committed to safeguarding the data of our users. Collecting +anonymous usage metrics can provide invaluable insights into how our CLI tool is being utilized, allowing us to improve +its performance, reliability, and user experience. Here's why we collect anonymous usage metrics: + +1. **Improving User Experience**: By understanding how our CLI tool is used in real-world scenarios, we can identify + areas for improvement and prioritize features that will enhance the overall user experience. + +2. **Bug Identification and Resolution**: Anonymous usage metrics help us identify and prioritize bugs and issues that + may not be immediately apparent. This allows us to provide quicker resolutions and ensure a smoother user experience. + +3. **Feature Prioritization**: Knowing which features are used most frequently helps us prioritize development efforts + and allocate resources effectively to meet the needs of our users. + +## What We Collect + +We do **not** collect **any** personal information. We do not collect file names, GitHub repositories, or anything +that is potentially sensitive. We do not even try to collect and sanitize this data, we simply do not collect it. +Here is what we do collect, anonymously: + +1. **Command Usage**: We collect information about the commands that are executed using our CLI tool. This includes + the type of command and options used. For example, we may report that `pop new parachain` was executed with the Pop + Standard template. +2. **CLI Usage**: We collect information about how often the CLI tool is used. + +## Our Commitment to Privacy + +We take privacy seriously and are committed to protecting the anonymity of our users. Here's how we ensure your privacy: + +- **Anonymous Data Collection**: We only collect anonymized usage metrics, which do not contain any personally + identifiable information. + +- **Transparency**: We are transparent about the data we collect and how it is used. Some portions of the data will be + made public, + such as the number of times a command was executed, and total number of users. + +- **Privacy-First Platform**: We use Umami, a privacy-focused and open-source analytics platform, to collect anonymous + usage metrics. + +- **EU and GDPR Compliance**: We self-host Umami in the EU to ensure compliance with the General Data Protection + Regulation (GDPR) and safeguard the data of our users. This ensures there is no 3rd party involved in the data. + +## How to Opt-Out + +If you prefer not to participate in anonymous usage metrics collection, you can completely disable telemetry by +installing Pop CLI with it disabled. + +```bash +cargo install --locked --no-default-features --features contract,parachain --git "https://github.com/r0gue-io/pop-cli" +``` + +## Questions or Concerns? + +If you have any questions or concerns regarding our telemetry practices, please don't +hesitate to contact us: + +- Contact form: [r0gue.io/contact](https://r0gue.io/contact) +- Telegram: [@Pop_Network](https://t.me/Pop_Network) + +Thank you for your support and understanding. diff --git a/crates/pop-telemetry/src/lib.rs b/crates/pop-telemetry/src/lib.rs index d24458dc..aa86d342 100644 --- a/crates/pop-telemetry/src/lib.rs +++ b/crates/pop-telemetry/src/lib.rs @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-3.0 use reqwest::Client; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use serde_json::{json, Value};