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

[RHOAIENG-6867] Tracking of dashboard version and users's capabilities #2878

Closed
wants to merge 1 commit into from

Conversation

pilhuhn
Copy link
Contributor

@pilhuhn pilhuhn commented Jun 5, 2024

Description

This is related to RHOAIENG-6867

  • Add dashboard version to track events / page views
  • On user init record the capabilities of the user

How Has This Been Tested?

Manually be looking at the data that arrived in Segment / by looking at request in the Browsers network tab

Test Impact

No change on functionality of the visible UI

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Commits have been squashed into descriptive, self-contained units of work (e.g. 'WIP' and 'Implements feedback' style messages have been removed)
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress This PR is in WIP state label Jun 5, 2024
Copy link
Contributor

openshift-ci bot commented Jun 5, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

openshift-ci bot commented Jun 5, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mturley for approval. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files:

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

@pilhuhn pilhuhn changed the title [WIP] Tracking of dashboard version and users's capabilities [RHOAIENG-6867] Tracking of dashboard version and users's capabilities Jun 6, 2024
@pilhuhn pilhuhn marked this pull request as ready for review June 6, 2024 09:55
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress This PR is in WIP state label Jun 6, 2024
@openshift-ci openshift-ci bot requested review from mturley and ppadti June 6, 2024 09:56
Copy link

codecov bot commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 31.25000% with 22 lines in your changes missing coverage. Please review.

Project coverage is 78.72%. Comparing base (5f915b0) to head (4a058b1).

Current head 4a058b1 differs from pull request most recent head 7d03138

Please upload reports for the commit 7d03138 to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2878      +/-   ##
==========================================
+ Coverage   78.62%   78.72%   +0.10%     
==========================================
  Files        1120     1105      -15     
  Lines       23757    23519     -238     
  Branches     5979     5942      -37     
==========================================
- Hits        18679    18516     -163     
+ Misses       5078     5003      -75     
Files Coverage Δ
frontend/src/utilities/useSegmentTracking.ts 62.50% <56.25%> (-15.28%) ⬇️
frontend/src/utilities/segmentIOUtils.tsx 14.86% <6.25%> (-1.01%) ⬇️

... and 54 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f915b0...7d03138. Read the comment docs.

@pilhuhn
Copy link
Contributor Author

pilhuhn commented Jun 10, 2024

/retest-required

Copy link
Member

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

I'm noticing some extra stuff here as I'm trying to look at approving your work here -- see my new review questions.

Also -- We'll need to look to get you into our scrum. Your ticket is now moved to the sprint but you're going to need to attend and communicate through our scrum.

Please direct any questions to our UXD Coordinator, @jeff-phillips-18
cc @dgutride

Comment on lines +32 to +37
const updateReviewResource: AccessReviewResourceAttributes = {
group: 'datasciencecluster.opendatahub.io/v1',
resource: 'DataScienceCluster',
verb: 'update',
};
const [allowUpdate, updateLoaded] = useAccessReview(updateReviewResource);
Copy link
Member

Choose a reason for hiding this comment

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

Not sure I understand this request of metadata. What are you aiming at here?

Comment on lines +16 to +30
// TODO this should go to a helper, as it is called from multiple places
const createReviewResource: AccessReviewResourceAttributes = {
group: 'project.openshift.io',
resource: 'projectrequests',
verb: 'create',
};
const [allowCreate, createLoaded] = useAccessReview(createReviewResource);

// TODO this should go to a helper, as it is called from multiple places
const deleteReviewResource: AccessReviewResourceAttributes = {
group: 'project.openshift.io',
resource: 'projectrequests',
verb: 'delete',
};
const [allowDelete, deleteLoaded] = useAccessReview(deleteReviewResource);
Copy link
Member

Choose a reason for hiding this comment

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

This feels like you're asking if they are self provisioners? Why do you care if they can delete? I don't think anyone deletes project requests... they delete the project behind it.

What are you trying to capture here?

Comment on lines +57 to +59
canCreate: allowCreate,
canDelete: allowDelete,
canUpdate: allowUpdate,
Copy link
Member

Choose a reason for hiding this comment

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

These are very vague and you're sending them on init? Shouldn't we just make a "load request" at some point in the future and record user's permissions at startup instead of mixing it into the infra startup of the segment tool?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The analytics.identify() happens within init. And identify() is the place to send user-properties.
We can for sure send that any time later. As this is only needed once and not on every page load, init looks like a good place for me.

Copy link
Member

Choose a reason for hiding this comment

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

Our segment tracking was haphazardly put together and is still in rough shape. The more you add to it the more I want to spend time making sure we are doing the right thing, structured and future looking.

init is init of the infrastructure and should be a cohesive set of "startup and mounting of segment" statements. It shouldn't manage the initial state of the logged in user, that should be done via another hook once things have started up.

I'd like to start seeing proper documentation and setup for these things... maybe even a src/concepts/segment folder where we build out utilities to use it throughout our app.

@pilhuhn
Copy link
Contributor Author

pilhuhn commented Jun 11, 2024

I've broken out the dashboard version part in #2896

@pilhuhn
Copy link
Contributor Author

pilhuhn commented Jun 12, 2024

I am closing this in favor of a better solution going forward.

@pilhuhn pilhuhn closed this Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants