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

[usage] Store workspace, project, type & class #11460

Merged
merged 1 commit into from
Jul 19, 2022

Conversation

easyCZ
Copy link
Member

@easyCZ easyCZ commented Jul 19, 2022

Description

  1. Retrieve OwnerID and ProjectID when querying workspace instances (joined with Workspaces)
  2. Populate fields from the retrieved WorksapceInstancesForUsage into the report
  3. Store these in the DB

Related Issue(s)

Fixes #

How to test

Unit tests

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview

@easyCZ easyCZ force-pushed the mp/usage-store-extra-fields branch from 6e1af8b to 54852da Compare July 19, 2022 10:12
@easyCZ easyCZ marked this pull request as ready for review July 19, 2022 10:12
@easyCZ easyCZ requested a review from a team July 19, 2022 10:12
@easyCZ easyCZ added the team: webapp Issue belongs to the WebApp team label Jul 19, 2022
@roboquat roboquat added size/L and removed size/M labels Jul 19, 2022
CreditsUsed: 470,
InstanceID: instanceId,
AttributionID: teamAttributionID,
UserID: ownerID,
Copy link
Contributor

Choose a reason for hiding this comment

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

What would be the ownerID here for a prebuild and do we expect there to be one?

Copy link
Member Author

Choose a reason for hiding this comment

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

SELECT wsi.id, ws.type, ws.ownerId from d_b_workspace as ws, d_b_workspace_instance as wsi where wsi.workspaceId = ws.id AND ws.type = 'prebuild' LIMIT 100;

https://console.cloud.google.com/bigquery?sq=441577903635:724ea3fda1724aab80bae2f7babc5758

Prebuilds have owners. Sadly they are the user who setup the prebuild but oh well.

Copy link
Contributor

Choose a reason for hiding this comment

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

the user who setup the prebuild

I guess for the billing session this information will be irrelevant, but fine to keep here in case for future purposes.

@laushinka
Copy link
Contributor

LGTM

@roboquat roboquat merged commit 2946bee into main Jul 19, 2022
@roboquat roboquat deleted the mp/usage-store-extra-fields branch July 19, 2022 13:24
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants