This is an automated email from the ASF dual-hosted git repository. arm pushed a commit to branch arm in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
commit 0f6650b0c1597125df9887fc8f6ed28e05b26ebb Author: Alastair McFarlane <[email protected]> AuthorDate: Fri Mar 13 09:35:05 2026 +0000 #762 - Move SVN host to the task so it's no longer an input from form handling. --- atr/models/unsafe.py | 1 + atr/post/upload.py | 8 +++----- atr/tasks/svn.py | 6 ++++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/atr/models/unsafe.py b/atr/models/unsafe.py index d76127e7..417f8456 100644 --- a/atr/models/unsafe.py +++ b/atr/models/unsafe.py @@ -32,4 +32,5 @@ class UnsafeStr: return self._value +# The Path type exists so we can give Quart a hint for type conversions Path = NewType("Path", UnsafeStr) diff --git a/atr/post/upload.py b/atr/post/upload.py index 5b82a17b..9e914cdf 100644 --- a/atr/post/upload.py +++ b/atr/post/upload.py @@ -18,7 +18,7 @@ import asyncio import json import pathlib -from typing import Final, Literal +from typing import Literal import aiofiles import aiofiles.os @@ -41,8 +41,6 @@ import atr.storage.types as types import atr.util as util import atr.web as web -_SVN_BASE_URL: Final[str] = "https://dist.apache.org/repos/dist" - @post.typed async def finalise( @@ -236,8 +234,8 @@ async def _add_files( def _construct_svn_url(committee_name: str, area: shared.upload.SvnArea, path: str, *, is_podling: bool) -> str: if is_podling: - return f"{_SVN_BASE_URL}/{area.value}/incubator/{committee_name}/{path}" - return f"{_SVN_BASE_URL}/{area.value}/{committee_name}/{path}" + return f"{area.value}/incubator/{committee_name}/{path}" + return f"{area.value}/{committee_name}/{path}" def _json_error(message: str, status: int) -> web.WerkzeugResponse: diff --git a/atr/tasks/svn.py b/atr/tasks/svn.py index b5b44044..d5c2033e 100644 --- a/atr/tasks/svn.py +++ b/atr/tasks/svn.py @@ -17,7 +17,7 @@ import asyncio import pathlib -from typing import Any +from typing import Any, Final import aiofiles.os import aioshutil @@ -30,6 +30,8 @@ import atr.models.sql as sql import atr.storage as storage import atr.tasks.checks as checks +_SVN_BASE_URL: Final[str] = "https://dist.apache.org/repos/dist" + class SvnImport(schema.Strict): """Arguments for the task to import files from SVN.""" @@ -107,7 +109,7 @@ async def _import_files_core(args: SvnImport) -> str: "-r", args.revision, "--", - args.svn_url, + f"{_SVN_BASE_URL}/{args.svn_url}", str(temp_export_path), ] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
