forked from suse-edge/Factory
Compare commits
16 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| a138f3dbfa | |||
| f6b632eda6 | |||
| 144486306c | |||
|
cb4af76fa0
|
|||
|
1c10c380e1
|
|||
| e51cca16c3 | |||
| 8db13413e7 | |||
| 1333cc401c | |||
|
25eaabb8d0
|
|||
|
e339e83e5e
|
|||
|
de11400ba4
|
|||
|
01db79b971
|
|||
|
01d21108fc
|
|||
| 5dbf69e7d2 | |||
| 8833455709 | |||
| 5ca554f039 |
@@ -1,3 +1,3 @@
|
||||
PROJECT = "isv:SUSE:Edge:Factory"
|
||||
PROJECT = "isv:SUSE:Edge:3.5"
|
||||
REPOSITORY = "https://src.opensuse.org/suse-edge/Factory"
|
||||
BRANCH = "main"
|
||||
BRANCH = "3.5"
|
||||
|
||||
@@ -6,7 +6,6 @@ import sys
|
||||
|
||||
from collections import Counter
|
||||
|
||||
|
||||
def get_buildstatus(project: str) -> ET.Element:
|
||||
for _ in range(5):
|
||||
try:
|
||||
@@ -18,17 +17,8 @@ def get_buildstatus(project: str) -> ET.Element:
|
||||
continue
|
||||
print("Failed to get buildstatus from OBS")
|
||||
|
||||
|
||||
def do_wait(project: str, commit: str) -> ET.Element:
|
||||
def do_wait(project:str, commit:str) -> ET.Element:
|
||||
last_state = None
|
||||
waiting_states = (
|
||||
"blocked",
|
||||
"scheduled",
|
||||
"dispatching",
|
||||
"building",
|
||||
"signing",
|
||||
"finished",
|
||||
)
|
||||
while True:
|
||||
time.sleep(5)
|
||||
status = get_buildstatus(project)
|
||||
@@ -43,25 +33,17 @@ def do_wait(project: str, commit: str) -> ET.Element:
|
||||
else:
|
||||
last_state = status.get("state")
|
||||
|
||||
scminfo = {e.text for e in status.findall(".//scminfo")}
|
||||
scminfo = { e.text for e in status.findall(".//scminfo") }
|
||||
if len(scminfo) != 1 or scminfo.pop() != commit:
|
||||
print("Waiting for OBS to sync with SCM")
|
||||
continue
|
||||
|
||||
if not all(
|
||||
[
|
||||
e.get("state") == "published" # Only consider if all packages are published
|
||||
and e.get("dirty") is None # Exclude states needing recalculation
|
||||
and e.get("code") not in waiting_states # Exclude transient/waiting states
|
||||
for e in status.findall("./result")
|
||||
] + [ e.get("code") not in waiting_states for e in status.findall("./status") ]
|
||||
):
|
||||
if not all([ e.get('state') == "published" and e.get('dirty') is None for e in status.findall("./result")]):
|
||||
print("Waiting for OBS to finish building")
|
||||
continue
|
||||
|
||||
return status
|
||||
|
||||
|
||||
|
||||
def print_results(status: ET.Element) -> bool:
|
||||
results = {}
|
||||
failed = []
|
||||
@@ -69,15 +51,15 @@ def print_results(status: ET.Element) -> bool:
|
||||
repo = results.get(e.get("repository"), {})
|
||||
repo[e.get("arch")] = e
|
||||
results[e.get("repository")] = repo
|
||||
|
||||
|
||||
for repo in results.keys():
|
||||
print(f"{repo}:")
|
||||
depth = 1
|
||||
depth=1
|
||||
for arch in results[repo].keys():
|
||||
counts = Counter()
|
||||
if repo != "charts":
|
||||
print(f"\t{arch}:")
|
||||
depth = 2
|
||||
depth=2
|
||||
for package in results[repo][arch].findall("./status"):
|
||||
if package.get("code") in ["excluded", "disabled"]:
|
||||
continue
|
||||
@@ -88,9 +70,9 @@ def print_results(status: ET.Element) -> bool:
|
||||
else:
|
||||
failed.append(f"{package.get('package')} ({arch})")
|
||||
counts[package.get("code")] += 1
|
||||
for code, count in counts.items():
|
||||
print("\t" * depth, f"{code}: {count}")
|
||||
|
||||
for (code, count) in counts.items():
|
||||
print("\t"*depth, f"{code}: {count}")
|
||||
|
||||
failed.sort()
|
||||
if failed:
|
||||
print("\nPackages failing: ")
|
||||
@@ -98,7 +80,6 @@ def print_results(status: ET.Element) -> bool:
|
||||
print("\t", fail)
|
||||
return len(failed)
|
||||
|
||||
|
||||
def main():
|
||||
project = os.environ.get("OBS_PROJECT")
|
||||
sha = os.environ.get("GIT_SHA")
|
||||
@@ -106,6 +87,5 @@ def main():
|
||||
status = do_wait(project, sha)
|
||||
sys.exit(print_results(status))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-pyhelm3
|
||||
Version: 0.4.0
|
||||
Release: 1
|
||||
|
||||
Reference in New Issue
Block a user