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/05 15:00:39 UTC
(tooling-trusted-releases) branch arm updated (1b8611f0 -> b15a521a)
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
from 1b8611f0 Give mandatory form fields an asterisk and fix error with file form inputs validation
add 93457a76 Field mandatory that shouldn't have been
add 98bd4efd Allow Tooling presentation votes to be resolved early
add 86adf827 Fix the formatting of flash messages about announcing a vote
new b15a521a #1488 - allow archiving project with archived releases
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:
atr/db/interaction.py | 24 ++++---
atr/get/projects.py | 10 +--
atr/get/resolve.py | 2 +-
atr/post/projects.py | 7 ++-
atr/post/vote.py | 2 +-
atr/shared/projects.py | 2 +-
atr/storage/writers/vote.py | 4 +-
atr/templates/resolve-tabulated.html | 4 +-
tests/unit/test_vote_resolution.py | 118 ++++++++++++++++++++++++++++++-----
tests/unit/test_vote_serials.py | 6 +-
10 files changed, 142 insertions(+), 37 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org
(tooling-trusted-releases) 01/01: #1488 - allow archiving project with archived releases
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 b15a521a50f7b35fe82e5e44e03df7edf06584c3
Author: Alastair McFarlane <ar...@apache.org>
AuthorDate: Wed Aug 5 09:55:55 2026 +0100
#1488 - allow archiving project with archived releases
---
atr/db/interaction.py | 15 ++++++++++++---
atr/get/projects.py | 10 +++++-----
atr/post/projects.py | 7 +++++--
3 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/atr/db/interaction.py b/atr/db/interaction.py
index 04dcb935..d5e05b6a 100644
--- a/atr/db/interaction.py
+++ b/atr/db/interaction.py
@@ -566,12 +566,21 @@ def project_order_key(project: sql.Project, latest_release: datetime.datetime |
async def project_release_counts(data: db.Session) -> dict[str, tuple[int, int]]:
via = sql.validate_instrumented_attribute
- non_draft_case = sqlalchemy.case((via(sql.Release.phase) != sql.ReleasePhase.RELEASE_CANDIDATE_DRAFT, 1), else_=0)
+ active_case = sqlalchemy.case(
+ (
+ sqlalchemy.and_(
+ via(sql.Release.phase) != sql.ReleasePhase.RELEASE_CANDIDATE_DRAFT,
+ via(sql.Release.is_archived).is_(False),
+ ),
+ 1,
+ ),
+ else_=0,
+ )
query = sqlmodel.select(
- sql.Release.project_key, sqlalchemy.func.count(), sqlalchemy.func.sum(non_draft_case)
+ sql.Release.project_key, sqlalchemy.func.count(), sqlalchemy.func.sum(active_case)
).group_by(via(sql.Release.project_key))
result = await data.execute(query)
- return {key: (total, non_draft) for key, total, non_draft in result.all()}
+ return {key: (total, active) for key, total, active in result.all()}
async def release_completed_svn_publish_task(
diff --git a/atr/get/projects.py b/atr/get/projects.py
index a0267b70..8c4d134d 100644
--- a/atr/get/projects.py
+++ b/atr/get/projects.py
@@ -188,7 +188,7 @@ async def projects(session: web.Committer, _projects: Literal["projects"]) -> st
continue
if project.committee and committee_project_counts[str(project.committee.key)] <= 1:
continue
- total_releases, non_draft_releases = release_counts.get(str(project.key), (0, 0))
+ total_releases, active_releases = release_counts.get(str(project.key), (0, 0))
if total_releases == 0:
action_forms[str(project.key)] = await form.render(
model_cls=shared.projects.DeleteSelectedProject,
@@ -203,7 +203,7 @@ async def projects(session: web.Committer, _projects: Literal["projects"]) -> st
" ready to delete only if the vote passes, and you must then return to complete it."
),
)
- elif non_draft_releases == 0:
+ elif active_releases == 0:
action_forms[str(project.key)] = await form.render(
model_cls=shared.projects.ArchiveSelectedProject,
action=util.as_url(post.projects.archive),
@@ -215,7 +215,7 @@ async def projects(session: web.Committer, _projects: Literal["projects"]) -> st
confirm=(
"This starts a binding CAP approval vote by the committee PMC. ATR will mark the project"
" ready to archive only if the vote passes, and you must then return to complete it, which"
- " deletes the draft releases and retires the project."
+ " deletes any draft releases and retires the project."
),
)
@@ -553,7 +553,7 @@ async def _delete_form(project: sql.Project) -> htm.Element | None:
),
empty=True,
)
- elif all(r.phase == sql.ReleasePhase.RELEASE_CANDIDATE_DRAFT for r in releases):
+ elif not any((r.phase != sql.ReleasePhase.RELEASE_CANDIDATE_DRAFT) and (not r.is_archived) for r in releases):
delete_form = await form.render(
model_cls=shared.projects.ArchiveSelectedProject,
action=util.as_url(post.projects.archive),
@@ -565,7 +565,7 @@ async def _delete_form(project: sql.Project) -> htm.Element | None:
confirm=(
"This starts a binding CAP approval vote by the committee PMC. ATR will mark the project"
" ready to archive only if the vote passes, and you must then return to complete it, which"
- " deletes the draft releases and retires the project."
+ " deletes any draft releases and retires the project."
),
)
return delete_form
diff --git a/atr/post/projects.py b/atr/post/projects.py
index e6435353..6bb7f78a 100644
--- a/atr/post/projects.py
+++ b/atr/post/projects.py
@@ -188,8 +188,11 @@ def _action_eligibility_error(
return None
if (not completing) and (not releases):
return f"Project '{project.key}' has no releases to archive."
- if not all(r.phase == sql.ReleasePhase.RELEASE_CANDIDATE_DRAFT for r in releases):
- return f"Project '{project.key}' has non-draft releases and cannot be archived."
+ active_releases = [
+ r for r in releases if (r.phase != sql.ReleasePhase.RELEASE_CANDIDATE_DRAFT) and (not r.is_archived)
+ ]
+ if active_releases:
+ return f"Project '{project.key}' has active releases and cannot be archived."
if not completing:
return None
new_drafts = [r for r in releases if (requested_at is None) or (r.created > requested_at)]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org