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 79bc5d5 Add a model for ignoring check results
79bc5d5 is described below
commit 79bc5d545e2c60b2be1445e3dbdd2619f90706a0
Author: Sean B. Palmer <[email protected]>
AuthorDate: Tue Jul 29 19:13:52 2025 +0100
Add a model for ignoring check results
---
atr/models/sql.py | 26 ++++++++++++++++
migrations/versions/0017_2025.07.29_a880eb40.py | 41 +++++++++++++++++++++++++
2 files changed, 67 insertions(+)
diff --git a/atr/models/sql.py b/atr/models/sql.py
index 4a1ccc8..cf52bf0 100644
--- a/atr/models/sql.py
+++ b/atr/models/sql.py
@@ -58,6 +58,12 @@ class CheckResultStatus(str, enum.Enum):
WARNING = "warning"
+class CheckResultStatusIgnore(str, enum.Enum):
+ EXCEPTION = "exception"
+ FAILURE = "failure"
+ WARNING = "warning"
+
+
class ProjectStatus(str, enum.Enum):
ACTIVE = "active"
DORMANT = "dormant"
@@ -712,6 +718,26 @@ class CheckResult(sqlmodel.SQLModel, table=True):
)
+class CheckResultIgnore(sqlmodel.SQLModel, table=True):
+ id: int = sqlmodel.Field(default=None, primary_key=True, **example(123))
+ asf_uid: str = sqlmodel.Field(**example("user"))
+ created: datetime.datetime = sqlmodel.Field(
+ sa_column=sqlalchemy.Column(UTCDateTime),
+ **example(datetime.datetime(2025, 5, 1, 1, 2, 3, tzinfo=datetime.UTC)),
+ )
+ committee_name: str = sqlmodel.Field(**example("example"))
+ release_glob: str | None = sqlmodel.Field(**example("example-0.0.*"))
+ revision_number: str | None = sqlmodel.Field(**example("00001"))
+ checker_glob: str | None =
sqlmodel.Field(**example("atr.tasks.checks.license.files"))
+ primary_rel_path_glob: str | None =
sqlmodel.Field(**example("apache-example-0.0.1-*.tar.gz"))
+ member_rel_path_glob: str | None =
sqlmodel.Field(**example("apache-example-0.0.1/*.xml"))
+ status: CheckResultStatusIgnore | None = sqlmodel.Field(
+ default=CheckResultStatusIgnore.FAILURE,
+ **example(CheckResultStatusIgnore.FAILURE),
+ )
+ message_glob: str | None = sqlmodel.Field(**example("sha512 matches for
apache-example-0.0.1/*.xml"))
+
+
# DistributionChannel: Project
class DistributionChannel(sqlmodel.SQLModel, table=True):
id: int = sqlmodel.Field(default=None, primary_key=True)
diff --git a/migrations/versions/0017_2025.07.29_a880eb40.py
b/migrations/versions/0017_2025.07.29_a880eb40.py
new file mode 100644
index 0000000..de3447d
--- /dev/null
+++ b/migrations/versions/0017_2025.07.29_a880eb40.py
@@ -0,0 +1,41 @@
+"""Add CheckResultIgnore
+
+Revision ID: 0017_2025.07.29_a880eb40
+Revises: 0016_2025.07.24_07af24db
+Create Date: 2025-07-29 18:10:30.462421+00:00
+"""
+
+from collections.abc import Sequence
+
+import sqlalchemy as sa
+from alembic import op
+
+import atr.models.sql
+
+# Revision identifiers, used by Alembic
+revision: str = "0017_2025.07.29_a880eb40"
+down_revision: str | None = "0016_2025.07.24_07af24db"
+branch_labels: str | Sequence[str] | None = None
+depends_on: str | Sequence[str] | None = None
+
+
+def upgrade() -> None:
+ op.create_table(
+ "checkresultignore",
+ sa.Column("id", sa.Integer(), nullable=False),
+ sa.Column("asf_uid", sa.String(), nullable=False),
+ sa.Column("created", atr.models.sql.UTCDateTime(timezone=True),
nullable=True),
+ sa.Column("committee_name", sa.String(), nullable=False),
+ sa.Column("release_glob", sa.String(), nullable=True),
+ sa.Column("revision_number", sa.String(), nullable=True),
+ sa.Column("checker_glob", sa.String(), nullable=True),
+ sa.Column("primary_rel_path_glob", sa.String(), nullable=True),
+ sa.Column("member_rel_path_glob", sa.String(), nullable=True),
+ sa.Column("status", sa.Enum("EXCEPTION", "FAILURE", "WARNING",
name="checkresultstatusignore"), nullable=True),
+ sa.Column("message_glob", sa.String(), nullable=True),
+ sa.PrimaryKeyConstraint("id", name=op.f("pk_checkresultignore")),
+ )
+
+
+def downgrade() -> None:
+ op.drop_table("checkresultignore")
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]