Skip to content

Commit

Permalink
add language to repo stats (#1455)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccerv1 authored May 21, 2024
1 parent c24d0f2 commit f0c59fd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ with repo_artifact as (
fork_count,
star_count,
license_spdx_id,
language,
watcher_count,
CAST(id as STRING) as artifact_source_id,
LOWER(owner) as artifact_namespace,
Expand All @@ -18,6 +19,7 @@ repo_snapshot as (
artifact_namespace,
artifact_name,
license_spdx_id,
language,
is_fork,
fork_count,
star_count,
Expand Down Expand Up @@ -51,6 +53,7 @@ select
repo_snapshot.fork_count,
repo_snapshot.star_count,
repo_snapshot.watcher_count,
repo_snapshot.language,
repo_snapshot.license_spdx_id,
repo_stats.first_commit_time,
repo_stats.last_commit_time,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ select
--int_repo_metrics_by_project.last_commit_time,
--int_repo_metrics_by_project.days_with_commits_count,
--int_repo_metrics_by_project.contributors_to_repo_count,
int_repo_metrics_by_project.language,
int_repo_metrics_by_project.license_spdx_id,
case
{# TODO: Review licenses https://spdx.org/licenses/ for OSI Approved #}
Expand All @@ -22,9 +23,11 @@ select
'ISC', '0BSD', 'NCSA', 'Zlib'
) then 'Permissive'
when int_repo_metrics_by_project.license_spdx_id in (
'BSD-4-Clause', 'WTFPL', 'NOASSERTION',
'BSD-4-Clause', 'WTFPL',
'CC0-1.0', 'CC-BY-SA-4.0', 'CC-BY-4.0'
) then 'Restrictive'
when int_repo_metrics_by_project.license_spdx_id = 'NOASSERTION'
then 'Custom'
else 'Unspecified'
end as license_type
from {{ ref('int_repo_metrics_by_project') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ select
repositories.is_fork,
repositories.license_name,
repositories.license_spdx_id,
repositories.language,
repositories._cq_sync_time as `sync_time`
from {{ oso_source('ossd', 'repositories') }} as repositories
where _cq_sync_time = (select * from most_recent_sync)

0 comments on commit f0c59fd

Please sign in to comment.