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-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new d72e3b0  Duplicate derived project release policies instead of cloning 
by reference
d72e3b0 is described below

commit d72e3b0dc1ded6c93f188145c1cb2957cb687b67
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Jan 9 14:25:39 2026 +0000

    Duplicate derived project release policies instead of cloning by reference
---
 atr/models/sql.py              | 26 ++++++++++++++++++++++++++
 atr/storage/writers/project.py |  8 ++++++--
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/atr/models/sql.py b/atr/models/sql.py
index 16ecfe5..8957123 100644
--- a/atr/models/sql.py
+++ b/atr/models/sql.py
@@ -1068,6 +1068,32 @@ class ReleasePolicy(sqlmodel.SQLModel, table=True):
     # 1-1: Project -C-> ReleasePolicy
     project: Project = sqlmodel.Relationship(back_populates="release_policy")
 
+    def duplicate(self) -> "ReleasePolicy":
+        # Cannot call this .copy because that's an existing BaseModel method
+        return ReleasePolicy(
+            mailto_addresses=list(self.mailto_addresses),
+            manual_vote=self.manual_vote,
+            min_hours=self.min_hours,
+            release_checklist=self.release_checklist,
+            vote_comment_template=self.vote_comment_template,
+            pause_for_rm=self.pause_for_rm,
+            start_vote_subject=self.start_vote_subject,
+            start_vote_template=self.start_vote_template,
+            announce_release_subject=self.announce_release_subject,
+            announce_release_template=self.announce_release_template,
+            binary_artifact_paths=list(self.binary_artifact_paths),
+            source_artifact_paths=list(self.source_artifact_paths),
+            license_check_mode=self.license_check_mode,
+            source_excludes_lightweight=list(self.source_excludes_lightweight),
+            source_excludes_rat=list(self.source_excludes_rat),
+            strict_checking=self.strict_checking,
+            github_repository_name=self.github_repository_name,
+            
github_compose_workflow_path=list(self.github_compose_workflow_path),
+            github_vote_workflow_path=list(self.github_vote_workflow_path),
+            github_finish_workflow_path=list(self.github_finish_workflow_path),
+            preserve_download_files=self.preserve_download_files,
+        )
+
 
 # Revision: Release
 class Revision(sqlmodel.SQLModel, table=True):
diff --git a/atr/storage/writers/project.py b/atr/storage/writers/project.py
index 3ee9b21..3763fca 100644
--- a/atr/storage/writers/project.py
+++ b/atr/storage/writers/project.py
@@ -136,7 +136,9 @@ class CommitteeMember(CommitteeParticipant):
         # Get the base project to derive from
         # We're allowing derivation from a retired project here
         # TODO: Should we disallow this instead?
-        committee_projects = await 
self.__data.project(committee_name=committee_name, _committee=True).all()
+        committee_projects = await self.__data.project(
+            committee_name=committee_name, _committee=True, 
_release_policy=True
+        ).all()
         for committee_project in committee_projects:
             if label.startswith(committee_project.name + "-"):
                 if (super_project is None) or (len(super_project.name) < 
len(committee_project.name)):
@@ -156,11 +158,13 @@ class CommitteeMember(CommitteeParticipant):
             category=super_project.category if super_project else None,
             programming_languages=super_project.programming_languages if 
super_project else None,
             committee_name=committee_name,
-            release_policy_id=super_project.release_policy_id if super_project 
else None,
             created=datetime.datetime.now(datetime.UTC),
             created_by=self.__asf_uid,
         )
 
+        if super_project and super_project.release_policy:
+            project.release_policy = super_project.release_policy.duplicate()
+
         self.__data.add(project)
         await self.__data.commit()
         self.__write_as.append_to_audit_log(


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

Reply via email to