From f25bff924f7dac7b5ed8293dc5d1e54fb1f8f074 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 6 Jan 2025 12:54:45 -0500 Subject: [PATCH] feat: improve build failure table in wiki (#1031) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Include a column for the "reason" field of build failures, which hopefully helps point people in the right direction for fixing. After 80 chars, will dump the rest in a `
` tag to avoid table overflow. Also list multiple rows (one per platform) instead of comma-separated strings, which do not work well in minimally-styled github wiki table. Example of new table: ![Screenshot 2025-01-05 at 5 04 54 PM](https://github.com/user-attachments/assets/c93a44c4-7820-4aa6-9783-03bbb68eabb0) --- bioconda_utils/build_failure.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/bioconda_utils/build_failure.py b/bioconda_utils/build_failure.py index e9f722f001..56bacc24a5 100644 --- a/bioconda_utils/build_failure.py +++ b/bioconda_utils/build_failure.py @@ -239,12 +239,20 @@ def get_data(): downloads = utils.get_package_downloads(channel, package_name) recs = list(get_build_failure_records(recipe)) - failures = ", ".join(utils.format_link(rec.path, link_fmt, prefix=link_prefix, label=rec.platform) for rec in recs) - categories = ", ".join(rec.category for rec in recs) - skiplisted = any(rec.skiplist for rec in recs) - prs = utils.format_link(f"https://github.com/bioconda/bioconda-recipes/pulls?q=is%3Apr+is%3Aopen+{package}", link_fmt, label="show") - yield (recipe, downloads, descendants, skiplisted, categories, failures, prs) + limit = 80 # characters in last column to show before putting the rest in "
" + for rec in recs: + failures = utils.format_link(rec.path, link_fmt, prefix=link_prefix, label=rec.platform) + categories = rec.category + reasons = rec.reason - data = pd.DataFrame(get_data(), columns=["recipe", "downloads", "depending", "skiplisted", "category", "build failures", "pull requests"]) + if len(reasons) > limit: + reasons = reasons[:limit] + "..." + "
" + reasons[limit:] + "
" + skiplisted = rec.skiplist + prs = utils.format_link(f"https://github.com/bioconda/bioconda-recipes/pulls?q=is%3Apr+is%3Aopen+{package}", link_fmt, label="show") + recipe = recipe.replace('recipes/', '') + + yield (recipe, downloads, descendants, skiplisted, categories, failures, prs, reasons) + + data = pd.DataFrame(get_data(), columns=["recipe", "downloads", "depending", "skiplisted", "category", "build failures", "pull requests", "reason"]) data.sort_values(by=["depending", "downloads"], ascending=False, inplace=True) return data