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

feat: link to gitlab logs on visualisation page #2690

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions dataworkspace/dataworkspace/apps/applications/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ def visualisation_branch_html_GET(request, gitlab_project, branch_name):
current_branch = matching_branches[0]
latest_commit = current_branch["commit"]
latest_commit_link = f'{gitlab_project["web_url"]}/commit/{latest_commit["id"]}'
latest_build_logs_link = f'{gitlab_project["web_url"]}/-/jobs'
latest_commit_preview_link = (
f'{request.scheme}://{application_template.host_basename}--{latest_commit["short_id"]}'
f".{settings.APPLICATION_ROOT_DOMAIN}/"
Expand Down Expand Up @@ -523,6 +524,7 @@ def visualisation_branch_html_GET(request, gitlab_project, branch_name):
"current_branch": current_branch,
"latest_commit": latest_commit,
"latest_commit_link": latest_commit_link,
"latest_build_logs_link": latest_build_logs_link,
"latest_commit_preview_link": latest_commit_preview_link,
"latest_commit_date": latest_commit_date,
"can_release_latest_commit": can_release_latest_commit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ <h2 class="commit-left govuk-heading-m">Latest commit: {{ latest_commit.short_id
View<span class="govuk-visually-hidden"> latest</span> commit<span class="govuk-visually-hidden">{{ latest_commit.short_id }}</span> in GitLab
</a>
</li>
<li>
<a class="govuk-link govuk-link--no-visited-state" href="{{ latest_build_logs_link }}">
View GitLab build logs
</a>
</li>
<li{% if not can_download_logs %} class="govuk-!-margin-bottom-0"{% endif %}>
<a class="govuk-link govuk-link--no-visited-state" href="{{ latest_commit_preview_link }}">
Preview visualisation<span class="govuk-visually-hidden"> at<span class="govuk-visually-hidden"> latest</span> commit {{ latest_commit.short_id }}</span>
Expand Down