You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by sb...@apache.org on 2025/08/07 15:39:56 UTC
(tooling-trusted-release) branch main updated: Accommodate more distribution routes by moving the module
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 23999f2 Accommodate more distribution routes by moving the module
23999f2 is described below
commit 23999f25e483e17bf06ec5a4ad7ac0f3023a7649
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Thu Aug 7 16:39:38 2025 +0100
Accommodate more distribution routes by moving the module
---
atr/routes/{distribute.py => distribution.py} | 13 ++++++-------
atr/routes/modules.py | 2 +-
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/atr/routes/distribute.py b/atr/routes/distribution.py
similarity index 96%
rename from atr/routes/distribute.py
rename to atr/routes/distribution.py
index 01d0680..aa7e92d 100644
--- a/atr/routes/distribute.py
+++ b/atr/routes/distribution.py
@@ -85,7 +85,7 @@ class DistributeForm(forms.Typed):
package = forms.string("Package", placeholder="E.g. artifactId or package-name")
version = forms.string("Version", placeholder="E.g. 1.2.3, without a leading v")
details = forms.checkbox("Include details", description="Include the details of the distribution in the response")
- submit = forms.submit()
+ submit = forms.submit("Record")
async def validate(self, extra_validators: dict | None = None) -> bool:
if not await super().validate(extra_validators):
@@ -133,15 +133,15 @@ class DistributeData(schema.Lax):
return None if v is None or (isinstance(v, str) and v.strip() == "") else v
-@routes.committer("/distribute/<project>/<version>", methods=["GET"])
-async def distribute(session: routes.CommitterSession, project: str, version: str) -> str:
+@routes.committer("/distribution/record/<project>/<version>", methods=["GET"])
+async def record(session: routes.CommitterSession, project: str, version: str) -> str:
form = await DistributeForm.create_form(data={"package": project, "version": version})
fpv = FormProjectVersion(form=form, project=project, version=version)
return await _distribute_page(fpv)
-@routes.committer("/distribute/<project>/<version>", methods=["POST"])
-async def distribute_post(session: routes.CommitterSession, project: str, version: str) -> str:
+@routes.committer("/distribution/record/<project>/<version>", methods=["POST"])
+async def record_post(session: routes.CommitterSession, project: str, version: str) -> str:
form = await DistributeForm.create_form(data=await quart.request.form)
fpv = FormProjectVersion(form=form, project=project, version=version)
if await form.validate():
@@ -174,11 +174,10 @@ async def _distribute_page(fpv: FormProjectVersion, *, extra_content: htpy.Eleme
htpy.span(".atr-phase-three.atr-phase-label")["FINISH"],
" phase using the form below.",
]
- block.p["Please note that this form is a work in progress and not fully functional."]
block.append(forms.render_columns(fpv.form, action=quart.request.path, descriptions=True))
# Render the page
- return await template.blank("Distribute", content=block.collect())
+ return await template.blank("Record a manual distribution", content=block.collect())
async def _distribute_post_api(
diff --git a/atr/routes/modules.py b/atr/routes/modules.py
index 6ea3056..c0fc7bf 100644
--- a/atr/routes/modules.py
+++ b/atr/routes/modules.py
@@ -20,7 +20,7 @@ import atr.routes.announce as announce
import atr.routes.candidate as candidate
import atr.routes.committees as committees
import atr.routes.compose as compose
-import atr.routes.distribute as distribute
+import atr.routes.distribution as distribution
import atr.routes.download as download
import atr.routes.draft as draft
import atr.routes.file as file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org