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/08/04 14:30:28 UTC
(tooling-trusted-releases) branch arm updated: Regenerate catalog when admin moves projects - fixed
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
The following commit(s) were added to refs/heads/arm by this push:
new 399f985e Regenerate catalog when admin moves projects - fixed
399f985e is described below
commit 399f985e6f061bc90032d57c799dbcefe1759333
Author: Alastair McFarlane <ar...@apache.org>
AuthorDate: Tue Aug 4 15:30:05 2026 +0100
Regenerate catalog when admin moves projects - fixed
---
atr/tasks/__init__.py | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/atr/tasks/__init__.py b/atr/tasks/__init__.py
index 30f6719f..ce19153b 100644
--- a/atr/tasks/__init__.py
+++ b/atr/tasks/__init__.py
@@ -26,7 +26,6 @@ import sqlmodel
import atr.analysis as analysis
import atr.attestable as attestable
-import atr.catalog_site as catalog_site
import atr.constants as constants
import atr.db as db
import atr.detection as detection
@@ -38,7 +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_task
+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
@@ -130,9 +129,26 @@ async def cap_approval_resolve(
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"""
+ """Queue a full rebuild of the static release catalog site, reusing one already queued."""
async with db.ensure_session(caller_data) as data:
- task = await catalog_site.queue_full_regeneration(data, asf_uid)
+ existing = await data.task(
+ status=sql.TaskStatus.QUEUED,
+ task_type=sql.TaskType.CATALOG_SITE_GENERATE,
+ project_key=None,
+ ).get()
+ if existing is not None:
+ return existing
+ 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
@@ -359,7 +375,7 @@ def resolve(task_type: sql.TaskType) -> Callable[..., Awaitable[results.Results
case sql.TaskType.CAP_APPROVAL_RESOLVE:
return cap.resolve
case sql.TaskType.CATALOG_SITE_GENERATE:
- return catalog_site_task.generate
+ return catalog_site.generate
case sql.TaskType.COMPARE_SOURCE_TREES:
return compare.source_trees
case sql.TaskType.DISTRIBUTION_STATUS:
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org