Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mélanie Chauvel
funkwhale
Commits
fa85f923
Verified
Commit
fa85f923
authored
5 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Add reviewers to the list of contributors
parent
6ffae9f5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/get-contributions-stats.py
+18
-3
18 additions, 3 deletions
scripts/get-contributions-stats.py
with
18 additions
and
3 deletions
scripts/get-contributions-stats.py
+
18
−
3
View file @
fa85f923
import
argparse
import
requests
import
os
GITLAB_URL
=
"
https://dev.funkwhale.audio
"
GITLAB_PROJECT_ID
=
17
...
...
@@ -82,6 +83,14 @@ def get_translations_stats(translations):
return
stats
def
get_group_usernames
(
group
):
url
=
GITLAB_URL
+
"
/api/v4/groups/{}/members
"
.
format
(
group
)
response
=
requests
.
get
(
url
,
headers
=
{
"
PRIVATE-TOKEN
"
:
os
.
environ
[
"
PRIVATE_TOKEN
"
]})
response
.
raise_for_status
()
data
=
response
.
json
()
return
[
r
[
"
name
"
]
for
r
in
data
]
def
main
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
ref_name
"
)
...
...
@@ -90,9 +99,15 @@ def main():
since
=
get_tag_date
(
args
.
last_tag
)
commits
=
get_commits
(
args
.
ref_name
,
since
)
commits_stats
=
get_commit_stats
(
commits
)
groups
=
[(
588
,
"
funkwhale/reviewers-python
"
),
(
589
,
"
funkwhale/reviewers-front
"
)]
reviewers
=
[]
for
id
,
_
in
groups
:
reviewers
+=
get_group_usernames
(
id
)
print
(
"
\n
Reviewers:
\n
"
)
for
reviewer
in
reviewers
:
print
(
reviewer
)
commiter_names
=
commits_stats
[
"
commiters
"
].
keys
()
print
(
"
Commiters:
"
)
print
(
"
\n
Commiters:
\n
"
)
for
commiter
in
sorted
(
commits_stats
[
"
commiters
"
].
keys
(),
key
=
lambda
v
:
v
.
upper
()):
print
(
commiter
)
translations
=
get_translations
(
since
)
...
...
@@ -100,7 +115,7 @@ def main():
translators_ids
=
sorted
(
translations_stats
[
"
translators
"
].
keys
())
# There is no way to query user/author info via weblate API and we need the names…
print
(
"
Execute the following SQL query on the weblate server to get the translators names:
"
"
\n
Execute the following SQL query on the weblate server to get the translators names:
"
)
print
(
"
$ weblate dbshell
"
)
print
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment