Skip to content

Commit

Permalink
Merge pull request #397 from camptocamp/fix
Browse files Browse the repository at this point in the history
Audit: Better dashboard
  • Loading branch information
sbrunner authored Jun 24, 2024
2 parents a4e04fc + cfcdc2c commit a445233
Show file tree
Hide file tree
Showing 6 changed files with 661 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
18
2 changes: 1 addition & 1 deletion ci/dpkg-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ camptocamp/github-app-geo-project:latest:
ubuntu_24_04/ncurses-base: 6.4+20240113-1ubuntu2
ubuntu_24_04/ncurses-bin: 6.4+20240113-1ubuntu2
ubuntu_24_04/netbase: '6.4'
ubuntu_24_04/nodejs: 20.14.0-1nodesource1
ubuntu_24_04/nodejs: 18.20.3-1nodesource1
ubuntu_24_04/openssl: 3.0.13-0ubuntu3.1
ubuntu_24_04/passwd: 1:4.13+dfsg1-4ubuntu3
ubuntu_24_04/patch: 2.7.6-7build3
Expand Down
8 changes: 5 additions & 3 deletions github_app_geo_project/module/audit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

class _TransversalStatusTool(BaseModel):
title: str
url: str | None = None


class _TransversalStatusRepo(BaseModel):
Expand Down Expand Up @@ -95,7 +94,6 @@ def _process_error(
_TransversalStatusRepo(),
).types[key] = _TransversalStatusTool(
title=f"{key}: {message}" if message else key,
url=output_url,
)
issue_check.set_title(
key, f"{key}: {message} ([Error]({output_url}))" if message else f"{key} ([Error]({output_url}))"
Expand Down Expand Up @@ -210,11 +208,13 @@ async def _process_snyk_dpkg(
message.title = "Output URL"
_LOGGER.debug(message)
if output_url is not None:
short_message.append(f"[See also]({output_url})")
short_message.append(f"[Output]({output_url})")
if body is not None:
body.html += f"\n\n[See output]({output_url})"
body.html += f"\n\n[See logs]({logs_url})"

short_message.append(f"[Logs]({logs_url})")

if context.module_event_data.type == "dpkg":
body = module_utils.HtmlMessage("Update dpkg packages")

Expand Down Expand Up @@ -260,6 +260,8 @@ async def _process_snyk_dpkg(
else:
if pull_request is not None:
issue_check.set_title(key, f"{key} ([Pull request]({pull_request.html_url}))")
short_message.append(f"[Pull request]({pull_request.html_url})")

else:
_LOGGER.debug("No changes to commit")
except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as proc_error:
Expand Down
6 changes: 1 addition & 5 deletions github_app_geo_project/module/audit/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
<h2>${data['repository']}</h2>
%for type_name, type_ in data['data'].types.items():
<!---->
%if type_.url:
<p><a href="${type_.url}">${type_.title}</a></p>
%else:
<p>${type_.title}</p>
%endif
<p>${type_.title | markdown, n}</p>
<!---->
%endfor
<!---->
Expand Down
Loading

0 comments on commit a445233

Please sign in to comment.