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 a4dcde7  Use shorter draft routes and release preview terminology
a4dcde7 is described below

commit a4dcde7258c4a19ce09f9fd3d8fd1aba199ecb93
Author: Sean B. Palmer <[email protected]>
AuthorDate: Thu Mar 27 16:36:27 2025 +0200

    Use shorter draft routes and release preview terminology
---
 atr/db/models.py                                   |  2 +-
 atr/routes/{candidate_draft.py => draft.py}        | 36 +++++++++++-----------
 atr/routes/modules.py                              |  2 +-
 atr/server.py                                      |  2 +-
 atr/templates/candidate-vote.html                  |  2 +-
 ...aft-add-project.html => draft-add-project.html} |  2 +-
 .../{candidate-draft-add.html => draft-add.html}   |  0
 ...candidate-draft-check.html => draft-check.html} |  2 +-
 .../{candidate-draft-list.html => draft-list.html} |  8 ++---
 ...ndidate-draft-modify.html => draft-modify.html} |  4 +--
 ...idate-draft-promote.html => draft-promote.html} |  4 +--
 ...candidate-draft-tools.html => draft-tools.html} |  8 ++---
 atr/templates/includes/sidebar.html                |  8 ++---
 atr/util.py                                        |  4 +--
 14 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/atr/db/models.py b/atr/db/models.py
index e386f19..ebf0833 100644
--- a/atr/db/models.py
+++ b/atr/db/models.py
@@ -237,7 +237,7 @@ class ReleasePhase(str, enum.Enum):
 
     # [RELEASE]
     # Step 1: The release files are being put in place
-    RELEASE_DRAFT = "release_draft"
+    RELEASE_PREVIEW = "release_preview"
     # Step 2: The release files are available but not yet announced
     RELEASE_BEFORE_ANNOUNCEMENT = "release_before_announcement"
     # Step 3: The release has been announced
diff --git a/atr/routes/candidate_draft.py b/atr/routes/draft.py
similarity index 95%
rename from atr/routes/candidate_draft.py
rename to atr/routes/draft.py
index fe2d4e3..9abfcfa 100644
--- a/atr/routes/candidate_draft.py
+++ b/atr/routes/draft.py
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-"""candidate_draft.py"""
+"""draft.py"""
 
 from __future__ import annotations
 
@@ -146,7 +146,7 @@ def _path_warnings_errors_metadata(
     return warnings, errors
 
 
[email protected]("/candidate-draft/add")
[email protected]("/draft/add")
 async def add(session: routes.CommitterSession) -> str:
     """Show a page to allow the user to rsync files to candidate drafts."""
     # Do them outside of the template rendering call to ensure order
@@ -155,7 +155,7 @@ async def add(session: routes.CommitterSession) -> str:
     user_candidate_drafts = await session.user_candidate_drafts
 
     return await quart.render_template(
-        "candidate-draft-add.html",
+        "draft-add.html",
         asf_id=session.uid,
         projects=user_projects,
         server_domain=session.host,
@@ -192,7 +192,7 @@ async def _add_one(
             await f.write(chunk)
 
 
[email protected]("/candidate-draft/add/<project_name>/<version_name>", 
methods=["GET", "POST"])
[email protected]("/draft/add/<project_name>/<version_name>", methods=["GET", 
"POST"])
 async def add_project(
     session: routes.CommitterSession, project_name: str, version_name: str
 ) -> response.Response | str:
@@ -224,7 +224,7 @@ async def add_project(
             await quart.flash(f"Error adding file: {e!s}", "error")
 
     return await quart.render_template(
-        "candidate-draft-add-project.html",
+        "draft-add-project.html",
         asf_id=session.uid,
         server_domain=session.host,
         project_name=project_name,
@@ -249,7 +249,7 @@ class DeleteForm(util.QuartFormTyped):
     submit = wtforms.SubmitField("Delete candidate draft")
 
 
[email protected]("/candidate-draft/delete", methods=["POST"])
[email protected]("/draft/delete", methods=["POST"])
 async def delete(session: routes.CommitterSession) -> response.Response:
     """Delete a candidate draft and all its associated files."""
     form = await DeleteForm.create_form(data=await quart.request.form)
@@ -293,7 +293,7 @@ async def delete(session: routes.CommitterSession) -> 
response.Response:
     return await session.redirect(promote, success="Candidate draft deleted 
successfully")
 
 
[email protected]("/candidate-draft/files/<project_name>/<version_name>")
[email protected]("/draft/files/<project_name>/<version_name>")
 async def files(session: routes.CommitterSession, project_name: str, 
version_name: str) -> response.Response | str:
     """Show all the files in the rsync upload directory for a release."""
     # Check that the user has access to the project
@@ -354,7 +354,7 @@ async def files(session: routes.CommitterSession, 
project_name: str, version_nam
         path_tasks[path] = await db.recent_tasks(data, 
f"{project_name}-{version_name}", str(path), path_modified[path])
 
     return await quart.render_template(
-        "candidate-draft-list.html",
+        "draft-list.html",
         asf_id=session.uid,
         project_name=project_name,
         version_name=version_name,
@@ -373,7 +373,7 @@ async def files(session: routes.CommitterSession, 
project_name: str, version_nam
     )
 
 
[email protected]("/candidate-draft/checks/<project_name>/<version_name>/<path:file_path>")
[email protected]("/draft/checks/<project_name>/<version_name>/<path:file_path>")
 async def checks(session: routes.CommitterSession, project_name: str, 
version_name: str, file_path: str) -> str:
     """Show the status of all checks for a specific file."""
     # Check that the user has access to the project
@@ -412,7 +412,7 @@ async def checks(session: routes.CommitterSession, 
project_name: str, version_na
     }
 
     return await quart.render_template(
-        "candidate-draft-check.html",
+        "draft-check.html",
         project_name=project_name,
         version_name=version_name,
         file_path=file_path,
@@ -424,7 +424,7 @@ async def checks(session: routes.CommitterSession, 
project_name: str, version_na
     )
 
 
[email protected]("/candidate-draft/delete-file/<project_name>/<version_name>/<path:file_path>",
 methods=["POST"])
[email protected]("/draft/delete-file/<project_name>/<version_name>/<path:file_path>",
 methods=["POST"])
 async def delete_file(
     session: routes.CommitterSession, project_name: str, version_name: str, 
file_path: str
 ) -> response.Response:
@@ -453,7 +453,7 @@ async def delete_file(
     )
 
 
[email protected]("/candidate-draft/hashgen/<project_name>/<version_name>/<path:file_path>",
 methods=["POST"])
[email protected]("/draft/hashgen/<project_name>/<version_name>/<path:file_path>",
 methods=["POST"])
 async def hashgen(
     session: routes.CommitterSession, project_name: str, version_name: str, 
file_path: str
 ) -> response.Response:
@@ -510,7 +510,7 @@ async def hashgen(
     )
 
 
[email protected]("/candidate-draft/modify")
[email protected]("/draft/modify")
 async def modify(session: routes.CommitterSession) -> str:
     """Allow the user to modify a candidate draft."""
     # Do them outside of the template rendering call to ensure order
@@ -519,7 +519,7 @@ async def modify(session: routes.CommitterSession) -> str:
     user_candidate_drafts = await session.user_candidate_drafts
 
     return await quart.render_template(
-        "candidate-draft-modify.html",
+        "draft-modify.html",
         asf_id=session.uid,
         projects=user_projects,
         server_domain=session.host,
@@ -528,7 +528,7 @@ async def modify(session: routes.CommitterSession) -> str:
     )
 
 
[email protected]("/candidate-draft/promote", methods=["GET", "POST"])
[email protected]("/draft/promote", methods=["GET", "POST"])
 async def promote(session: routes.CommitterSession) -> str | response.Response:
     """Allow the user to promote a candidate draft."""
 
@@ -594,14 +594,14 @@ async def promote(session: routes.CommitterSession) -> 
str | response.Response:
                 return await session.redirect(promote, error=f"Error promoting 
candidate draft: {e!s}")
 
     return await quart.render_template(
-        "candidate-draft-promote.html",
+        "draft-promote.html",
         candidate_drafts=user_candidate_drafts,
         promote_form=promote_form,
         delete_form=delete_form,
     )
 
 
[email protected]("/candidate-draft/tools/<project_name>/<version_name>/<path:file_path>")
[email protected]("/draft/tools/<project_name>/<version_name>/<path:file_path>")
 async def tools(session: routes.CommitterSession, project_name: str, 
version_name: str, file_path: str) -> str:
     """Show the tools for a specific file."""
     # Check that the user has access to the project
@@ -630,7 +630,7 @@ async def tools(session: routes.CommitterSession, 
project_name: str, version_nam
     }
 
     return await quart.render_template(
-        "candidate-draft-tools.html",
+        "draft-tools.html",
         asf_id=session.uid,
         project_name=project_name,
         version_name=version_name,
diff --git a/atr/routes/modules.py b/atr/routes/modules.py
index 2631840..2879f8b 100644
--- a/atr/routes/modules.py
+++ b/atr/routes/modules.py
@@ -17,10 +17,10 @@
 
 # These are imported for their side effects and for access in templates
 import atr.routes.candidate as candidate
-import atr.routes.candidate_draft as candidate_draft
 import atr.routes.committees as committees
 import atr.routes.dev as dev
 import atr.routes.download as download
+import atr.routes.draft as draft
 import atr.routes.keys as keys
 import atr.routes.projects as projects
 import atr.routes.release as release
diff --git a/atr/server.py b/atr/server.py
index 87fb139..f5b6a82 100644
--- a/atr/server.py
+++ b/atr/server.py
@@ -95,7 +95,7 @@ def app_dirs_setup(app_config: type[config.AppConfig]) -> 
None:
     print(f"Working directory changed to: {os.getcwd()}")
     util.get_release_candidate_draft_dir().mkdir(parents=True, exist_ok=True)
     util.get_release_candidate_dir().mkdir(parents=True, exist_ok=True)
-    util.get_release_draft_dir().mkdir(parents=True, exist_ok=True)
+    util.get_release_preview_dir().mkdir(parents=True, exist_ok=True)
     util.get_release_dir().mkdir(parents=True, exist_ok=True)
 
 
diff --git a/atr/templates/candidate-vote.html 
b/atr/templates/candidate-vote.html
index 58e35eb..ae107c2 100644
--- a/atr/templates/candidate-vote.html
+++ b/atr/templates/candidate-vote.html
@@ -52,7 +52,7 @@
               </button>
             </form>
             <a class="btn btn-primary"
-               href="{{ as_url(routes.candidate.vote_project, 
project_name=candidate.project.name, version=candidate.version) }}">Start 
vote</a>
+               href="{{ as_url(routes.candidate.vote_project, 
project_name=candidate.project.name, version=candidate.version) }}">Start 
candidate vote</a>
           </div>
         </div>
       </div>
diff --git a/atr/templates/candidate-draft-add-project.html 
b/atr/templates/draft-add-project.html
similarity index 95%
rename from atr/templates/candidate-draft-add-project.html
rename to atr/templates/draft-add-project.html
index 6842797..76c74d1 100644
--- a/atr/templates/candidate-draft-add-project.html
+++ b/atr/templates/draft-add-project.html
@@ -9,7 +9,7 @@
 {% endblock description %}
 
 {% block content %}
-  <a href="{{ as_url(routes.candidate_draft.add) }}" class="back-link">← Back 
to add draft</a>
+  <a href="{{ as_url(routes.draft.add) }}" class="back-link">← Back to add 
draft</a>
 
   <h1>Add file to {{ project_name }} {{ version_name }}</h1>
   <p class="intro">Use this form to add a single file to this candidate 
draft.</p>
diff --git a/atr/templates/candidate-draft-add.html 
b/atr/templates/draft-add.html
similarity index 100%
rename from atr/templates/candidate-draft-add.html
rename to atr/templates/draft-add.html
diff --git a/atr/templates/candidate-draft-check.html 
b/atr/templates/draft-check.html
similarity index 98%
rename from atr/templates/candidate-draft-check.html
rename to atr/templates/draft-check.html
index 3cc936e..6c37a85 100644
--- a/atr/templates/candidate-draft-check.html
+++ b/atr/templates/draft-check.html
@@ -9,7 +9,7 @@
 {% endblock description %}
 
 {% block content %}
-  <a href="{{ as_url(routes.candidate_draft.files, project_name=project_name, 
version_name=version_name) }}"
+  <a href="{{ as_url(routes.draft.files, project_name=project_name, 
version_name=version_name) }}"
      class="back-link">← Back to Files List</a>
 
   <div class="p-3 mb-4 bg-light border rounded">
diff --git a/atr/templates/candidate-draft-list.html 
b/atr/templates/draft-list.html
similarity index 92%
rename from atr/templates/candidate-draft-list.html
rename to atr/templates/draft-list.html
index 9ac7b3a..2e1181c 100644
--- a/atr/templates/candidate-draft-list.html
+++ b/atr/templates/draft-list.html
@@ -125,10 +125,10 @@
                   <td class="atr-sans">
                     <a href="{{ as_url(routes.download.phase, 
phase='candidate-draft', project=release.project.name, version=release.version, 
path=path) }}"
                        class="btn btn-sm btn-outline-primary fs-6">Download</a>
-                    <a href="{{ as_url(routes.candidate_draft.tools, 
project_name=project_name, version_name=version_name, file_path=path) }}"
+                    <a href="{{ as_url(routes.draft.tools, 
project_name=project_name, version_name=version_name, file_path=path) }}"
                        class="btn btn-sm btn-outline-primary fs-6 small 
ms-2">Tools</a>
                     {% if path in tasks and tasks[path]|length > 0 %}
-                      <a href="{{ as_url(routes.candidate_draft.checks, 
project_name=project_name, version_name=version_name, file_path=path) }}"
+                      <a href="{{ as_url(routes.draft.checks, 
project_name=project_name, version_name=version_name, file_path=path) }}"
                          class="btn btn-sm btn-outline-primary fs-6 small 
ms-2">Check results</a>
                     {% endif %}
                   </td>
@@ -171,7 +171,7 @@
         </details>
       {% else %}
         <div class="alert alert-info">
-          This release does not have any files yet. You can add files using 
rsync from the <a href="{{ as_url(routes.candidate_draft.add) }}">add files</a> 
page.
+          This release does not have any files yet. You can add files using 
rsync from the <a href="{{ as_url(routes.draft.add) }}">add files</a> page.
         </div>
       {% endif %}
     </div>
@@ -183,7 +183,7 @@
     </div>
     <div class="card-body">
       <p>
-        <a href="{{ as_url(routes.candidate_draft.add_project, 
project_name=release.project.name, version_name=release.version) }}">Upload a 
file in the browser</a>, or use the command below to add or modify files in 
this release using rsync:
+        <a href="{{ as_url(routes.draft.add_project, 
project_name=release.project.name, version_name=release.version) }}">Upload a 
file in the browser</a>, or use the command below to add or modify files in 
this release using rsync:
       </p>
     </div>
     <pre class="card-footer bg-light border-1 pt-4 small">
diff --git a/atr/templates/candidate-draft-modify.html 
b/atr/templates/draft-modify.html
similarity index 92%
rename from atr/templates/candidate-draft-modify.html
rename to atr/templates/draft-modify.html
index 85ef6ab..6d1cbd4 100644
--- a/atr/templates/candidate-draft-modify.html
+++ b/atr/templates/draft-modify.html
@@ -33,11 +33,11 @@
             {% endif %}
             <p class="card-text">
               {% if number_of_release_files(release) > 0 %}
-                This candidate draft has <a href="{{ 
as_url(routes.candidate_draft.files, project_name=release.project.name, 
version_name=release.version) }}">{{ number_of_release_files(release) }} 
file(s)</a>.
+                This candidate draft has <a href="{{ 
as_url(routes.draft.files, project_name=release.project.name, 
version_name=release.version) }}">{{ number_of_release_files(release) }} 
file(s)</a>.
               {% else %}
                 This candidate draft doesn't have any files yet.
               {% endif %}
-              <a href="{{ as_url(routes.candidate_draft.add_project, 
project_name=release.project.name, version_name=release.version) }}">Upload a 
file using the browser</a>,
+              <a href="{{ as_url(routes.draft.add_project, 
project_name=release.project.name, version_name=release.version) }}">Upload a 
file using the browser</a>,
               or use the command below to add or modify files in this draft:
             </p>
           </div>
diff --git a/atr/templates/candidate-draft-promote.html 
b/atr/templates/draft-promote.html
similarity index 96%
rename from atr/templates/candidate-draft-promote.html
rename to atr/templates/draft-promote.html
index 4f7ec09..65a9993 100644
--- a/atr/templates/candidate-draft-promote.html
+++ b/atr/templates/draft-promote.html
@@ -51,7 +51,7 @@
                 </div>
                 <div class="card-body">
                   <p class="text-muted mb-3">Promoting will freeze this 
candidate draft into a candidate that can be voted on.</p>
-                  <form method="post" action="{{ 
as_url(routes.candidate_draft.promote) }}">
+                  <form method="post" action="{{ as_url(routes.draft.promote) 
}}">
                     {{ promote_form.hidden_tag() }}
                     <input type="hidden"
                            name="candidate_draft_name"
@@ -83,7 +83,7 @@
                 </div>
                 <div class="card-body">
                   <p class="text-muted mb-3">Warning: This action will 
permanently delete this candidate draft and cannot be undone.</p>
-                  <form method="post" action="{{ 
as_url(routes.candidate_draft.delete) }}">
+                  <form method="post" action="{{ as_url(routes.draft.delete) 
}}">
                     {{ delete_form.hidden_tag() }}
                     <input type="hidden"
                            name="candidate_draft_name"
diff --git a/atr/templates/candidate-draft-tools.html 
b/atr/templates/draft-tools.html
similarity index 77%
rename from atr/templates/candidate-draft-tools.html
rename to atr/templates/draft-tools.html
index 449de9f..41ea9ca 100644
--- a/atr/templates/candidate-draft-tools.html
+++ b/atr/templates/draft-tools.html
@@ -9,7 +9,7 @@
 {% endblock description %}
 
 {% block content %}
-  <a href="{{ as_url(routes.candidate_draft.files, project_name=project_name, 
version_name=version_name) }}"
+  <a href="{{ as_url(routes.draft.files, project_name=project_name, 
version_name=version_name) }}"
      class="back-link">← Back to Files List</a>
 
   <div class="p-3 mb-4 bg-light border rounded">
@@ -35,12 +35,12 @@
   </div>
   <div class="d-flex gap-2 mb-4">
     <form method="post"
-          action="{{ as_url(routes.candidate_draft.generate_hash, 
project_name=project_name, version_name=version_name, file_path=file_path) }}">
+          action="{{ as_url(routes.draft.generate_hash, 
project_name=project_name, version_name=version_name, file_path=file_path) }}">
       <input type="hidden" name="hash_type" value="sha256" />
       <button type="submit" class="btn btn-outline-secondary">Generate 
SHA256</button>
     </form>
     <form method="post"
-          action="{{ as_url(routes.candidate_draft.generate_hash, 
project_name=project_name, version_name=version_name, file_path=file_path) }}">
+          action="{{ as_url(routes.draft.generate_hash, 
project_name=project_name, version_name=version_name, file_path=file_path) }}">
       <input type="hidden" name="hash_type" value="sha512" />
       <button type="submit" class="btn btn-outline-secondary">Generate 
SHA512</button>
     </form>
@@ -49,7 +49,7 @@
   <h3>Delete file</h3>
   <p>This tool deletes the file from the candidate draft.</p>
   <form method="post"
-        action="{{ as_url(routes.candidate_draft.delete_file, 
project_name=project_name, version_name=version_name, file_path=file_path) }}">
+        action="{{ as_url(routes.draft.delete_file, project_name=project_name, 
version_name=version_name, file_path=file_path) }}">
     <button type="submit"
             class="btn btn-danger"
             onclick="return confirm('Are you sure you want to delete this 
file?')">Delete file</button>
diff --git a/atr/templates/includes/sidebar.html 
b/atr/templates/includes/sidebar.html
index 5c09e83..5449ca2 100644
--- a/atr/templates/includes/sidebar.html
+++ b/atr/templates/includes/sidebar.html
@@ -31,21 +31,21 @@
       <h3>Release candidate drafts</h3>
       <ul>
         <li>
-          <a href="{{ as_url(routes.candidate_draft.add) }}">Add draft</a>
+          <a href="{{ as_url(routes.draft.add) }}">Add draft</a>
         </li>
         <li>
-          <a href="{{ as_url(routes.candidate_draft.modify) }}">Modify 
draft</a>
+          <a href="{{ as_url(routes.draft.modify) }}">Modify draft</a>
         </li>
         <!-- TODO: Don't show this if the user doesn't have any release 
candidates? -->
         <li>
-          <a href="{{ as_url(routes.candidate_draft.promote) }}">Promote 
draft</a>
+          <a href="{{ as_url(routes.draft.promote) }}">Promote draft</a>
         </li>
       </ul>
 
       <h3>Release candidates</h3>
       <ul>
         <li>
-          <a href="{{ as_url(routes.candidate.vote) }}">Start vote</a>
+          <a href="{{ as_url(routes.candidate.vote) }}">Start candidate 
vote</a>
         </li>
       </ul>
 
diff --git a/atr/util.py b/atr/util.py
index 84d6b60..8881e0f 100644
--- a/atr/util.py
+++ b/atr/util.py
@@ -127,8 +127,8 @@ def get_release_candidate_dir() -> pathlib.Path:
     return pathlib.Path(config.get().PHASE_STORAGE_DIR) / "release-candidate"
 
 
-def get_release_draft_dir() -> pathlib.Path:
-    return pathlib.Path(config.get().PHASE_STORAGE_DIR) / "release-draft"
+def get_release_preview_dir() -> pathlib.Path:
+    return pathlib.Path(config.get().PHASE_STORAGE_DIR) / "release-preview"
 
 
 def get_release_dir() -> pathlib.Path:


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

Reply via email to