Skip to content

Commit

Permalink
Improve table on github check page
Browse files Browse the repository at this point in the history
  • Loading branch information
majamassarini committed Oct 11, 2022
1 parent cbd7540 commit a9c0681
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion packit_service/worker/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from ogr.services.pagure import PagureProject

from packit_service.constants import (
DOCS_URL,
MSG_TABLE_HEADER_WITH_DETAILS,
)

Expand Down Expand Up @@ -378,12 +379,19 @@ def _create_table(
) -> str:
table_content = []
if url:
table_content.append(f"| Dashboard | {url} |\n")
type_of_url = ""
if "dashboard.packit.dev" in url or "dashboard.stg.packit.dev":
type_of_url = "Dashboard"
elif DOCS_URL in url:
type_of_url = "Documentation"
table_content.append(f"| {type_of_url} | {url} |\n")
if links_to_external_services is not None:
table_content += [
f"| {name} | {link} |\n"
for name, link in links_to_external_services.items()
]
if table_content:
table_content += "\n"

return (
MSG_TABLE_HEADER_WITH_DETAILS + "".join(table_content)
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,12 @@ def test_status_instead_check(

def test_create_table():
assert create_table_content(
"dashboard-url",
"dashboard.packit.dev-url",
{"Testing Farm": "tf-url", "COPR build": "copr-build-url"},
) == (
"| Name/Job | URL |\n"
"| --- | --- |\n"
"| Dashboard | dashboard-url |\n"
"| Dashboard | dashboard.packit.dev-url |\n"
"| Testing Farm | tf-url |\n"
"| COPR build | copr-build-url |\n"
"| COPR build | copr-build-url |\n\n"
)

0 comments on commit a9c0681

Please sign in to comment.