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 e798ef7  Remove dev routes
e798ef7 is described below

commit e798ef7dd9ec5526788112e620148f217ec5fbfc
Author: Sean B. Palmer <[email protected]>
AuthorDate: Tue Apr 1 15:34:43 2025 +0100

    Remove dev routes
---
 atr/routes/dev.py                 | 78 ----------------------------------
 atr/routes/modules.py             |  1 -
 atr/templates/dev-send-email.html | 89 ---------------------------------------
 3 files changed, 168 deletions(-)

diff --git a/atr/routes/dev.py b/atr/routes/dev.py
deleted file mode 100644
index 423266f..0000000
--- a/atr/routes/dev.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-import asfquart as asfquart
-import quart
-
-import atr.db as db
-import atr.db.models as models
-import atr.routes as routes
-
-if asfquart.APP is ...:
-    raise RuntimeError("APP is not set")
-
-
[email protected]("/dev/send-email", methods=["GET", "POST"])
-async def send_email(session: routes.CommitterSession) -> 
quart.ResponseReturnValue:
-    """Simple endpoint for testing email functionality."""
-    asf_id = session.uid
-
-    if quart.request.method == "POST":
-        form = await routes.get_form(quart.request)
-
-        email = form.get("email_recipient", "")
-        name = form.get("artifact_name", "")
-        token = form.get("token", "")
-
-        if not email:
-            return await quart.render_template(
-                "dev-send-email.html",
-                asf_id=asf_id,
-                error="Email recipient is required",
-            )
-
-        if not name:
-            return await quart.render_template(
-                "dev-send-email.html",
-                asf_id=asf_id,
-                error="Artifact name is required",
-            )
-
-        # Create a task for mail testing
-        async with db.session() as data:
-            async with data.begin():
-                task = models.Task(
-                    status=models.TaskStatus.QUEUED,
-                    task_type="mailtest_send",
-                    task_args=[name, email, token],
-                )
-                data.add(task)
-                # Flush to get the task ID
-                await data.flush()
-
-        return await quart.render_template(
-            "dev-send-email.html",
-            asf_id=asf_id,
-            success=True,
-            message=f"Email task queued with ID {task.id}. It will be 
processed by a worker.",
-            email_recipient=email,
-            artifact_name=name,
-            token=token,
-        )
-
-    return await quart.render_template("dev-send-email.html", asf_id=asf_id)
diff --git a/atr/routes/modules.py b/atr/routes/modules.py
index 109814c..fd8d6ab 100644
--- a/atr/routes/modules.py
+++ b/atr/routes/modules.py
@@ -18,7 +18,6 @@
 # These are imported for their side effects and for access in templates
 import atr.routes.candidate as candidate
 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
diff --git a/atr/templates/dev-send-email.html 
b/atr/templates/dev-send-email.html
deleted file mode 100644
index 1799724..0000000
--- a/atr/templates/dev-send-email.html
+++ /dev/null
@@ -1,89 +0,0 @@
-{% extends "layouts/base.html" %}
-
-{% block title %}
-  Email testing ~ ATR
-{% endblock title %}
-
-{% block description %}
-  Test email sending functionality.
-{% endblock description %}
-
-{% block content %}
-  <h1>Test email sending</h1>
-  <p>
-    Welcome, <strong>{{ asf_id }}</strong>! Use this form to test the email 
sending functionality.
-  </p>
-
-  {% if error %}
-    <div class="alert alert-danger">
-      <p class="mb-0">
-        <strong>Error:</strong> {{ error }}
-      </p>
-    </div>
-  {% endif %}
-
-  {% if success %}
-    <div class="alert alert-success">
-      <p class="mb-0">
-        <strong>Success!</strong>
-        {% if message %}
-          {{ message }}
-        {% else %}
-          Email was sent successfully.
-        {% endif %}
-      </p>
-    </div>
-  {% endif %}
-
-  <form method="post" class="striking py-4 px-5">
-    <div class="mb-3 pb-3 row border-bottom">
-      <label for="email_recipient" class="col-sm-3 col-form-label 
text-sm-end">Recipient email:</label>
-      <div class="col-sm-8">
-        <input type="email"
-               id="email_recipient"
-               name="email_recipient"
-               class="form-control"
-               required
-               value="{{ email_recipient or '' }}"
-               placeholder="[email protected]"
-               aria-describedby="email-help" />
-        <code id="email-help" class="form-text text-muted d-block mt-2">Enter 
the email address to send the test email to</code>
-      </div>
-    </div>
-
-    <div class="mb-3 pb-3 row border-bottom">
-      <label for="artifact_name" class="col-sm-3 col-form-label 
text-sm-end">Artifact name:</label>
-      <div class="col-sm-8">
-        <input type="text"
-               id="artifact_name"
-               name="artifact_name"
-               class="form-control"
-               required
-               value="{{ artifact_name or '' }}"
-               placeholder="my-artifact-1.0.0"
-               aria-describedby="artifact-help" />
-        <code id="artifact-help" class="form-text text-muted d-block 
mt-2">Enter a name for the artifact</code>
-      </div>
-    </div>
-
-    <div class="mb-3 pb-3 row border-bottom">
-      <label for="token" class="col-sm-3 col-form-label text-sm-end">Token 
(optional):</label>
-      <div class="col-sm-8">
-        <input type="text"
-               id="token"
-               name="token"
-               class="form-control"
-               value="{{ token or '' }}"
-               placeholder="Optional token"
-               aria-describedby="token-help" />
-        <code id="token-help" class="form-text text-muted d-block 
mt-2">Optional token to include in the email</code>
-      </div>
-    </div>
-
-    <div class="row">
-      <div class="col-sm-9 offset-sm-3">
-        <button type="submit" class="btn btn-primary mt-2">Send test 
email</button>
-      </div>
-    </div>
-  </form>
-{% endblock content %}


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

Reply via email to