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 2026/07/22 14:17:43 UTC
(tooling-trusted-releases) branch sbp updated: Remove all remaining stale references to the downloads directory
This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch sbp
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/sbp by this push:
new 3f04183a Remove all remaining stale references to the downloads directory
3f04183a is described below
commit 3f04183a0e3defd8e4fb093c439cdf37c7ddc44b
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Wed Jul 22 15:17:08 2026 +0100
Remove all remaining stale references to the downloads directory
---
atr/config.py | 2 --
atr/docs/resource-management.md | 2 +-
atr/models/args.py | 2 +-
atr/paths.py | 13 +------------
atr/server.py | 2 +-
atr/shared/voting.py | 2 +-
atr/templates/includes/topnav.html | 2 +-
tests/unit/test_paths.py | 14 --------------
8 files changed, 6 insertions(+), 33 deletions(-)
diff --git a/atr/config.py b/atr/config.py
index 6a6ba8b9..5cbfb312 100644
--- a/atr/config.py
+++ b/atr/config.py
@@ -113,7 +113,6 @@ class AppConfig:
# ASFQuart generates it using secrets.token_hex()
SECRET_KEY = _config_secrets("SECRET_KEY", STATE_DIR, default=None, cast=str)
JWT_SECRET_KEY = _config_secrets("JWT_SECRET_KEY", STATE_DIR, default=None, cast=str)
- DOWNLOADS_STORAGE_DIR = os.path.join(STATE_DIR, "downloads")
FINISHED_STORAGE_DIR = os.path.join(STATE_DIR, "finished")
UNFINISHED_STORAGE_DIR = os.path.join(STATE_DIR, "unfinished")
# TODO: By convention this is at /x1/, but we can symlink it here perhaps?
@@ -258,7 +257,6 @@ def validate() -> None:
absolute_paths = [
(conf.PROJECT_ROOT, "PROJECT_ROOT"),
(conf.STATE_DIR, "STATE_DIR"),
- (conf.DOWNLOADS_STORAGE_DIR, "DOWNLOADS_STORAGE_DIR"),
(conf.FINISHED_STORAGE_DIR, "FINISHED_STORAGE_DIR"),
(conf.UNFINISHED_STORAGE_DIR, "UNFINISHED_STORAGE_DIR"),
(conf.SVN_STORAGE_DIR, "SVN_STORAGE_DIR"),
diff --git a/atr/docs/resource-management.md b/atr/docs/resource-management.md
index 8ea4c2e8..24baadce 100644
--- a/atr/docs/resource-management.md
+++ b/atr/docs/resource-management.md
@@ -41,7 +41,7 @@ Signature and hash checks read whole artifacts; KEYS import parses keys, consult
## Requests and responses
-Uploads (512 MB max, 3600s to receive on the two upload routes, 60s elsewhere) build a revision before answering unless newly detected archives require quarantine; then revision creation is deferred to a worker pending validation. They perform a hard link clone, validation, hash every file, and compare inodes. API uploads base64 decode entire payloads in memory first. Moves, deletions, hash generation, and SBOM draft actions also build revisions in requests. ZIP downloads list every file [...]
+Uploads (512 MB max, 3600s to receive on the two upload routes, 60s elsewhere) build a revision before answering unless newly detected archives require quarantine; then revision creation is deferred to a worker pending validation. They perform a hard link clone, validation, hash every file, and compare inodes. API uploads base64 decode entire payloads in memory first. Moves, deletions, hash generation, and SBOM draft actions also build revisions in requests. ZIP downloads list every file [...]
Other heavy work is queued and pages poll. Recording a distribution means checking an external registry, which may not list the package yet. When that happens, the standard API endpoint returns an error and gives up, while the workflow endpoint stores the distribution as pending, reports success to the caller, and leaves a scheduled task to retry the check later. Slow bodies get a logged 408. After a handler returns, transmission has 60s before the connection closes. Handlers are unbound [...]
diff --git a/atr/models/args.py b/atr/models/args.py
index c46de6fd..98d29da9 100644
--- a/atr/models/args.py
+++ b/atr/models/args.py
@@ -209,7 +209,7 @@ class SvnPublish(schema.Strict):
revision_number: safe.RevisionNumber = schema.description("Preview revision number to publish")
download_path_suffix: safe.OptionalRelPath = pydantic.Field(
default=None,
- description="Optional path suffix appended under the committee downloads directory",
+ description="Optional path suffix appended under the committee distribution path",
)
diff --git a/atr/paths.py b/atr/paths.py
index 7a0a146c..524cabd7 100644
--- a/atr/paths.py
+++ b/atr/paths.py
@@ -45,7 +45,7 @@ def closer_download_url(relpath: safe.RelPath) -> str:
def committee_dist_relpath(
committee: sql.Committee, suffix: safe.RelPath | None = None, filename: str | None = None
) -> safe.RelPath:
- # The committee's path relative to the downloads root, ie the shared prefix that
+ # The committee's path relative to the distribution root, ie the shared prefix that
# the download hosts and the distribution SVN area both hang a release off.
# Optionally extended with the per-release download suffix and a file name.
prefix = "incubator/" if committee.is_podling else ""
@@ -57,13 +57,6 @@ def committee_dist_relpath(
return relpath
-def committee_downloads_dir(committee: sql.Committee) -> safe.StatePath:
- downloads_dir = get_downloads_dir()
- if committee.is_podling:
- return downloads_dir / "incubator" / committee.key
- return downloads_dir / committee.key
-
-
def committee_keys_url(committee: sql.Committee) -> str:
return downloads_url(committee_dist_relpath(committee, filename="KEYS"))
@@ -83,10 +76,6 @@ def get_attestable_dir() -> safe.StatePath:
return safe.StatePath(pathlib.Path(config.get().ATTESTABLE_STORAGE_DIR))
-def get_downloads_dir() -> safe.StatePath:
- return safe.StatePath(pathlib.Path(config.get().DOWNLOADS_STORAGE_DIR))
-
-
def get_finished_dir() -> safe.StatePath:
return safe.StatePath(pathlib.Path(config.get().FINISHED_STORAGE_DIR))
diff --git a/atr/server.py b/atr/server.py
index fd5a984d..756cfb46 100644
--- a/atr/server.py
+++ b/atr/server.py
@@ -1307,7 +1307,7 @@ def _validate_config(app_config: type[config.AppConfig], hot_reload: bool) -> No
print("!!!", file=sys.stderr)
# sys.exit(1)
- if pathlib.Path(paths.get_downloads_dir()).is_dir() and (hot_reload is False):
+ if (pathlib.Path(app_config.STATE_DIR) / "downloads").is_dir() and (hot_reload is False):
print("!!!", file=sys.stderr)
print("WARNING: The downloads directory is no longer supported", file=sys.stderr)
print("Please remove downloads from the state directory", file=sys.stderr)
diff --git a/atr/shared/voting.py b/atr/shared/voting.py
index 16b0884f..fa488423 100644
--- a/atr/shared/voting.py
+++ b/atr/shared/voting.py
@@ -61,7 +61,7 @@ class StartVotingForm(form.Form):
)
download_path_suffix: safe.OptionalRelPath = form.label(
"Download path suffix",
- "Optional path under the committee downloads area.",
+ "Optional path under the committee distribution area.",
default=None,
)
concerns_noted: form.StrList = form.label("Concerns noted", widget=form.Widget.CUSTOM)
diff --git a/atr/templates/includes/topnav.html b/atr/templates/includes/topnav.html
index 840d0129..a6f4178f 100644
--- a/atr/templates/includes/topnav.html
+++ b/atr/templates/includes/topnav.html
@@ -93,7 +93,7 @@
Committees</a>
</li>
<li>
- <a class="dropdown-item" href="https:///downloads.apache.org/"><i class="bi bi-download"></i>
+ <a class="dropdown-item" href="https://downloads.apache.org/"><i class="bi bi-download"></i>
Downloads</a>
</li>
</ul>
diff --git a/tests/unit/test_paths.py b/tests/unit/test_paths.py
index 3620a96c..c076854a 100644
--- a/tests/unit/test_paths.py
+++ b/tests/unit/test_paths.py
@@ -40,20 +40,6 @@ def test_committee_dist_relpath_for_top_level_committee() -> None:
assert paths.committee_dist_relpath(committee) == safe.RelPath("myproject")
-def test_committee_downloads_dir_for_podling(monkeypatch, tmp_path: pathlib.Path):
- committee = types.SimpleNamespace(key="myproject", is_podling=True)
- monkeypatch.setattr(paths, "get_downloads_dir", lambda: safe.StatePath(tmp_path))
-
- assert paths.committee_downloads_dir(committee).path == tmp_path / "incubator" / "myproject"
-
-
-def test_committee_downloads_dir_for_top_level_committee(monkeypatch, tmp_path: pathlib.Path):
- committee = types.SimpleNamespace(key="myproject", is_podling=False)
- monkeypatch.setattr(paths, "get_downloads_dir", lambda: safe.StatePath(tmp_path))
-
- assert paths.committee_downloads_dir(committee).path == tmp_path / "myproject"
-
-
def test_committee_keys_url_for_podling() -> None:
committee = types.SimpleNamespace(key="myproject", is_podling=True)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org