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

Adjust usage attribution to prompt users when attribution is ambiguous #11579

Closed
easyCZ opened this issue Jul 22, 2022 · 4 comments · Fixed by #11777
Closed

Adjust usage attribution to prompt users when attribution is ambiguous #11579

easyCZ opened this issue Jul 22, 2022 · 4 comments · Fixed by #11777
Assignees
Labels
team: webapp Issue belongs to the WebApp team

Comments

@easyCZ
Copy link
Member

easyCZ commented Jul 22, 2022

In order to correctly attribute usage to either user or a team, we need to update our Workspace Instance attribution logic.

An usageAttributionid should always be set on a WorkspaceInstance, irrespective if the installation is SaaS or Self-hosted.

The logic to determine the usageAttributionId is as follows (in order of priority):

  1. The user has made an explicit choice in their user settings and have configured the User.usageAttributionId.
  2. The user is a member of exactly one entity from (user, team 1, team 2) which has billing enabled. If there is exactly such choice, then the attribution is not ambiguous and the one entity is used.
  3. The choice is ambigous. In this case the user must be prompted to set the entity to which to attribute usage for the WorkspaceInstance currently being started. On the server, this should be reported as a typed error and the user should be prompted to specify the usageAttributionId as part of the WorkspaceInstance create request.
@easyCZ easyCZ mentioned this issue Jul 22, 2022
73 tasks
@easyCZ easyCZ changed the title Improve usage attribution Usage attribution Jul 22, 2022
@gtsiolis
Copy link
Contributor

gtsiolis commented Jul 22, 2022

@easyCZ Is this referring to a different problem to solve from #11498?

@easyCZ
Copy link
Member Author

easyCZ commented Jul 22, 2022

@gtsiolis You've found this before I finished writing the description :)

It's related to the same problem. This focuses more on the backend logic but I think we can merge, tho the backend is likely needed a lot sooner than we can realistically do the UI changes.

@geropl geropl added the team: webapp Issue belongs to the WebApp team label Aug 1, 2022
@geropl
Copy link
Member

geropl commented Aug 1, 2022

Note: Also need to update the WebApp docs!

@jankeromnes jankeromnes self-assigned this Aug 1, 2022
@jankeromnes jankeromnes changed the title Usage attribution Adjust usage attribution to prompt users when attribution is ambiguous Aug 1, 2022
@jankeromnes
Copy link
Contributor

On a side note: #11584 started implementing this change (by no longer setting the user attribution override in some cases). #11777 will continue and finish this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: webapp Issue belongs to the WebApp team
Projects
Archived in project
4 participants