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 aaf472d Add an empty vote module to the storage interface writers
aaf472d is described below
commit aaf472d11f92c77d2278c6c1adaed221f0bdbbda
Author: Sean B. Palmer <[email protected]>
AuthorDate: Thu Sep 4 20:06:27 2025 +0100
Add an empty vote module to the storage interface writers
---
atr/storage/__init__.py | 5 +++
atr/storage/writers/__init__.py | 3 +-
atr/storage/writers/vote.py | 85 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 92 insertions(+), 1 deletion(-)
diff --git a/atr/storage/__init__.py b/atr/storage/__init__.py
index 0be79bd..947b001 100644
--- a/atr/storage/__init__.py
+++ b/atr/storage/__init__.py
@@ -138,6 +138,7 @@ class WriteAsGeneralPublic(WriteAs):
self.keys = writers.keys.GeneralPublic(write, self, data)
self.ssh = writers.ssh.GeneralPublic(write, self, data)
self.tokens = writers.tokens.GeneralPublic(write, self, data)
+ self.vote = writers.vote.GeneralPublic(write, self, data)
class WriteAsFoundationCommitter(WriteAsGeneralPublic):
@@ -147,6 +148,7 @@ class WriteAsFoundationCommitter(WriteAsGeneralPublic):
self.keys = writers.keys.FoundationCommitter(write, self, data)
self.ssh = writers.ssh.FoundationCommitter(write, self, data)
self.tokens = writers.tokens.FoundationCommitter(write, self, data)
+ self.vote = writers.vote.FoundationCommitter(write, self, data)
class WriteAsCommitteeParticipant(WriteAsFoundationCommitter):
@@ -156,6 +158,7 @@ class
WriteAsCommitteeParticipant(WriteAsFoundationCommitter):
self.keys = writers.keys.CommitteeParticipant(write, self, data,
committee_name)
self.ssh = writers.ssh.CommitteeParticipant(write, self, data,
committee_name)
self.tokens = writers.tokens.CommitteeParticipant(write, self, data,
committee_name)
+ self.vote = writers.vote.CommitteeParticipant(write, self, data,
committee_name)
@property
def committee_name(self) -> str:
@@ -170,6 +173,7 @@ class WriteAsCommitteeMember(WriteAsCommitteeParticipant):
self.keys = writers.keys.CommitteeMember(write, self, data,
committee_name)
self.ssh = writers.ssh.CommitteeMember(write, self, data,
committee_name)
self.tokens = writers.tokens.CommitteeMember(write, self, data,
committee_name)
+ self.vote = writers.vote.CommitteeMember(write, self, data,
committee_name)
@property
def committee_name(self) -> str:
@@ -183,6 +187,7 @@ class WriteAsFoundationAdmin(WriteAsCommitteeMember):
self.keys = writers.keys.FoundationAdmin(write, self, data,
committee_name)
# self.ssh = writers.ssh.FoundationAdmin(write, self, data,
committee_name)
# self.tokens = writers.tokens.FoundationAdmin(write, self, data,
committee_name)
+ # self.vote = writers.vote.FoundationAdmin(write, self, data,
committee_name)
@property
def committee_name(self) -> str:
diff --git a/atr/storage/writers/__init__.py b/atr/storage/writers/__init__.py
index fd4caa3..64f9a0d 100644
--- a/atr/storage/writers/__init__.py
+++ b/atr/storage/writers/__init__.py
@@ -20,5 +20,6 @@ import atr.storage.writers.distributions as distributions
import atr.storage.writers.keys as keys
import atr.storage.writers.ssh as ssh
import atr.storage.writers.tokens as tokens
+import atr.storage.writers.vote as vote
-__all__ = ["checks", "distributions", "keys", "ssh", "tokens"]
+__all__ = ["checks", "distributions", "keys", "ssh", "tokens", "vote"]
diff --git a/atr/storage/writers/vote.py b/atr/storage/writers/vote.py
new file mode 100644
index 0000000..28c125d
--- /dev/null
+++ b/atr/storage/writers/vote.py
@@ -0,0 +1,85 @@
+# 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.
+
+# Removing this will cause circular imports
+from __future__ import annotations
+
+import atr.db as db
+import atr.storage as storage
+
+
+class GeneralPublic:
+ def __init__(
+ self,
+ write: storage.Write,
+ write_as: storage.WriteAsGeneralPublic,
+ data: db.Session,
+ ):
+ self.__write = write
+ self.__write_as = write_as
+ self.__data = data
+ self.__asf_uid = write.authorisation.asf_uid
+
+
+class FoundationCommitter(GeneralPublic):
+ def __init__(self, write: storage.Write, write_as:
storage.WriteAsFoundationCommitter, data: db.Session):
+ super().__init__(write, write_as, data)
+ self.__write = write
+ self.__write_as = write_as
+ self.__data = data
+ asf_uid = write.authorisation.asf_uid
+ if asf_uid is None:
+ raise storage.AccessError("No ASF UID")
+ self.__asf_uid = asf_uid
+
+
+class CommitteeParticipant(FoundationCommitter):
+ def __init__(
+ self,
+ write: storage.Write,
+ write_as: storage.WriteAsCommitteeParticipant,
+ data: db.Session,
+ committee_name: str,
+ ):
+ super().__init__(write, write_as, data)
+ self.__write = write
+ self.__write_as = write_as
+ self.__data = data
+ asf_uid = write.authorisation.asf_uid
+ if asf_uid is None:
+ raise storage.AccessError("No ASF UID")
+ self.__asf_uid = asf_uid
+ self.__committee_name = committee_name
+
+
+class CommitteeMember(CommitteeParticipant):
+ def __init__(
+ self,
+ write: storage.Write,
+ write_as: storage.WriteAsCommitteeMember,
+ data: db.Session,
+ committee_name: str,
+ ):
+ super().__init__(write, write_as, data, committee_name)
+ self.__write = write
+ self.__write_as = write_as
+ self.__data = data
+ asf_uid = write.authorisation.asf_uid
+ if asf_uid is None:
+ raise storage.AccessError("No ASF UID")
+ self.__asf_uid = asf_uid
+ self.__committee_name = committee_name
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]