This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git
The following commit(s) were added to refs/heads/main by this push:
new e3f2220 Make the missing SSH key check more prominent
e3f2220 is described below
commit e3f222005f5823da6027f8f3ada930b2853d9cae
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Sep 12 15:19:46 2025 +0100
Make the missing SSH key check more prominent
---
atr/db/interaction.py | 2 +-
atr/templates/upload-selected.html | 8 ++++++++
atr/templates/user-ssh-keys.html | 10 +++-------
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/atr/db/interaction.py b/atr/db/interaction.py
index 28a4385..90dd784 100644
--- a/atr/db/interaction.py
+++ b/atr/db/interaction.py
@@ -342,7 +342,7 @@ async def tasks_ongoing_revision(
project_name: str,
version_name: str,
revision_number: str | None = None,
-) -> tuple[int, str]:
+) -> tuple[int, str | None]:
via = sql.validate_instrumented_attribute
subquery = (
sqlalchemy.select(via(sql.Revision.number))
diff --git a/atr/templates/upload-selected.html
b/atr/templates/upload-selected.html
index 99e92ce..7d4ac3a 100644
--- a/atr/templates/upload-selected.html
+++ b/atr/templates/upload-selected.html
@@ -116,6 +116,14 @@
</div>
<h2 id="rsync-upload">Rsync upload</h2>
+ {% set key_count = user_ssh_keys|length %}
+ {% if key_count == 0 %}
+ <div class="alert alert-warning">
+ <p class="mb-0">
+ We have no SSH keys on file for you, so you cannot yet use this
command. Please <a href="{{ as_url(routes.keys.ssh_add) }}">add your SSH
key</a>.
+ </p>
+ </div>
+ {% endif %}
<p>Import files from a remote server using rsync with the following
command:</p>
<!-- TODO: Add a button to copy the command to the clipboard -->
<pre class="bg-light p-3 mb-3">
diff --git a/atr/templates/user-ssh-keys.html b/atr/templates/user-ssh-keys.html
index 7864e89..7fd7c2d 100644
--- a/atr/templates/user-ssh-keys.html
+++ b/atr/templates/user-ssh-keys.html
@@ -1,15 +1,11 @@
+{% set key_count = user_ssh_keys|length %}
<p>
The ATR server should be compatible with long obsolete versions of rsync, as
long as you use the command as shown, but as of May 2025 the only rsync version
line without <a
href="https://github.com/google/security-research/security/advisories/GHSA-p5pg-x43v-mvqj">known
CVEs</a> is 3.4.*. Your package manager may have backports.
</p>
<p>
If you find that you receive errors from ATR when using rsync, please <a
href="https://github.com/apache/tooling-trusted-release/issues/new?template=BLANK_ISSUE">open
an issue</a> and we will try our best to make ATR compatible.
</p>
-{% set key_count = user_ssh_keys|length %}
-{% if key_count == 0 %}
- <p>
- We have no SSH keys on file for you, so you cannot yet use this command.
Please <a href="{{ as_url(routes.keys.ssh_add) }}">add your SSH key</a>.
- </p>
-{% elif key_count == 1 %}
+{% if key_count == 1 %}
{% set key = user_ssh_keys[0] %}
{% set key_parts = key.key.split(' ', 2) %}
{% set key_comment = key_parts[2] if key_parts|length > 2 else 'key' %}
@@ -17,7 +13,7 @@
We have the SSH key <a href="{{ as_url(routes.keys.keys,
_anchor='ssh-key-' + key.fingerprint) }}"
title="{{ key.fingerprint }}"><code>{{- key_comment | trim -}}</code></a>
on file for you. You can also <a href="{{ as_url(routes.keys.ssh_add) }}">add
another SSH key</a>.
</p>
-{% else %}
+{% elif key_count > 1 %}
<p>We have the following SSH keys on file for you:</p>
<ul>
{% for key in user_ssh_keys %}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]