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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Martin Giger
funkwhale
Commits
dfef5e38
Verified
Commit
dfef5e38
authored
5 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Added contributions script and contributors to the changelog
parent
e99b7703
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG
+30
-0
30 additions, 0 deletions
CHANGELOG
scripts/get-contributions-stats.py
+114
-0
114 additions, 0 deletions
scripts/get-contributions-stats.py
with
144 additions
and
0 deletions
CHANGELOG
+
30
−
0
View file @
dfef5e38
...
...
@@ -199,6 +199,36 @@ Documentation:
- Document how to use Redis over unix sockets (#770)
Contributors to this release (commiters and translators):
- Ale London
- Alexander
- Ben Finney
- ButterflyOfFire
- Ciarán Ainsworth
- Damien Nicolas
- Daniele Lira Mereb
- Eliot Berriot
- Elza Gelez
- gerry_the_hat
- gordon
- interfect
- jake
- Jee
- jovuit
- Mélanie Chauvel
- nouts
- Pierrick
- Qasim Ali
- Quentí
- Renon
- Rodrigo Leite
- Sylke Vicious
- Thomas Brockmöller
- Tixie
- Vierkantor
- Von
- Zach Halasz
0.18.3 (2019-03-21)
-------------------
...
...
This diff is collapsed.
Click to expand it.
scripts/get-contributions-stats.py
0 → 100644
+
114
−
0
View file @
dfef5e38
import
argparse
import
requests
GITLAB_URL
=
"
https://dev.funkwhale.audio
"
GITLAB_PROJECT_ID
=
17
WEBLATE_URL
=
"
https://translate.funkwhale.audio
"
WEBLATE_COMPONENT_ID
=
"
funkwhale/front
"
def
get_commits
(
ref_name
,
since
):
url
=
GITLAB_URL
+
"
/api/v4/projects/{}/repository/commits
"
.
format
(
GITLAB_PROJECT_ID
)
while
url
:
response
=
requests
.
get
(
url
,
params
=
{
"
since
"
:
since
,
"
ref_name
"
:
ref_name
,
"
per_page
"
:
100
}
)
response
.
raise_for_status
()
yield
from
response
.
json
()
if
"
next
"
in
response
.
links
:
url
=
response
.
links
[
"
next
"
][
"
url
"
]
else
:
url
=
None
def
get_commit_stats
(
commits
):
stats
=
{
"
total
"
:
0
,
"
commiters
"
:
{}}
for
commit
in
commits
:
if
commit
[
"
message
"
].
startswith
(
"
Merge branch
"
):
continue
stats
[
"
total
"
]
+=
1
try
:
stats
[
"
commiters
"
][
commit
[
"
author_name
"
]]
+=
1
except
KeyError
:
stats
[
"
commiters
"
][
commit
[
"
author_name
"
]]
=
1
return
stats
def
get_tag_date
(
ref
):
url
=
GITLAB_URL
+
"
/api/v4/projects/{}/repository/tags/{}
"
.
format
(
GITLAB_PROJECT_ID
,
ref
)
response
=
requests
.
get
(
url
)
response
.
raise_for_status
()
data
=
response
.
json
()
return
data
[
"
commit
"
][
"
committed_date
"
]
def
get_translations
(
since
):
url
=
WEBLATE_URL
+
"
/api/components/{}/changes/
"
.
format
(
WEBLATE_COMPONENT_ID
)
while
url
:
response
=
requests
.
get
(
url
)
response
.
raise_for_status
()
if
"
next
"
in
response
.
json
():
url
=
response
.
json
()[
"
next
"
]
else
:
url
=
None
for
t
in
response
.
json
()[
"
results
"
]:
if
t
[
"
timestamp
"
]
<
since
:
url
=
None
break
yield
t
def
get_translations_stats
(
translations
):
stats
=
{
"
total
"
:
0
,
"
translators
"
:
{}}
for
translation
in
translations
:
if
not
translation
[
"
author
"
]:
continue
print
(
"
translation
"
,
translation
[
"
action_name
"
])
continue
stats
[
"
total
"
]
+=
1
try
:
stats
[
"
translators
"
][
translation
[
"
author
"
]]
+=
1
except
KeyError
:
stats
[
"
translators
"
][
translation
[
"
author
"
]]
=
1
return
stats
def
main
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
ref_name
"
)
parser
.
add_argument
(
"
last_tag
"
)
args
=
parser
.
parse_args
()
since
=
get_tag_date
(
args
.
last_tag
)
commits
=
get_commits
(
args
.
ref_name
,
since
)
commits_stats
=
get_commit_stats
(
commits
)
commiter_names
=
commits_stats
[
"
commiters
"
].
keys
()
print
(
"
Commiters:
"
)
for
commiter
in
sorted
(
commits_stats
[
"
commiters
"
].
keys
(),
key
=
lambda
v
:
v
.
upper
()):
print
(
commiter
)
translations
=
get_translations
(
since
)
translations_stats
=
get_translations_stats
(
translations
)
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:
"
)
print
(
"
$ weblate dbshell
"
)
print
(
"
SELECT full_name FROM weblate_auth_user WHERE id in ({});
"
.
format
(
"
,
"
.
join
([
str
(
i
)
for
i
in
translators_ids
])
)
)
if
__name__
==
"
__main__
"
:
main
()
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