Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add emojis to nixpkgs-review post-result #414

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions nixpkgs_review/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ def print_number(
log("")


def html_pkgs_section(packages: list[Attr], msg: str, what: str = "package") -> str:
def html_pkgs_section(
emoji: str, packages: list[Attr], msg: str, what: str = "package"
) -> str:
if len(packages) == 0:
return ""
plural = "s" if len(packages) > 1 else ""
res = "<details>\n"
res += f" <summary>{len(packages)} {what}{plural} {msg}:</summary>\n <ul>\n"
res += (
f" <summary>{emoji} {len(packages)} {what}{plural} {msg}:</summary>\n <ul>\n"
)
for pkg in packages:
res += f" <li>{pkg.name}"
if len(pkg.aliases) > 0:
Expand Down Expand Up @@ -175,15 +179,18 @@ def markdown(self, pr: int | None) -> str:

msg = f"Result of `{cmd}` run on {self.system} [1](https://github.com/Mic92/nixpkgs-review)\n"

msg += html_pkgs_section(self.broken, "marked as broken and skipped")
msg += html_pkgs_section(
":fast_forward:", self.broken, "marked as broken and skipped"
)
msg += html_pkgs_section(
":fast_forward:",
self.non_existent,
Pandapip1 marked this conversation as resolved.
Show resolved Hide resolved
"present in ofBorgs evaluation, but not found in the checkout",
)
msg += html_pkgs_section(self.blacklisted, "blacklisted")
msg += html_pkgs_section(self.failed, "failed to build")
msg += html_pkgs_section(self.tests, "built", what="test")
msg += html_pkgs_section(self.built, "built")
msg += html_pkgs_section(":fast_forward:", self.blacklisted, "blacklisted")
msg += html_pkgs_section(":x:", self.failed, "failed to build")
msg += html_pkgs_section(":white_check_mark:", self.tests, "built", what="test")
msg += html_pkgs_section(":white_check_mark:", self.built, "built")

return msg

Expand Down