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 5de0e7d  Show filename analysis on rsync paths pages
5de0e7d is described below

commit 5de0e7d4ffb150fc8ca82dadc4a71008918abc20
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Mar 21 15:46:34 2025 +0200

    Show filename analysis on rsync paths pages
---
 atr/routes/files.py           | 23 +++++++++++++++++++++++
 atr/templates/files-list.html |  4 ++++
 2 files changed, 27 insertions(+)

diff --git a/atr/routes/files.py b/atr/routes/files.py
index 2095544..9bd24ab 100644
--- a/atr/routes/files.py
+++ b/atr/routes/files.py
@@ -28,6 +28,7 @@ import asfquart.base as base
 import asfquart.session as session
 import quart
 
+import atr.analysis as analysis
 import atr.config as config
 import atr.db as db
 import atr.db.models as models
@@ -202,6 +203,26 @@ async def root_files_list(session: CommitterSession, 
project_name: str, version_
 
     base_path = os.path.join(_CONFIG.STATE_DIR, "rsync-files", project_name, 
version_name)
     paths = await _paths_recursive_list(base_path)
+    path_templates = {}
+    path_substitutions = {}
+    for path in paths:
+        elements = {
+            "core": project_name,
+            "version": version_name,
+            "sub": None,
+            "template": None,
+            "substitutions": None,
+        }
+        template, substitutions = analysis.filename_parse(path, elements)
+        path_templates[path] = template
+        subs = []
+        for key, values in substitutions.items():
+            if values:
+                subs.append(f"{key.upper()}: {', '.join(values)}")
+        if subs:
+            path_substitutions[path] = ", ".join(subs)
+        else:
+            path_substitutions[path] = "none"
 
     return await quart.render_template(
         "files-list.html",
@@ -211,4 +232,6 @@ async def root_files_list(session: CommitterSession, 
project_name: str, version_
         release=release,
         paths=paths,
         server_domain=session.host,
+        templates=path_templates,
+        substitutions=path_substitutions,
     )
diff --git a/atr/templates/files-list.html b/atr/templates/files-list.html
index e0c512a..ad41ee4 100644
--- a/atr/templates/files-list.html
+++ b/atr/templates/files-list.html
@@ -57,12 +57,16 @@
             <thead>
               <tr>
                 <th>Filename</th>
+                <th>Template</th>
+                <th>Substitutions</th>
               </tr>
             </thead>
             <tbody>
               {% for path in paths %}
                 <tr>
                   <td>{{ path }}</td>
+                  <td>{{ templates[path] }}</td>
+                  <td>{{ substitutions[path] }}</td>
                 </tr>
               {% endfor %}
             </tbody>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to