You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by ar...@apache.org on 2026/07/27 12:47:47 UTC

(tooling-trusted-releases) branch arm updated (efc86011 -> 289c80f8)

This is an automated email from the ASF dual-hosted git repository.

alitheg pushed a change to branch arm
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


 discard efc86011 #1448 - static release catalog site generation
     new 289c80f8 #1448 - static release catalog site generation

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (efc86011)
            \
             N -- N -- N   refs/heads/arm (289c80f8)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tests/unit/test_announce_deletion_order.py  | 2 ++
 tests/unit/test_release_archive_approval.py | 2 ++
 2 files changed, 4 insertions(+)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org


(tooling-trusted-releases) 01/01: #1448 - static release catalog site generation

Posted by ar...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

alitheg pushed a commit to branch arm
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git

commit 289c80f8492e0aac2f2d25c6ed900e817f08071b
Author: Alastair McFarlane <ar...@apache.org>
AuthorDate: Mon Jul 27 11:29:30 2026 +0100

    #1448 - static release catalog site generation
---
 atr/admin/__init__.py                             |  37 ++++
 atr/admin/templates/update-catalog-site.html      |  89 ++++++++
 atr/catalog_site.py                               | 245 ++++++++++++++++++++++
 atr/config.py                                     |   3 +
 atr/models/args.py                                |   9 +
 atr/models/sql.py                                 |   4 +
 atr/paths.py                                      |  16 +-
 atr/shared/catalog.py                             |  10 +-
 atr/storage/writers/announce.py                   |   4 +
 atr/storage/writers/release.py                    |   6 +
 atr/tasks/__init__.py                             |  22 ++
 atr/tasks/catalog_site.py                         |  61 ++++++
 atr/tasks/task.py                                 |   4 +
 atr/templates/catalog_site/_version.html          |  16 ++
 atr/templates/catalog_site/catalog_site_base.html |  45 ++++
 atr/templates/catalog_site/committee.html         |  34 +++
 atr/templates/catalog_site/index.html             |  19 ++
 atr/templates/catalog_site/project.html           |  27 +++
 atr/templates/catalog_site/project_archive.html   |  15 ++
 atr/templates/catalog_site/release.html           |  53 +++++
 atr/templates/includes/topnav.html                |   5 +
 atr/util.py                                       |  14 +-
 atr/worker.py                                     |   4 +
 scripts/check_templates.py                        |   2 +-
 tests/unit/test_announce_deletion_order.py        |   2 +
 tests/unit/test_release_archive_approval.py       |   2 +
 tests/unit/test_release_writer_archive.py         |   2 +
 27 files changed, 735 insertions(+), 15 deletions(-)

diff --git a/atr/admin/__init__.py b/atr/admin/__init__.py
index 8254fbd7..5c456a67 100644
--- a/atr/admin/__init__.py
+++ b/atr/admin/__init__.py
@@ -912,6 +912,43 @@ def _catalog_import_preview(diff: catalogue_diff.CatalogueDiff) -> htm.Element:
     return htpy.div[sections]
 
 
+@admin.typed
+async def catalog_site_rebuild_get(
+    _session: web.Committer, _catalog_site_rebuild: Literal["catalog-site/rebuild"]
+) -> str | web.WerkzeugResponse | tuple[Mapping[str, Any], int]:
+    """
+    URL: GET /catalog-site/rebuild
+
+    Rebuild the whole static release catalog site.
+    """
+    rendered_form = await form.render(
+        model_cls=form.Empty,
+        submit_label="Rebuild catalog site",
+        empty=True,
+        form_classes="",
+    )
+    return await template.render("update-catalog-site.html", empty_form=rendered_form)
+
+
+@admin.typed
+async def catalog_site_rebuild_post(
+    session: web.Committer, _catalog_site_rebuild: Literal["catalog-site/rebuild"], _form: form.Empty
+) -> str | web.WerkzeugResponse | tuple[Mapping[str, Any], int]:
+    """Rebuild the whole static release catalog site."""
+    try:
+        task = await tasks.catalog_site_generate_all(session.asf_uid)
+        return {
+            "message": f"Catalog site rebuild task has been queued with ID {task.id}.",
+            "category": "success",
+        }, 200
+    except Exception as e:
+        log.exception("Failed to queue catalog site rebuild task")
+        return {
+            "message": f"Failed to queue catalog site rebuild: {e!s}",
+            "category": "error",
+        }, 200
+
+
 @admin.typed
 async def configuration(_session: web.Committer, _configuration: Literal["configuration"]) -> web.QuartResponse:
     """
diff --git a/atr/admin/templates/update-catalog-site.html b/atr/admin/templates/update-catalog-site.html
new file mode 100644
index 00000000..26f240a3
--- /dev/null
+++ b/atr/admin/templates/update-catalog-site.html
@@ -0,0 +1,89 @@
+{% extends "layouts/base-admin.html" %}
+
+{%- block title -%}Rebuild catalog site ~ ATR{%- endblock title -%}
+
+{%- block description -%}Rebuild the static release catalog site from the catalogue.{%- endblock description -%}
+
+{% block stylesheets %}
+    {{ super() }}
+    <style>
+        .page-form-group {
+            margin-bottom: 1rem;
+        }
+
+        button {
+            margin-top: 1rem;
+            padding: 0.5rem 1rem;
+            background: #036;
+            color: white;
+            border: none;
+            border-radius: 4px;
+            cursor: pointer;
+            font-weight: 500;
+        }
+
+        button:hover {
+            background: #047;
+        }
+
+        button:disabled {
+            color: gray;
+        }
+
+        .page-warning {
+            margin: 1.5rem 0;
+            padding: 1rem;
+            background: #fff3cd;
+            border: 1px solid #ffeeba;
+            border-radius: 4px;
+            color: #856404;
+        }
+
+        .page-warning p:last-child {
+            margin-bottom: 0;
+        }
+
+        .page-status-message {
+            margin: 1.5rem 0;
+            padding: 1rem;
+            border-radius: 4px;
+        }
+
+        .page-status-message.success {
+            background: #d4edda;
+            border: 1px solid #c3e6cb;
+            color: #155724;
+        }
+
+        .page-status-message.error {
+            background: #f8d7da;
+            border: 1px solid #f5c6cb;
+            color: #721c24;
+        }
+    </style>
+{% endblock stylesheets %}
+
+{% block content %}
+    <h1>Rebuild catalog site</h1>
+    <p>
+        This page queues a full rebuild of the static release catalog site, writing the whole
+        committee, project and release tree out to disk and dropping anything stale.
+    </p>
+
+    <div class="page-warning">
+        <p>
+            <strong>Note:</strong> catalogue changes already refresh the affected pages on their own,
+            so this is only needed to populate a fresh deployment or to clear up after project renames,
+            moves or deletions.
+        </p>
+    </div>
+
+    <div id="status"></div>
+
+    {{ empty_form }}
+{% endblock content %}
+
+{% block javascripts %}
+    {{ super() }}
+    <script src="{{ static_url('js/src/admin-update-form.js') }}"></script>
+{% endblock javascripts %}
diff --git a/atr/catalog_site.py b/atr/catalog_site.py
new file mode 100644
index 00000000..18099610
--- /dev/null
+++ b/atr/catalog_site.py
@@ -0,0 +1,245 @@
+# 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.
+
+"""Renders the release catalogue out to a directory of static files.
+
+The dynamic ``/catalog/<project>`` page is rebuilt here as a standalone,
+three-level site (committee, then project, then release version) that can be
+served from a separate host with no application behind it. The data is the
+same as the page - ``catalog.assemble`` for the versions and their artifacts,
+``cle.project_document`` for the per-project lifecycle feed - so this module
+only adds the file layout and the rendering.
+"""
+
+import asyncio
+import datetime
+import json
+import pathlib
+import shutil
+from collections.abc import Sequence
+from typing import Any, Final
+
+import aiofiles.os
+import jinja2
+import sqlmodel
+
+import atr.cle as cle
+import atr.db as db
+import atr.log as log
+import atr.metadata as metadata
+import atr.models.api as api
+import atr.models.args as args
+import atr.models.safe as safe
+import atr.models.sql as sql
+import atr.paths as paths
+import atr.shared.catalog as catalog
+import atr.util as util
+
+_TEMPLATES_DIR: Final = pathlib.Path(__file__).parent / "templates" / "catalog_site"
+_ENVIRONMENT: Final = jinja2.Environment(
+    loader=jinja2.FileSystemLoader(str(_TEMPLATES_DIR)),
+    autoescape=jinja2.select_autoescape(["html"]),
+    undefined=jinja2.StrictUndefined,
+)
+# The footer states the running ATR version, the same as the main site's footer.
+_ENVIRONMENT.globals["version"] = metadata.version
+_ENVIRONMENT.globals["commit"] = metadata.commit
+
+# ATR's own stylesheets and the certified badge, copied under the site's assets/
+# so the pages carry the app's look with nothing resolving back to the server.
+# atr.css references ../webfonts relative to itself, so the fonts sit alongside.
+_STATIC_DIR: Final = pathlib.Path(__file__).parent / "static"
+_ASSETS: Final[tuple[str, ...]] = (
+    "css/normalize.css",
+    "css/atr.css",
+    "css/bootstrap.custom.css",
+    "webfonts/inter-v.woff2",
+    "webfonts/inter-vi.woff2",
+    "webfonts/jost-v.woff2",
+    "svg/atr_certified_badge.svg",
+    "svg/atr_logo.svg",
+)
+
+# A committee counts as "current" while it still has a project that hasn't
+# retired to the Attic.
+_LIVE_PROJECT_STATUSES: Final[frozenset[sql.ProjectStatus]] = frozenset(
+    {sql.ProjectStatus.ACTIVE, sql.ProjectStatus.DORMANT, sql.ProjectStatus.STANDING}
+)
+
+
+async def generate_all(data: db.Session) -> None:
+    """Rebuild every page, overwriting in place so the site stays servable throughout."""
+    site_dir = paths.get_catalog_site_dir()
+    await _write_assets(site_dir)
+    committees = await data.committee().all()
+    await _write_root_index(site_dir, committees)
+    written = 0
+    for committee in committees:
+        try:
+            projects = await _write_committee_index(data, committee, site_dir)
+        except Exception:
+            log.exception(f"Failed to render catalog site committee index for {committee.key}")
+            continue
+        for project in projects:
+            try:
+                await _write_project(data, committee, project, site_dir)
+            except Exception:
+                log.exception(f"Failed to render catalog site for project {project.key}")
+        written += 1
+    log.info(f"Rebuilt catalog site for {written} of {len(committees)} committees")
+
+
+async def queue_regeneration(data: db.Session, asf_uid: str, project_key: str) -> None:
+    """Queue an incremental regeneration of one project's subtree.
+
+    Adds the task to the caller's session without committing, so it sits in the
+    same transaction as the catalogue change that triggered it. A QUEUED task
+    already waiting for the same project is left to do the work, since it will
+    read the committed change anyway; a run that's already in flight is serialized
+    separately, by the handler deferring to it.
+    """
+    existing = await data.task(
+        status=sql.TaskStatus.QUEUED,
+        task_type=sql.TaskType.CATALOG_SITE_GENERATE,
+        project_key=project_key,
+    ).get()
+    if existing is not None:
+        return
+    data.add(
+        sql.Task(
+            status=sql.TaskStatus.QUEUED,
+            task_type=sql.TaskType.CATALOG_SITE_GENERATE,
+            task_args=args.CatalogSiteGenerate(asf_uid=asf_uid, project_key=project_key).model_dump(),
+            asf_uid=asf_uid,
+            project_key=project_key,
+        )
+    )
+
+
+async def regenerate_project(data: db.Session, project_key: str) -> None:
+    """Rewrite one project's pages and refresh its committee index."""
+    project = await data.project(key=project_key, _committee=True).get()
+    if project is None:
+        log.warning(f"Catalog site: project {project_key} not found, skipping regeneration")
+        return
+    committee = project.committee
+    if committee is None:
+        log.warning(f"Catalog site: project {project_key} has no committee, skipping regeneration")
+        return
+    site_dir = paths.get_catalog_site_dir()
+    await _write_committee_index(data, committee, site_dir)
+    await _write_project(data, committee, project, site_dir)
+
+
+async def _project_cle_document(data: db.Session, project: sql.Project, now: datetime.datetime) -> dict[str, Any]:
+    releases = await data.release(project_key=project.key).all()
+    via = sql.validate_instrumented_attribute
+    events_stmt = sqlmodel.select(sql.LifecycleEvent).where(via(sql.LifecycleEvent.project_key) == project.key)
+    events = (await data.execute(events_stmt)).scalars().all()
+    return cle.project_document(project, events, releases, now=now)
+
+
+async def _write(path: safe.StatePath, content: str) -> None:
+    await util.atomic_write_file(path.path, content)
+
+
+async def _write_assets(site_dir: safe.StatePath) -> None:
+    assets_root = site_dir.path / "assets"
+    for rel in _ASSETS:
+        destination = assets_root / rel
+        await aiofiles.os.makedirs(destination.parent, exist_ok=True)
+        await asyncio.to_thread(shutil.copyfile, _STATIC_DIR / rel, destination)
+
+
+async def _write_committee_index(
+    data: db.Session, committee: sql.Committee, site_dir: safe.StatePath
+) -> list[sql.Project]:
+    projects = list(await data.project(committee_key=committee.key).all())
+    current = sorted((p for p in projects if p.status in _LIVE_PROJECT_STATUSES), key=lambda p: p.display_name.lower())
+    archived = sorted(
+        (p for p in projects if p.status not in _LIVE_PROJECT_STATUSES), key=lambda p: p.display_name.lower()
+    )
+    html = _ENVIRONMENT.get_template("committee.html").render(
+        committee=committee,
+        current=current,
+        archived=archived,
+        retired=not current,
+        root="../",
+    )
+    await _write(site_dir / committee.key / "index.html", html)
+    return projects
+
+
+async def _write_project(
+    data: db.Session, committee: sql.Committee, project: sql.Project, site_dir: safe.StatePath
+) -> None:
+    now = datetime.datetime.now(datetime.UTC)
+    artifacts = await data.artifact(project_key=project.key, _release=True).all()
+    project_cycles = await data.project_cycle(project_key=project.key).all()
+    assembled = catalog.assemble(project.version_method, artifacts, project_cycles, now)
+    current = [v for v in assembled.versions if v.status == "released"]
+    archived = [v for v in assembled.versions if v.status == "archived"]
+
+    project_dir = site_dir / committee.key / project.key
+    cle_document = await _project_cle_document(data, project, now)
+    await _write(project_dir / "cle.json", json.dumps(cle_document, indent=2, default=str))
+    await _write(
+        project_dir / "index.html",
+        _ENVIRONMENT.get_template("project.html").render(
+            committee=committee,
+            project=project,
+            versions=current,
+            has_archive=bool(archived),
+            retired=project.status not in _LIVE_PROJECT_STATUSES,
+            root="../../",
+        ),
+    )
+    await _write(
+        project_dir / "archive.html",
+        _ENVIRONMENT.get_template("project_archive.html").render(
+            committee=committee,
+            project=project,
+            versions=archived,
+            root="../../",
+        ),
+    )
+    for version in assembled.versions:
+        await _write_release(project_dir, committee, project, version)
+
+
+async def _write_release(
+    project_dir: safe.StatePath, committee: sql.Committee, project: sql.Project, version: api.CatalogVersion
+) -> None:
+    release_dir = project_dir / str(version.version)
+    await _write(
+        release_dir / "index.html",
+        _ENVIRONMENT.get_template("release.html").render(
+            committee=committee,
+            project=project,
+            version=version,
+            root="../../../",
+        ),
+    )
+    await _write(release_dir / "artifacts.json", version.model_dump_json(indent=2))
+
+
+async def _write_root_index(site_dir: safe.StatePath, committees: Sequence[sql.Committee]) -> None:
+    ordered = sorted(committees, key=lambda committee: committee.display_name.lower())
+    await _write(
+        site_dir / "index.html",
+        _ENVIRONMENT.get_template("index.html").render(committees=ordered, root=""),
+    )
diff --git a/atr/config.py b/atr/config.py
index 1411eb03..6eb6db0f 100644
--- a/atr/config.py
+++ b/atr/config.py
@@ -120,6 +120,8 @@ class AppConfig:
     SVN_STORAGE_DIR = os.path.join(STATE_DIR, "subversion")
     ARCHIVES_STORAGE_DIR = os.path.join(STATE_DIR, "archives")
     ATTESTABLE_STORAGE_DIR = os.path.join(STATE_DIR, "attestable")
+    # The static release catalog site, rebuilt from the catalogue on each change
+    CATALOG_SITE_DIR = os.path.join(STATE_DIR, "catalog-site")
     SQLITE_DB_PATH = decouple.config("SQLITE_DB_PATH", default="database/atr.db")
     STORAGE_AUDIT_LOG_FILE = os.path.join(STATE_DIR, "audit", "storage-audit.log")
     AUTH_AUDIT_LOG_FILE = os.path.join(STATE_DIR, "audit", "auth-audit.log")
@@ -261,6 +263,7 @@ def validate() -> None:
         (conf.SVN_STORAGE_DIR, "SVN_STORAGE_DIR"),
         (conf.ARCHIVES_STORAGE_DIR, "ARCHIVES_STORAGE_DIR"),
         (conf.ATTESTABLE_STORAGE_DIR, "ATTESTABLE_STORAGE_DIR"),
+        (conf.CATALOG_SITE_DIR, "CATALOG_SITE_DIR"),
         (conf.STORAGE_AUDIT_LOG_FILE, "STORAGE_AUDIT_LOG_FILE"),
         (conf.AUTH_AUDIT_LOG_FILE, "AUTH_AUDIT_LOG_FILE"),
         (conf.PERFORMANCE_LOG_FILE, "PERFORMANCE_LOG_FILE"),
diff --git a/atr/models/args.py b/atr/models/args.py
index 9f15bb2e..b6849a07 100644
--- a/atr/models/args.py
+++ b/atr/models/args.py
@@ -27,6 +27,15 @@ class CapApprovalResolveArgs(schema.Strict):
     attempt: int = pydantic.Field(default=0, description="The current resolve attempt count")
 
 
+class CatalogSiteGenerate(schema.Strict):
+    """Arguments for the task to regenerate the static release catalog site."""
+
+    asf_uid: str = schema.description("ASF UID on whose behalf the site is regenerated")
+    project_key: str | None = pydantic.Field(
+        default=None, description="Regenerate just this project's subtree; null rebuilds the whole site"
+    )
+
+
 class ConvertCycloneDX(schema.Strict):
     """Arguments for the task to convert an artifact to a CycloneDX SBOM."""
 
diff --git a/atr/models/sql.py b/atr/models/sql.py
index 70b56dd4..7c0688c7 100644
--- a/atr/models/sql.py
+++ b/atr/models/sql.py
@@ -232,6 +232,7 @@ class TaskStatus(enum.StrEnum):
 class TaskType(enum.StrEnum):
     ARCHIVE_COMPARISON = "archive_comparison"
     CAP_APPROVAL_RESOLVE = "cap_approval_resolve"
+    CATALOG_SITE_GENERATE = "catalog_site_generate"
     COMPARE_SOURCE_TREES = "compare_source_trees"
     DISTRIBUTION_STATUS = "distribution_status"
     DISTRIBUTION_WORKFLOW = "distribution_workflow"
@@ -272,6 +273,8 @@ class TaskType(enum.StrEnum):
                 return "Archive comparison"
             case TaskType.CAP_APPROVAL_RESOLVE:
                 return "CAP approval resolution"
+            case TaskType.CATALOG_SITE_GENERATE:
+                return "Catalog site generation"
             case TaskType.COMPARE_SOURCE_TREES:
                 return "Compare source trees"
             case TaskType.DISTRIBUTION_STATUS:
@@ -344,6 +347,7 @@ class TaskType(enum.StrEnum):
 # so on success they are logged to a file and dropped rather than kept in the table
 RECURRING_TASK_TYPES: Final[frozenset[TaskType]] = frozenset(
     {
+        TaskType.CATALOG_SITE_GENERATE,
         TaskType.DISTRIBUTION_STATUS,
         TaskType.MAINTENANCE,
         TaskType.METADATA_UPDATE,
diff --git a/atr/paths.py b/atr/paths.py
index 524cabd7..c8d7b03d 100644
--- a/atr/paths.py
+++ b/atr/paths.py
@@ -23,10 +23,10 @@ import atr.models.safe as safe
 import atr.models.sql as sql
 
 
-def archive_download_url(relpath: safe.RelPath) -> str:
+def archive_download_url(path: str | safe.RelPath) -> str:
     # archive.apache.org keeps every release ever published, including those pruned from the
     # live mirror, so an archived release's files are served from here regardless of host.
-    return f"{constants.ARCHIVE_APACHE_URL}/{relpath}"
+    return f"{constants.ARCHIVE_APACHE_URL}/{path}"
 
 
 def base_path_for_revision(
@@ -35,11 +35,11 @@ def base_path_for_revision(
     return get_unfinished_dir() / project_key / version_key / revision
 
 
-def closer_download_url(relpath: safe.RelPath) -> str:
+def closer_download_url(path: str | safe.RelPath) -> str:
     # For the artifacts themselves we go via the mirror network rather than
     # downloads.apache.org. action=download skips the human mirror-picker page and
     # redirects straight to a chosen mirror.
-    return f"{constants.CLOSER_LUA_URL}/{relpath}?action=download"
+    return f"{constants.CLOSER_LUA_URL}/{path}?action=download"
 
 
 def committee_dist_relpath(
@@ -61,11 +61,11 @@ def committee_keys_url(committee: sql.Committee) -> str:
     return downloads_url(committee_dist_relpath(committee, filename="KEYS"))
 
 
-def downloads_url(relpath: safe.RelPath) -> str:
+def downloads_url(path: str | safe.RelPath) -> str:
     # downloads.apache.org itself, not a mirror. Signatures, checksums and KEYS
     # must come from here rather than a mirror, otherwise a bad mirror could serve
     # a matching artifact and signature.
-    return f"{constants.DOWNLOADS_APACHE_URL}/{relpath}"
+    return f"{constants.DOWNLOADS_APACHE_URL}/{path}"
 
 
 def get_archives_dir() -> safe.StatePath:
@@ -76,6 +76,10 @@ def get_attestable_dir() -> safe.StatePath:
     return safe.StatePath(pathlib.Path(config.get().ATTESTABLE_STORAGE_DIR))
 
 
+def get_catalog_site_dir() -> safe.StatePath:
+    return safe.StatePath(pathlib.Path(config.get().CATALOG_SITE_DIR))
+
+
 def get_finished_dir() -> safe.StatePath:
     return safe.StatePath(pathlib.Path(config.get().FINISHED_STORAGE_DIR))
 
diff --git a/atr/shared/catalog.py b/atr/shared/catalog.py
index 0530468b..3787255b 100644
--- a/atr/shared/catalog.py
+++ b/atr/shared/catalog.py
@@ -71,15 +71,15 @@ def _artifact(row: sql.Artifact, downloadable: bool, archived: bool) -> models.a
     checksum_url: str | None = None
     sbom_url: str | None = None
     if downloadable:
-        # The stored directory is the file's real dist location, so a moved project's artifacts
+        # The stored suffix is the file's real dist location, so a moved project's artifacts
         # (graduated from an umbrella, or shifted to the Attic) resolve where they actually live. The
         # signature, checksum and SBOM share the directory. A row with no recorded suffix roots at
-        # the bare file path, so the link is empty-suffixed rather than the literal "None"
-        directory = safe.RelPath(row.download_path_suffix) if row.download_path_suffix else None
+        # the bare file path.
+        suffix = row.download_path_suffix
 
         def _dist_url(rel_path: str, kind: util.DownloadFile) -> str:
-            relpath = directory.append(rel_path) if (directory is not None) else safe.RelPath(rel_path)
-            return util.download_url_for_path(relpath, kind, archived=archived)
+            path = f"{suffix}/{rel_path}" if suffix else rel_path
+            return util.download_url_for_published_path(path, kind, archived=archived)
 
         artifact_url = _dist_url(row.artifact_path, util.DownloadFile.ARTIFACT)
         if row.signature_path:
diff --git a/atr/storage/writers/announce.py b/atr/storage/writers/announce.py
index 6bfd7d9d..1bd27e9d 100644
--- a/atr/storage/writers/announce.py
+++ b/atr/storage/writers/announce.py
@@ -28,6 +28,7 @@ import aioshutil
 import sqlmodel
 
 import atr.analysis as analysis
+import atr.catalog_site as catalog_site
 import atr.config as config
 import atr.construct as construct
 import atr.db as db
@@ -302,6 +303,9 @@ class ReleaseManager(CommitteeParticipant):
                 )
             )
 
+            # A released version is a new page on the static site.
+            await catalog_site.queue_regeneration(self.__data, self.__asf_uid, str(project_key))
+
             # Record the artifacts before promoting, since promotion deletes the
             # revisions and cascade-deletes the file state we read classifications from
             await self.__write_artifact_rows(
diff --git a/atr/storage/writers/release.py b/atr/storage/writers/release.py
index 19be5d0c..05532fd8 100644
--- a/atr/storage/writers/release.py
+++ b/atr/storage/writers/release.py
@@ -33,6 +33,7 @@ import sqlalchemy.engine as engine
 import sqlmodel
 
 import atr.analysis as analysis
+import atr.catalog_site as catalog_site
 import atr.config as config
 import atr.constants as constants
 import atr.construct as construct
@@ -129,6 +130,9 @@ async def _archive_release(
             published=archive_date,
         )
     )
+    # Archiving flips a release from current to archived, so the catalog site
+    # pages for its project need rewriting.
+    await catalog_site.queue_regeneration(data, asf_uid, release.project_key)
     await data.commit()
     write_as.append_to_audit_log(
         asf_uid=asf_uid,
@@ -1539,6 +1543,8 @@ class FoundationAdmin(FoundationCommitter):
                         dated=released,
                     )
                 )
+            # A newly catalogued release adds a page to the static site.
+            await catalog_site.queue_regeneration(self.__data, self.__asf_uid, project.key)
             await self.__data.commit()
         except Exception:
             # The caller catalogues each release in turn on one session, so a failure
diff --git a/atr/tasks/__init__.py b/atr/tasks/__init__.py
index b8b1bd21..9cb5cc98 100644
--- a/atr/tasks/__init__.py
+++ b/atr/tasks/__init__.py
@@ -37,6 +37,7 @@ import atr.models.safe as safe
 import atr.models.sql as sql
 import atr.paths as file_paths
 import atr.tasks.cap as cap
+import atr.tasks.catalog_site as catalog_site
 import atr.tasks.checks as checks
 import atr.tasks.checks.compare as compare
 import atr.tasks.checks.hashing as hashing
@@ -122,6 +123,25 @@ async def cap_approval_resolve(
         return task
 
 
+async def catalog_site_generate_all(asf_uid: str, caller_data: db.Session | None = None) -> sql.Task:
+    """Queue a full rebuild of the static release catalog site."""
+    async with db.ensure_session(caller_data) as data:
+        task = sql.Task(
+            status=sql.TaskStatus.QUEUED,
+            task_type=sql.TaskType.CATALOG_SITE_GENERATE,
+            task_args=args.CatalogSiteGenerate(asf_uid=asf_uid, project_key=None).model_dump(),
+            asf_uid=asf_uid,
+            revision_number=None,
+            primary_rel_path=None,
+            project_key=None,
+            version_key=None,
+        )
+        data.add(task)
+        await data.commit()
+        await data.flush()
+        return task
+
+
 async def clear_scheduled(caller_data: db.Session | None = None) -> None:
     """Clear all future scheduled tasks of the given types."""
     async with db.ensure_session(caller_data) as data:
@@ -342,6 +362,8 @@ def resolve(task_type: sql.TaskType) -> Callable[..., Awaitable[results.Results
             return parity.across_formats
         case sql.TaskType.CAP_APPROVAL_RESOLVE:
             return cap.resolve
+        case sql.TaskType.CATALOG_SITE_GENERATE:
+            return catalog_site.generate
         case sql.TaskType.COMPARE_SOURCE_TREES:
             return compare.source_trees
         case sql.TaskType.DISTRIBUTION_STATUS:
diff --git a/atr/tasks/catalog_site.py b/atr/tasks/catalog_site.py
new file mode 100644
index 00000000..11197baf
--- /dev/null
+++ b/atr/tasks/catalog_site.py
@@ -0,0 +1,61 @@
+# 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 sqlmodel
+
+import atr.catalog_site as catalog_site
+import atr.db as db
+import atr.models.args as args
+import atr.models.results as results
+import atr.models.sql as sql
+import atr.tasks.checks as checks
+import atr.tasks.task as task
+
+
+@checks.with_model(args.CatalogSiteGenerate)
+async def generate(task_args: args.CatalogSiteGenerate, *, task_id: int | None = None) -> results.Results | None:
+    """Regenerate the static release catalog site.
+
+    A null project_key rebuilds the whole site (bootstrap and drift repair); a
+    set project_key rewrites just that project's subtree in response to a
+    catalogue change.
+    """
+    async with db.session() as data:
+        if task_args.project_key is None:
+            await catalog_site.generate_all(data)
+            return None
+        if (task_id is not None) and await _older_regen_active(data, task_id, task_args.project_key):
+            # Two regens of one project at once would race each other's writes.
+            raise task.DeferredError
+        await catalog_site.regenerate_project(data, task_args.project_key)
+    return None
+
+
+async def _older_regen_active(data: db.Session, task_id: int, project_key: str) -> bool:
+    # True when an earlier-queued (lower id) regeneration of this project is still ACTIVE.
+    via = sql.validate_instrumented_attribute
+    stmt = (
+        sqlmodel.select(via(sql.Task.id))
+        .where(
+            via(sql.Task.task_type) == sql.TaskType.CATALOG_SITE_GENERATE,
+            via(sql.Task.project_key) == project_key,
+            via(sql.Task.status) == sql.TaskStatus.ACTIVE,
+            via(sql.Task.id) < task_id,
+        )
+        .limit(1)
+    )
+    return (await data.execute(stmt)).first() is not None
diff --git a/atr/tasks/task.py b/atr/tasks/task.py
index 633db17d..d12e644a 100644
--- a/atr/tasks/task.py
+++ b/atr/tasks/task.py
@@ -31,6 +31,10 @@ COMPLETED: Final = sql.TaskStatus.COMPLETED
 FAILED: Final = sql.TaskStatus.FAILED
 
 
+class DeferredError(Exception):
+    """Raised by a handler to send its own task back to the queue for a later attempt."""
+
+
 class Error(Exception):
     """Error during task execution."""
 
diff --git a/atr/templates/catalog_site/_version.html b/atr/templates/catalog_site/_version.html
new file mode 100644
index 00000000..7eff15e4
--- /dev/null
+++ b/atr/templates/catalog_site/_version.html
@@ -0,0 +1,16 @@
+{% set status_classes = {"released": "text-bg-success", "archived": "text-bg-secondary"} %}
+<div class="card mb-2 shadow-sm">
+  <div class="card-body d-flex justify-content-between align-items-center flex-wrap gap-2">
+    <span class="d-flex align-items-center flex-wrap gap-2">
+      <strong class="fs-5">{{ version.version }}</strong>
+      {% if version.managed %}
+        <img src="{{ root }}assets/svg/atr_certified_badge.svg" class="atr-certified-badge" alt="ATR certified">
+      {% endif %}
+      <span class="badge {{ status_classes[version.status] }}">{{ version.status | capitalize }}</span>
+      <span class="text-muted small">
+        {% if version.released %}{{ version.released.strftime("%d %b %Y") }}{% elif version.svn_revision %}svn r{{ version.svn_revision }}{% endif %}
+      </span>
+    </span>
+    <a class="btn btn-sm btn-primary" href="{{ version.version }}/index.html">Artifacts</a>
+  </div>
+</div>
diff --git a/atr/templates/catalog_site/catalog_site_base.html b/atr/templates/catalog_site/catalog_site_base.html
new file mode 100644
index 00000000..30df48c0
--- /dev/null
+++ b/atr/templates/catalog_site/catalog_site_base.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
+    <meta name="description"
+          content="{%- block description -%}{%- endblock description -%}" />
+    <title>{%- block title -%}{%- endblock title -%}</title>
+
+    <link rel="icon"
+          type="image/x-icon"
+          href="https://apache.org/favicons/favicon.ico" />
+    <link rel="stylesheet" href="{{ root }}assets/css/normalize.css" />
+    <link rel="stylesheet" href="{{ root }}assets/css/atr.css" />
+    <link rel="stylesheet" href="{{ root }}assets/css/bootstrap.custom.css" />
+  </head>
+  <body class="d-flex flex-column min-vh-100">
+    <nav class="navbar navbar-light bg-info-light navbar-ribbon" aria-label="Release catalog">
+      <div class="container-fluid">
+        <a class="navbar-atr" href="{{ root }}index.html">
+          <img src="{{ root }}assets/svg/atr_logo.svg"
+               alt="The Apache Software Foundation"
+               class="asf-logo" />
+        </a>
+        <span class="navbar-text ms-3 me-auto fw-semibold">Release catalog</span>
+      </div>
+    </nav>
+
+    <main class="container py-4 flex-grow-1">
+      {% block content %}{% endblock content %}
+    </main>
+
+    <footer class="footer">
+      <p>
+        Copyright &copy; 2026, The Apache Software Foundation. Material licensed under the
+        <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, version 2.0</a>.
+      </p>
+      <p>
+        This is ATR version <code id="atr-version"><a href="https://github.com/apache/tooling-trusted-releases/commit/{{ commit }}">{{ version }}</a></code>.
+        For inquiries, contact <a href="mailto:dev@tooling.apache.org">dev@tooling.apache.org</a>.
+        Submit bug reports and feedback to <a href="https://github.com/apache/tooling-trusted-releases/issues">the source code repository</a>.
+      </p>
+    </footer>
+  </body>
+</html>
diff --git a/atr/templates/catalog_site/committee.html b/atr/templates/catalog_site/committee.html
new file mode 100644
index 00000000..4f095858
--- /dev/null
+++ b/atr/templates/catalog_site/committee.html
@@ -0,0 +1,34 @@
+{% extends "catalog_site_base.html" %}
+
+{%- block title -%}{{ committee.display_name }} ~ Apache Release Catalog{%- endblock title -%}
+
+{%- block description -%}Releases for {{ committee.display_name }}.{%- endblock description -%}
+
+{% block content %}
+  <p class="mb-1"><a href="{{ root }}index.html" class="atr-back-link">&larr; Release catalog</a></p>
+  <h1 class="mb-4">{{ committee.display_name }}</h1>
+  {% if retired %}
+    <div class="alert alert-secondary" role="alert">
+      This committee has retired to the Attic. Its projects are no longer active.
+    </div>
+  {% else %}
+    <h2 class="fs-4 border-bottom pb-1">Current projects</h2>
+    {% if current %}
+      <div class="list-group mb-4">
+        {% for project in current %}
+          <a class="list-group-item list-group-item-action" href="{{ project.key }}/index.html">{{ project.display_name }}</a>
+        {% endfor %}
+      </div>
+    {% else %}
+      <p class="text-muted">No current projects.</p>
+    {% endif %}
+    {% if archived %}
+      <h2 class="fs-4 border-bottom pb-1">Archived projects</h2>
+      <div class="list-group">
+        {% for project in archived %}
+          <a class="list-group-item list-group-item-action" href="{{ project.key }}/index.html">{{ project.display_name }}</a>
+        {% endfor %}
+      </div>
+    {% endif %}
+  {% endif %}
+{% endblock content %}
diff --git a/atr/templates/catalog_site/index.html b/atr/templates/catalog_site/index.html
new file mode 100644
index 00000000..ecbcaf88
--- /dev/null
+++ b/atr/templates/catalog_site/index.html
@@ -0,0 +1,19 @@
+{% extends "catalog_site_base.html" %}
+
+{%- block title -%}Apache Release Catalog{%- endblock title -%}
+
+{%- block description -%}Released and archived artifacts for Apache Software Foundation projects.{%- endblock description -%}
+
+{% block content %}
+  <h1 class="mb-3">Release catalog</h1>
+  <p class="text-muted">Browse released and archived artifacts by committee.</p>
+  {% if committees %}
+    <div class="list-group">
+      {% for committee in committees %}
+        <a class="list-group-item list-group-item-action" href="{{ committee.key }}/index.html">{{ committee.display_name }}</a>
+      {% endfor %}
+    </div>
+  {% else %}
+    <p class="text-muted">No committees catalogued yet.</p>
+  {% endif %}
+{% endblock content %}
diff --git a/atr/templates/catalog_site/project.html b/atr/templates/catalog_site/project.html
new file mode 100644
index 00000000..2e9dc974
--- /dev/null
+++ b/atr/templates/catalog_site/project.html
@@ -0,0 +1,27 @@
+{% extends "catalog_site_base.html" %}
+
+{%- block title -%}{{ project.display_name }} ~ Apache Release Catalog{%- endblock title -%}
+
+{%- block description -%}Release catalogue for {{ project.display_name }}.{%- endblock description -%}
+
+{% block content %}
+  <p class="mb-1"><a href="../index.html" class="atr-back-link">&larr; {{ committee.display_name }}</a></p>
+  <div class="d-flex justify-content-between align-items-center flex-wrap gap-2 mb-3">
+    <h1 class="mb-0">{{ project.display_name }}</h1>
+    <span>
+      <a class="btn btn-sm btn-outline-secondary" href="cle.json">Project CLE</a>
+      {% if has_archive %}<a class="btn btn-sm btn-outline-secondary ms-2" href="archive.html">Archived releases</a>{% endif %}
+    </span>
+  </div>
+  {% if retired %}
+    <div class="alert alert-secondary" role="alert">
+      This project has been archived. See its archived releases for the history.
+    </div>
+  {% elif versions %}
+    {% for version in versions %}{% include "_version.html" %}{% endfor %}
+  {% else %}
+    <div class="alert alert-info" role="alert">
+      No catalogued releases yet for {{ project.display_name }}.
+    </div>
+  {% endif %}
+{% endblock content %}
diff --git a/atr/templates/catalog_site/project_archive.html b/atr/templates/catalog_site/project_archive.html
new file mode 100644
index 00000000..cec7b34c
--- /dev/null
+++ b/atr/templates/catalog_site/project_archive.html
@@ -0,0 +1,15 @@
+{% extends "catalog_site_base.html" %}
+
+{%- block title -%}{{ project.display_name }} archived releases ~ Apache Release Catalog{%- endblock title -%}
+
+{%- block description -%}Archived releases for {{ project.display_name }}.{%- endblock description -%}
+
+{% block content %}
+  <p class="mb-1"><a href="index.html" class="atr-back-link">&larr; {{ project.display_name }}</a></p>
+  <h1 class="mb-3">{{ project.display_name }} &ndash; archived releases</h1>
+  {% if versions %}
+    {% for version in versions %}{% include "_version.html" %}{% endfor %}
+  {% else %}
+    <div class="alert alert-info" role="alert">No archived releases.</div>
+  {% endif %}
+{% endblock content %}
diff --git a/atr/templates/catalog_site/release.html b/atr/templates/catalog_site/release.html
new file mode 100644
index 00000000..62c24f28
--- /dev/null
+++ b/atr/templates/catalog_site/release.html
@@ -0,0 +1,53 @@
+{% extends "catalog_site_base.html" %}
+
+{%- block title -%}{{ project.display_name }} {{ version.version }} ~ Apache Release Catalog{%- endblock title -%}
+
+{%- block description -%}{{ project.display_name }} {{ version.version }} artifacts and downloads.{%- endblock description -%}
+
+{% block content %}
+  <p class="mb-1"><a href="../index.html" class="atr-back-link">&larr; {{ project.display_name }}</a></p>
+  <h1 class="mb-3">{{ project.display_name }} {{ version.version }}</h1>
+
+  {% set status_classes = {"released": "text-bg-success", "archived": "text-bg-secondary"} %}
+  <div class="card mb-3 shadow-sm atr-catalog-version" data-status="{{ version.status }}">
+    <div class="d-flex">
+      <div class="atr-certified-panel d-flex align-items-center justify-content-center border-end">
+        {% if version.managed %}
+          <img src="{{ root }}assets/svg/atr_certified_badge.svg" class="atr-certified-badge" alt="ATR certified">
+        {% endif %}
+      </div>
+      <div class="card-body">
+        <div class="d-flex justify-content-between align-items-center mb-1">
+          <strong class="fs-5">{{ version.version }}</strong>
+          <span class="badge {{ status_classes[version.status] }}">{{ version.status | capitalize }}</span>
+        </div>
+        <p class="text-muted small mb-2">
+          {% if version.released %}{{ version.released.strftime("%d %b %Y") }}{% elif version.svn_revision %}svn r{{ version.svn_revision }}{% endif %}
+        </p>
+        {% if version.artifacts %}
+          {% for artifact in version.artifacts %}
+            <div class="d-flex flex-wrap justify-content-between gap-2 py-1 atr-catalog-artifact">
+              <span class="font-monospace small">
+                {{ artifact.artifact_path }}
+                {% if artifact.classification %}<span class="badge text-bg-light ms-1">{{ artifact.classification }}</span>{% endif %}
+              </span>
+              <span class="small text-nowrap">
+                {% if artifact.downloadable %}
+                  <a class="btn btn-sm btn-primary" href="{{ artifact.artifact_url }}">Download</a>
+                  {% if artifact.signature_url %}<a class="btn btn-sm btn-outline-secondary ms-2" href="{{ artifact.signature_url }}">Signature</a>{% endif %}
+                  {% if artifact.checksum_url %}<a class="btn btn-sm btn-outline-secondary ms-2" href="{{ artifact.checksum_url }}">Checksum</a>{% endif %}
+                  {% if artifact.sbom_url %}<a class="btn btn-sm btn-outline-secondary ms-2" href="{{ artifact.sbom_url }}">SBOM</a>{% endif %}
+                {% else %}
+                  <span class="text-secondary">Metadata only</span>
+                {% endif %}
+              </span>
+            </div>
+          {% endfor %}
+        {% else %}
+          <p class="text-secondary small fst-italic mb-0">No catalogued artifacts for this version.</p>
+        {% endif %}
+      </div>
+    </div>
+  </div>
+  <p class="small"><a href="artifacts.json">artifacts.json</a></p>
+{% endblock content %}
diff --git a/atr/templates/includes/topnav.html b/atr/templates/includes/topnav.html
index a6f4178f..b128649d 100644
--- a/atr/templates/includes/topnav.html
+++ b/atr/templates/includes/topnav.html
@@ -280,6 +280,11 @@
                    href="{{ as_url(admin.catalog_get) }}"
                    {% if request.endpoint == 'atr_admin_catalog_get' %}class="active"{% endif %}><i class="bi bi-diagram-3"></i> Catalog admin</a>
               </li>
+              <li>
+                <a class="dropdown-item"
+                   href="{{ as_url(admin.catalog_site_rebuild_get) }}"
+                   {% if request.endpoint == 'atr_admin_catalog_site_rebuild_get' %}class="active"{% endif %}><i class="bi bi-globe"></i> Rebuild catalog site</a>
+              </li>
               <li>
                 <hr class="dropdown-divider" />
               </li>
diff --git a/atr/util.py b/atr/util.py
index bce76206..0a7f6f2a 100644
--- a/atr/util.py
+++ b/atr/util.py
@@ -722,13 +722,21 @@ def download_page_url_error(url: str) -> str | None:
 
 
 def download_url_for_path(relpath: safe.RelPath, kind: DownloadFile, archived: bool = False) -> str:
+    return download_url_for_published_path(str(relpath), kind, archived)
+
+
+def download_url_for_published_path(path: str, kind: DownloadFile, archived: bool = False) -> str:
     # Where a published file at a known dist-relative path is fetched from. Release artifacts use
     # the mirror network; verification metadata uses the canonical host; archived files use the archive.
+    # The path is a real published filename, not an ATR-jailed one, so percent-encode it rather than
+    # validating - RelPath rejects legit dist names (a ":" in a container image, a "#" in a C# artifact).
+    # "+()" stay literal so existing links are unchanged.
+    encoded = urllib.parse.quote(path, safe="/+()")
     if archived:
-        return paths.archive_download_url(relpath)
+        return paths.archive_download_url(encoded)
     if kind is DownloadFile.ARTIFACT:
-        return paths.closer_download_url(relpath)
-    return paths.downloads_url(relpath)
+        return paths.closer_download_url(encoded)
+    return paths.downloads_url(encoded)
 
 
 def email_from_uid(uid: str) -> str | None:
diff --git a/atr/worker.py b/atr/worker.py
index 5dce490c..2b596613 100644
--- a/atr/worker.py
+++ b/atr/worker.py
@@ -330,6 +330,10 @@ async def _task_process(task_id: int, task_type: str, task_args: list[str] | dic
         task_results = handler_result
         status = task.COMPLETED
         error = None
+    except task.DeferredError:
+        log.info(f"Task {task_id} ({task_type}) deferred, re-queued for a later attempt")
+        await _task_defer(task_id)
+        return
     except Exception as e:
         task_results = None
         status = task.FAILED
diff --git a/scripts/check_templates.py b/scripts/check_templates.py
index 34321015..cbcb5756 100755
--- a/scripts/check_templates.py
+++ b/scripts/check_templates.py
@@ -41,7 +41,7 @@ class TemplateVisitor(ast.NodeVisitor):
         self.found = []
 
     def visit_Call(self, node):
-        if isinstance(node.func, ast.Attribute) and (node.func.attr == "render"):
+        if isinstance(node.func, ast.Attribute) and (node.func.attr in ("render", "get_template")):
             if node.args:
                 arg = node.args[0]
                 if isinstance(arg, ast.Constant) and isinstance(arg.value, str):
diff --git a/tests/unit/test_announce_deletion_order.py b/tests/unit/test_announce_deletion_order.py
index 7c863517..74986d2c 100644
--- a/tests/unit/test_announce_deletion_order.py
+++ b/tests/unit/test_announce_deletion_order.py
@@ -54,6 +54,8 @@ def announcing_writer(
     monkeypatch.setattr(announce.util, "permitted_announce_recipients", lambda *a, **k: ["announce@example.apache.org"])
     data = mock.MagicMock()
     data.release.return_value.demand = mock.AsyncMock(return_value=release_row())
+    # A released version queues a catalog-site regeneration, which first looks for an existing queued one.
+    data.task.return_value.get = mock.AsyncMock(return_value=None)
     data.commit = mock.AsyncMock(side_effect=lambda: calls.append("commit"))
     release_manager = object.__new__(announce.ReleaseManager)
     release_manager._ReleaseManager__data = data
diff --git a/tests/unit/test_release_archive_approval.py b/tests/unit/test_release_archive_approval.py
index 5f8bc436..d818dd14 100644
--- a/tests/unit/test_release_archive_approval.py
+++ b/tests/unit/test_release_archive_approval.py
@@ -136,6 +136,8 @@ def _data(approval: SimpleNamespace, update_rowcount: int = 1, is_archived: bool
     data = mock.MagicMock()
     data.release = mock.MagicMock(return_value=_query(get=release))
     data.approval_request = mock.MagicMock(return_value=_query(get=approval))
+    # Archival queues a catalog-site regeneration, which first looks for an existing queued one.
+    data.task = mock.MagicMock(return_value=_query(get=None))
     data.execute_query = mock.AsyncMock(return_value=SimpleNamespace(rowcount=update_rowcount))
     data.begin_immediate = mock.AsyncMock()
     data.expire_all = mock.MagicMock()
diff --git a/tests/unit/test_release_writer_archive.py b/tests/unit/test_release_writer_archive.py
index 3e090137..89cf88c5 100644
--- a/tests/unit/test_release_writer_archive.py
+++ b/tests/unit/test_release_writer_archive.py
@@ -167,6 +167,8 @@ def _make_member(
     mock_data.release = mock.MagicMock(return_value=ReleaseQuery(release_result))
     mock_data.project = mock.MagicMock(return_value=ReleaseQuery(project))
     mock_data.approval_request = mock.MagicMock(return_value=ReleaseQuery(approval))
+    # Archival queues a catalog-site regeneration, which first looks for an existing queued one.
+    mock_data.task = mock.MagicMock(return_value=ReleaseQuery(None))
     mock_data.execute_query = mock.AsyncMock()
     mock_data.begin_immediate = mock.AsyncMock()
     mock_data.expire_all = mock.MagicMock()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org