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

feat: configure Segment plugin to be able to send data to Red Hat (enabled by default) #1028

Merged
merged 24 commits into from
May 20, 2024

Conversation

kadel
Copy link
Member

@kadel kadel commented Feb 28, 2024

Description

This PR adds configuration for the Segment plugin to send data to Red Hat. The plugin is ENABLED by default. If user doesn't want that, the plugin needs to be disabled in the Helm or Operator configuration.

I'm having issues with this plugin when running locally. The Segment plugin fails to load correctly, and it shows a warning in the browser console (https://issues.redhat.com/browse/RHIDP-1451):

Segment.ts:58 Failed to read configuration value at 'app.analytics.segment.writeKey' as it is not visible. See https://backstage.io/docs/conf/defining#visibility for instructions on how to make it visible.

This issue is present only when running locally (yarn start). When running from the image, everything is OK. Because o that I don't consider this a blocker for this PR, it might be issue with local configuration.

TODOs:

Which issue(s) does this PR fix

Related to: https://issues.redhat.com/browse/RHIDP-1311

PR acceptance criteria

Please make sure that the following steps are complete:

  • GitHub Actions are completed and successful
  • Unit Tests are updated and passing
  • E2E Tests are updated and passing
  • Documentation is updated if necessary (requirement for new features)
  • Add a screenshot if the change is UX/UI related

How to test changes / Special notes to the reviewer

Copy link
Contributor

The image is available at: quay.io/janus-idp/backstage-showcase:pr-1028!

@kadel kadel force-pushed the enable-telemetry branch 2 times, most recently from c5f392c to 46fdb5d Compare March 1, 2024 13:03
Copy link
Contributor

github-actions bot commented Mar 1, 2024

The image is available at: quay.io/janus-idp/backstage-showcase:pr-1028!

Copy link

janus-idp bot commented Mar 1, 2024

backstage-showcase Tests on commit 58f3b9d finished successfully.
View test log

Copy link
Member

@nickboldt nickboldt left a comment

Choose a reason for hiding this comment

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

instead of a chore should this be a feat since it changes default behaviour and enables "phone home" delivery of telemetry data?

@@ -229,6 +229,11 @@ ENV CHOKIDAR_USEPOLLING='1' CHOKIDAR_INTERVAL='10000'
# To avoid running scripts when using `npm pack` to install dynamic plugins
ENV NPM_CONFIG_ignore-scripts='true'

# Segment key for production
#TODO
ENV SEGMENT_WRITE_KEY=""
Copy link
Member

Choose a reason for hiding this comment

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

would it make sense to have the dev key enabled by default here SEGMENT_WRITE_KEY=gGVM6sYRK0D0ndVX22BOtS7NRcxPej8t and then switch to the production key ONLY in downstream builds here?

https://gitlab.cee.redhat.com/rhidp/rhdh/-/blob/rhdh-1-rhel-9/build/ci/sync-midstream.sh#L321

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, we can do that.
I assume that you will be doing something like sed 's/SEGMENT_WRITE_KEY=.*$/SEGMENT_WRITE_KEY=<prodkey>/'. It would be nice to have this in place before we merge this PR. Can you please make the necessary changes to sync-midstream.sh script?

Copy link
Member

Choose a reason for hiding this comment

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

Occurs to me the only value in having one public key here and the other public key in gitlab is to obfuscate the prod key, but it's public and plain text in the container sources, so why bother?

On the other hand, if we put the prod key here as default, then we could toggle it off only for some builds downstream (eg. anything built from the main branch)

Copy link
Member

@nickboldt nickboldt Apr 29, 2024

Choose a reason for hiding this comment

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

Copy link
Contributor

github-actions bot commented Mar 1, 2024

The image is available at: quay.io/janus-idp/backstage-showcase:pr-1028!

schultzp2020
schultzp2020 previously approved these changes Mar 1, 2024
Copy link
Member

@schultzp2020 schultzp2020 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@kadel kadel changed the title WIP: chore: enable and configure Segment plugin to start sending data WIP: feat: enable and configure Segment plugin to start sending data Mar 8, 2024
@openshift-ci openshift-ci bot removed the lgtm label Mar 8, 2024
Copy link
Contributor

github-actions bot commented Mar 8, 2024

The image is available at: quay.io/janus-idp/backstage-showcase:pr-1028!

1 similar comment
Copy link
Contributor

github-actions bot commented Mar 8, 2024

The image is available at: quay.io/janus-idp/backstage-showcase:pr-1028!

Copy link
Contributor

github-actions bot commented Mar 8, 2024

The image is available at: quay.io/janus-idp/backstage-showcase:pr-1028!

Copy link
Contributor

github-actions bot commented Mar 9, 2024

The image is available at: quay.io/janus-idp/backstage-showcase:pr-1028!

Copy link
Contributor

The image is available at: quay.io/janus-idp/backstage-showcase:pr-1028!

@kadel
Copy link
Member Author

kadel commented May 17, 2024

/retest

Copy link
Contributor

The image is available at: quay.io/janus-idp/backstage-showcase:pr-1028!

Copy link
Contributor

The image is available at: quay.io/janus-idp/backstage-showcase:pr-1028!

@kadel
Copy link
Member Author

kadel commented May 17, 2024

/retest

Copy link

sonarcloud bot commented May 20, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
2.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

The image is available at: quay.io/janus-idp/backstage-showcase:pr-1028!

@kadel
Copy link
Member Author

kadel commented May 20, 2024

/retest


    "beforeAll" hook timeout of 80000ms exceeded.
      14 |     'https://github.com/janus-qe/custom-catalog-entities/blob/main/timestamp-catalog-info.yaml';
      15 |
    > 16 |   test.beforeAll(async ({ browser }, testInfo) => {
         |        ^
      17 |     page = (await setupBrowser(browser, testInfo)).page;
      18 |
      19 |     common = new Common(page);
        at /tmp/backstage-showcase/e2e-tests/playwright/e2e/catalog-timestamp.spec.ts:16:8
    "beforeAll" hook timeout of 80000ms exceeded.
      14 |     'https://github.com/janus-qe/custom-catalog-entities/blob/main/timestamp-catalog-info.yaml';
      15 |
    > 16 |   test.beforeAll(async ({ browser }, testInfo) => {
         |        ^
      17 |     page = (await setupBrowser(browser, testInfo)).page;
      18 |
      19 |     common = new Common(page);
        at /tmp/backstage-showcase/e2e-tests/playwright/e2e/catalog-timestamp.spec.ts:16:8
    Error: expect(locator).toBeHidden()
    Locator: locator('#app_totp')
    Expected: hidden
    Received: visible
    Call log:
      - expect.toBeHidden with timeout 120000ms
      - waiting for locator('#app_totp')
      -   locator resolved to <input value="" type="text" id="app_totp" name="app_otp…/>
      -   unexpected value "visible"

@kadel
Copy link
Member Author

kadel commented May 20, 2024

/lgtm

Copy link

openshift-ci bot commented May 20, 2024

@kadel: you cannot LGTM your own PR.

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@invincibleJai
Copy link
Member

/lgtm

Copy link

openshift-ci bot commented May 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: invincibleJai, kadel, schultzp2020

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [invincibleJai,kadel,schultzp2020]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 6a64308 into janus-idp:main May 20, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants