opensource-observer / oso

Measuring the impact of open source software
https://opensource.observer
Apache License 2.0
73 stars 16 forks source link

dbt: create `users_by_usergroup` and `artifacts_by_usergroup` directories #1997

Open ccerv1 opened 2 months ago

ccerv1 commented 2 months ago

What is it?

Now that we have artifacts_by_user, we need to create the equivalent of collection, which we will call usergroup. Examples of usergroups include:

For now, these will be hardcoded in a model, but we should consider some kind of YAML-like config so contributors can spin these up more easily.

ccerv1 commented 2 months ago

See also: https://github.com/opensource-observer/oso/issues/1998

ryscheng commented 2 months ago

I think we should largely follow the convention that we have in artifacts_by_project and projects_by_collection.

So basically for artifacts_by_user

select
  artifact_id,
  artifact_source_id,
  artifact_source,
  artifact_namespace,
  artifact_name,
  user_id,
  user_source,
  user_namespace,
  user_name
from {{ ref('int_artifacts_by_user') }}

and users_by_usergroup:

select
  user_id,
  user_source,
  user_namespace,
  user_name,
  usergroup_id,
  usergroup_source,
  usergroup_namespace,
  usergroup_name
from {{ ref('int_users_by_usergroup') }}