Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
Iris
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
122
Issues
122
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Iris
Iris
Commits
1a66d561
Commit
1a66d561
authored
Feb 24, 2016
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
benchmark-extractor: deal correctly with individual commits
parent
12d7f42c
Pipeline
#123
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
benchmark/gitlab-extract.py
benchmark/gitlab-extract.py
+10
-5
No files found.
benchmark/gitlab-extract.py
View file @
1a66d561
...
...
@@ -20,7 +20,7 @@ parser.add_argument("-s", "--server",
dest
=
"server"
,
default
=
"https://gitlab.mpi-sws.org/"
,
help
=
"The GitLab server to contact."
)
parser
.
add_argument
(
"-p"
,
"--project"
,
dest
=
"project"
,
default
=
"FP
/
iris-coq"
,
dest
=
"project"
,
default
=
"FP
/
iris-coq"
,
help
=
"The name of the project on GitLab."
)
parser
.
add_argument
(
"-f"
,
"--file"
,
dest
=
"file"
,
required
=
True
,
...
...
@@ -29,14 +29,19 @@ parser.add_argument("-c", "--commits",
dest
=
"commits"
,
help
=
"The commits to fetch. Default is everything since the most recent entry in the log file."
)
args
=
parser
.
parse_args
()
pp
=
pprint
.
PrettyPrinter
(
indent
=
4
)
log_file
=
sys
.
stdout
if
args
.
file
==
"-"
else
open
(
args
.
file
,
"a"
)
projects
=
req
(
"projects"
)
project
=
first
(
filter
(
lambda
p
:
p
[
'
name
_with_namespace'
]
==
args
.
project
,
projects
.
json
()))
project
=
first
(
filter
(
lambda
p
:
p
[
'
path
_with_namespace'
]
==
args
.
project
,
projects
.
json
()))
commits
=
subprocess
.
check_output
([
"git"
,
"rev-list"
,
args
.
commits
]).
decode
(
"utf-8"
)
if
args
.
commits
.
find
(
'..'
)
>=
0
:
# a range of commits
commits
=
subprocess
.
check_output
([
"git"
,
"rev-list"
,
args
.
commits
]).
decode
(
"utf-8"
)
else
:
# a single commit
commits
=
subprocess
.
check_output
([
"git"
,
"rev-parse"
,
args
.
commits
]).
decode
(
"utf-8"
)
for
commit
in
reversed
(
commits
.
strip
().
split
(
'
\n
'
)):
print
(
"Fetching {}..."
.
format
(
commit
))
builds
=
req
(
"/projects/{}/repository/commits/{}/builds"
.
format
(
project
[
'id'
],
commit
))
if
builds
.
status_code
!=
200
:
continue
...
...
@@ -45,7 +50,7 @@ for commit in reversed(commits.strip().split('\n')):
except
Exception
:
# no build
continue
build_times
=
requests
.
get
(
"{}/
{}/builds/{}/artifacts/file/build-time.txt"
.
format
(
args
.
server
,
args
.
project
.
replace
(
' '
,
''
)
,
build
[
'id'
]))
build_times
=
requests
.
get
(
"{}/
builds/{}/artifacts/file/build-time.txt"
.
format
(
project
[
'web_url'
]
,
build
[
'id'
]))
if
build_times
.
status_code
!=
200
:
continue
# Output in the log file format
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment