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

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git


The following commit(s) were added to refs/heads/main by this push:
     new bbf6c6b  Update stages and phases to correspond to the ATR workflow
bbf6c6b is described below

commit bbf6c6b9f6b6c5b381ef4ebebeba6314ba51cb21
Author: Sean B. Palmer <[email protected]>
AuthorDate: Wed Mar 26 15:21:24 2025 +0200

    Update stages and phases to correspond to the ATR workflow
---
 atr/db/models.py        | 59 ++++++++++++++++++-------------------------------
 atr/routes/candidate.py |  2 +-
 atr/ssh.py              |  2 +-
 3 files changed, 24 insertions(+), 39 deletions(-)

diff --git a/atr/db/models.py b/atr/db/models.py
index ae18f32..6dc5e06 100644
--- a/atr/db/models.py
+++ b/atr/db/models.py
@@ -149,17 +149,11 @@ class Project(sqlmodel.SQLModel, table=True):
     @property
     async def candidate_drafts(self) -> list["Release"]:
         """Get the candidate drafts for the project."""
-        # TODO: Improve our interface to use in_ automatically for lists
-        candidate_draft_phases = [
-            ReleasePhase.RELEASE_CANDIDATE,
-            ReleasePhase.EVALUATE_CLAIMS,
-            # ReleasePhase.RELEASE,
-        ]
         query = (
             sqlmodel.select(Release)
             .where(
                 Release.project_id == self.id,
-                
db.validate_instrumented_attribute(Release.phase).in_(candidate_draft_phases),
+                Release.phase == ReleasePhase.CANDIDATE_DRAFT,
             )
             
.order_by(db.validate_instrumented_attribute(Release.created).desc())
         )
@@ -220,43 +214,34 @@ class VoteEntry(pydantic.BaseModel):
 
 
 class ReleaseStage(str, enum.Enum):
-    BUILD = "build"
+    # A release candidate is being prepared
     CANDIDATE = "candidate"
-    CURRENT = "current"
-    ARCHIVED = "archived"
+    # A release is being prepared
+    RELEASE = "release"
+    # An existing release is being imported from ASF SVN dist
+    MIGRATION = "migration"
+    # A release candidate has failed at any CANDIDATE stage
+    FAILED = "failed"
 
 
 class ReleasePhase(str, enum.Enum):
     # [CANDIDATE]
-    # Step 1: The RC is received from external sources
-    RELEASE_CANDIDATE = "release_candidate"
-    # Step 2: The ATR website evaluates claims about the RC
-    EVALUATE_CLAIMS = "evaluate_claims"
-    # Step 3: The RC is distributed to project members for testing
-    DISTRIBUTE_TEST = "distribute_test"
-    # Step 4: The project members are voting on the RC
-    VOTE = "vote"
-    # Step 5: The project vote on the RC has passed
-    PASSES = "passes"
-
-    # [CURRENT]
+    # Step 1: The candidate files are added from external sources and checked 
by ATR
+    CANDIDATE_DRAFT = "candidate_draft"
+    # Step 2: The candidate files are frozen and promoted into a candidate 
release
+    CANDIDATE_BEFORE_VOTE = "candidate_before_vote"
+    # Step 3: The project members are voting on the candidate release
+    CANDIDATE_DURING_VOTE = "candidate_during_vote"
+    # Step 4: The project vote on the candidate release has passed
+    CANDIDATE_AFTER_VOTE = "candidate_after_vote"
+
+    # [RELEASE]
     # Step 1: The release files are being put in place
-    RELEASE = "release"
+    RELEASE_DRAFT = "release_draft"
     # Step 2: The release files are available but not yet announced
-    DISTRIBUTE = "distribute"
-    # Step 3: The release has been announced but not yet released[?]
-    # TODO: Need to check the meaning of this phase
-    ANNOUNCE_RELEASE = "announce_release"
-    # Step 4: The release has been announced
-    RELEASED = "released"
-
-    # [Other]
-    # An existing release is being imported from ASF SVN dist
-    MIGRATION = "migration"
-    # A release candidate has failed at any CANDIDATE stage
-    FAILED = "failed"
-    # A previously CURRENT release has been archived
-    ARCHIVED = "archived"
+    RELEASE_BEFORE_ANNOUNCEMENT = "release_before_announcement"
+    # Step 3: The release has been announced
+    RELEASE_AFTER_ANNOUNCEMENT = "release_after_announcement"
 
 
 class TaskStatus(str, enum.Enum):
diff --git a/atr/routes/candidate.py b/atr/routes/candidate.py
index 7637512..62b2fca 100644
--- a/atr/routes/candidate.py
+++ b/atr/routes/candidate.py
@@ -124,7 +124,7 @@ async def release_add_post(session: session.ClientSession, 
request: quart.Reques
             release = models.Release(
                 name=release_name,
                 stage=models.ReleaseStage.CANDIDATE,
-                phase=models.ReleasePhase.RELEASE_CANDIDATE,
+                phase=models.ReleasePhase.CANDIDATE_DRAFT,
                 project_id=project.id,
                 project=project,
                 version=version,
diff --git a/atr/ssh.py b/atr/ssh.py
index 9950f40..8cba7f0 100644
--- a/atr/ssh.py
+++ b/atr/ssh.py
@@ -300,7 +300,7 @@ async def _handle_client(process: 
asyncssh.SSHServerProcess) -> None:
                     project=project,
                     version=release_version,
                     stage=models.ReleaseStage.CANDIDATE,
-                    phase=models.ReleasePhase.RELEASE_CANDIDATE,
+                    phase=models.ReleasePhase.CANDIDATE_DRAFT,
                     created=datetime.datetime.now(),
                 )
                 data.add(release)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to