Format files
This commit is contained in:
@@ -32,11 +32,13 @@ def normalize_build(build: Dict) -> Dict:
|
||||
|
||||
for cs in changes:
|
||||
for item in cs.get("items", []):
|
||||
commits.append({
|
||||
"commit": item.get("commitId", "")[:7],
|
||||
"message": item.get("msg", ""),
|
||||
"author": item.get("author", {}).get("fullName", "unknown"),
|
||||
})
|
||||
commits.append(
|
||||
{
|
||||
"commit": item.get("commitId", "")[:7],
|
||||
"message": item.get("msg", ""),
|
||||
"author": item.get("author", {}).get("fullName", "unknown"),
|
||||
}
|
||||
)
|
||||
|
||||
return {
|
||||
"number": build.get("number"),
|
||||
@@ -65,12 +67,13 @@ def fetch_builds(limit: int = 5) -> List[Dict]:
|
||||
"changesets[items[commitId,msg,author[fullName]]]]"
|
||||
)
|
||||
|
||||
resp = requests.get(url, headers = _auth_header(), timeout=5)
|
||||
resp = requests.get(url, headers=_auth_header(), timeout=5)
|
||||
resp.raise_for_status()
|
||||
|
||||
builds = resp.json().get("builds", [])
|
||||
return builds[:limit]
|
||||
|
||||
|
||||
def build_history() -> Dict:
|
||||
"""Return Jenkins build history data."""
|
||||
builds = fetch_builds()
|
||||
|
||||
@@ -54,6 +54,7 @@ def _pick_mains(count: int = ITEMS_PER_SECTION) -> List[str]:
|
||||
random.shuffle(mains)
|
||||
return mains
|
||||
|
||||
|
||||
def _pick_garnish() -> List[str]:
|
||||
garnish_options = MENU_SOURCE["mains"]["garnish"]
|
||||
|
||||
@@ -69,6 +70,7 @@ def _build_alternative() -> Dict:
|
||||
"note": alternative.get("note", ""),
|
||||
}
|
||||
|
||||
|
||||
def build_menu(items_per_section: int = ITEMS_PER_SECTION) -> Dict:
|
||||
today = datetime.now()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user