Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osc-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpcdf
obs
osc-plugins
Merge requests
!4
Added mpcdf_build_status
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Added mpcdf_build_status
mpcdf_build_status
into
master
Overview
2
Commits
2
Pipelines
3
Changes
1
2 open threads
Thread options
Hide all comments
Merged
Added mpcdf_build_status
Tobias Melson
requested to merge
mpcdf_build_status
into
master
Mar 13, 2023
Overview
2
Commits
2
Pipelines
3
Changes
1
2 open threads
Thread options
Hide all comments
Integrated the standalone tool into this project for convenience.
0
0
Merge request reports
Compare
master
version 2
7134f518
Mar 13, 2023
version 1
caad1e6a
Mar 13, 2023
master (base)
and
latest version
latest version
b7ea61a4
2 commits,
Mar 20, 2023
version 2
7134f518
1 commit,
Mar 13, 2023
version 1
caad1e6a
1 commit,
Mar 13, 2023
1 file
+
69
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
mpcdf_build_status.py
0 → 100644
+
69
−
0
View file @ b7ea61a4
Edit in single-file editor
Open in Web IDE
#!/usr/bin/python3
import
os
import
osc
import
osc.conf
import
osc.core
from
xml.etree
import
ElementTree
def
do_mpcdf_build_status
(
self
,
subcmd
,
opts
,
*
args
):
"""
${cmd_name}: List build statuses of a package for all software projects
For a given package or the one from the current directory, iterate over all
projects in
"
software
"
and the user
'
s
"
home
"
project and display the build
statuses of that package. Lines will be skipped if the status is
"
succeeded
"
,
"
excluded
"
, or
"
disabled
"
.
Usage:
osc ${cmd_name} [PACKAGE]
${cmd_option_list}
"""
api_url
=
self
.
get_api_url
()
if
len
(
args
)
==
0
:
if
osc
.
core
.
is_package_dir
(
os
.
curdir
):
project
=
osc
.
core
.
store_read_project
(
os
.
curdir
)
package
=
osc
.
core
.
store_read_package
(
os
.
curdir
)
else
:
raise
osc
.
oscerr
.
WrongArgs
(
"
Specify PACKAGE or run command in an osc package checkout directory
"
)
elif
len
(
args
)
==
1
:
project
=
osc
.
core
.
store_read_project
(
os
.
curdir
)
package
,
=
args
else
:
raise
osc
.
oscerr
.
WrongArgs
(
"
Too many arguments
"
)
url
=
osc
.
core
.
makeurl
(
api_url
,
[
"
source
"
])
entries
=
ElementTree
.
fromstringlist
(
osc
.
core
.
streamfile
(
url
,
osc
.
core
.
http_GET
))
user
=
osc
.
conf
.
get_apiurl_usr
(
api_url
)
for
entry
in
entries
.
findall
(
"
./entry
"
):
project
=
entry
.
get
(
"
name
"
)
if
project
.
startswith
(
"
software:
"
)
or
project
==
"
home:{0}
"
.
format
(
user
):
print
(
project
)
project_url
=
osc
.
core
.
makeurl
(
api_url
,
[
"
build
"
,
project
,
"
_result?view=status&multibuild=1&package={0}
"
.
format
(
package
)])
resultlist
=
ElementTree
.
fromstringlist
(
osc
.
core
.
streamfile
(
project_url
,
osc
.
core
.
http_GET
))
actualPackages
=
set
()
for
result
in
resultlist
.
findall
(
"
./result
"
):
for
status
in
result
.
findall
(
"
./status
"
):
actualPackages
.
add
(
status
.
get
(
"
package
"
))
for
pack
in
actualPackages
:
print
(
"
{0} (https://obs-api.mpcdf.mpg.de/package/show/{1}/{2}):
"
.
format
(
pack
,
project
,
pack
))
cnt
=
0
for
result
in
resultlist
.
findall
(
"
./result
"
):
for
status
in
result
.
findall
(
"
./status
"
):
if
status
.
get
(
"
package
"
)
==
pack
:
if
status
.
get
(
"
code
"
)
not
in
[
"
disabled
"
,
"
excluded
"
,
"
succeeded
"
]:
print
(
"
{0}: {1}
"
.
format
(
result
.
get
(
"
repository
"
),
status
.
get
(
"
code
"
)))
cnt
=
cnt
+
1
if
cnt
==
0
:
print
(
"
all succeeded
"
)
print
()
Loading