Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ike Mulder
Iris
Commits
49142779
Commit
49142779
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
update gitlab-extract to handle the double-CI-build (Coq 8.5 and 8.6)
parent
e6aeb885
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmark/gitlab-extract.py
+23
-16
23 additions, 16 deletions
benchmark/gitlab-extract.py
with
23 additions
and
16 deletions
benchmark/gitlab-extract.py
+
23
−
16
View file @
49142779
...
...
@@ -51,27 +51,34 @@ if project is None:
sys
.
stderr
.
write
(
"
Project not found.
\n
"
)
sys
.
exit
(
1
)
BREAK
=
False
for
commit
in
parse_log
.
parse_git_commits
(
args
.
commits
):
if
BREAK
:
break
print
(
"
Fetching {}...
"
.
format
(
commit
))
commit_data
=
req
(
"
/projects/{}/repository/commits/{}
"
.
format
(
project
[
'
id
'
],
commit
))
if
commit_data
.
status_code
!=
200
:
raise
Exception
(
"
Commit not found?
"
)
builds
=
req
(
"
/projects/{}/repository/commits/{}/builds
"
.
format
(
project
[
'
id
'
],
commit
))
if
builds
.
status_code
!=
200
:
# no build
continue
build
=
first
(
sorted
(
builds
.
json
(),
key
=
lambda
b
:
-
int
(
b
[
'
id
'
])))
if
build
is
None
or
build
[
'
status
'
]
==
'
failed
'
:
# build failed (or missing...??)
continue
if
build
[
'
status
'
]
==
'
running
'
:
# build still running, don't fetch this or any later commit
raise
Exception
(
"
Build not found?
"
)
# iterate over builds by decreasing ID, and look for the artifact
for
build
in
builds
.
json
():
if
build
[
'
status
'
]
in
(
'
created
'
,
'
pending
'
,
'
running
'
):
# build still not yet done, don't fetch this or any later commit
BREAK
=
True
break
if
build
[
'
status
'
]
!=
'
success
'
:
# build failed or cancelled, skip to next
continue
# now fetch the build times
build_times
=
requests
.
get
(
"
{}/builds/{}/artifacts/file/build-time.txt
"
.
format
(
project
[
'
web_url
'
],
build
[
'
id
'
]))
if
build_times
.
status_code
!=
200
:
# no artifact at this build, try another one
continue
# Output in the log file format
log_file
.
write
(
"
# {}
\n
"
.
format
(
commit
))
log_file
.
write
(
build_times
.
text
)
log_file
.
flush
()
# don't fetch another one
break
# now fetch the build times
build_times
=
requests
.
get
(
"
{}/builds/{}/artifacts/file/build-time.txt
"
.
format
(
project
[
'
web_url
'
],
build
[
'
id
'
]))
if
build_times
.
status_code
!=
200
:
raise
Exception
(
"
No artifact at build?
"
)
# Output in the log file format
log_file
.
write
(
"
# {}
\n
"
.
format
(
commit
))
log_file
.
write
(
build_times
.
text
)
log_file
.
flush
()
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