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-atr-experiments.git

commit 3ccd863b2585d1a1240240a87322d9735aeadfad
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Feb 28 19:10:42 2025 +0200

    Move where certificates are made in the containers
---
 Dockerfile.alpine |  5 +++--
 Dockerfile.ubuntu |  5 +++--
 atr/routes.py     | 14 +++++++-------
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/Dockerfile.alpine b/Dockerfile.alpine
index 3be1aa0..b808115 100644
--- a/Dockerfile.alpine
+++ b/Dockerfile.alpine
@@ -44,11 +44,12 @@ RUN curl -sSfL 
https://raw.githubusercontent.com/anchore/syft/main/install.sh |
 RUN sed -i "s%ATR-VERSION%${VERSION}%" atr/templates/includes/footer.html
 RUN rm -rf .venv-*
 RUN make sync PYTHON="$(which python3)"
-RUN make certs
 EXPOSE 8080
 
 RUN printf '#!/bin/sh\n\
-mkdir -p /opt/atr/state\n\
+cd /opt/atr\n\
+test -d /opt/atr/state || mkdir -p /opt/atr/state\n\
+make certs\n\
 cp /tmp/apache-rat/apache-rat-0.16.1.jar /opt/atr/state/\n\
 echo "Copied Apache RAT JAR to state directory:"\n\
 ls -la /opt/atr/state/apache-rat-0.16.1.jar\n\
diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu
index b7b2113..f122f07 100644
--- a/Dockerfile.ubuntu
+++ b/Dockerfile.ubuntu
@@ -42,11 +42,12 @@ COPY . /opt/atr
 RUN sed -i "s%ATR-VERSION%${VERSION}%" atr/templates/includes/footer.html
 RUN rm -rf .venv-*
 RUN make sync PYTHON="$(find /usr/bin -name python3.13 | head -n 1)"
-RUN make certs
 EXPOSE 8080
 
 RUN printf '#!/bin/sh\n\
-mkdir -p /opt/atr/state\n\
+cd /opt/atr\n\
+test -d /opt/atr/state || mkdir -p /opt/atr/state\n\
+make certs\n\
 cp /tmp/apache-rat/apache-rat-0.16.1.jar /opt/atr/state/\n\
 echo "Copied Apache RAT JAR to state directory:"\n\
 ls -la /opt/atr/state/apache-rat-0.16.1.jar\n\
diff --git a/atr/routes.py b/atr/routes.py
index 0de77ae..c8decfb 100644
--- a/atr/routes.py
+++ b/atr/routes.py
@@ -678,10 +678,10 @@ async def package_add_validate(
 async def package_data_get(db_session: AsyncSession, artifact_sha3: str, 
release_key: str, session_uid: str) -> Package:
     """Validate package deletion request and return the package if valid."""
     # Get the package and its associated release
-    if Package.release is None:
-        raise FlashError("Package has no associated release")
-    if Release.pmc is None:
-        raise FlashError("Release has no associated PMC")
+    # if Package.release is None:
+    #     raise FlashError("Package has no associated release")
+    # if Release.pmc is None:
+    #     raise FlashError("Release has no associated PMC")
 
     pkg_release = cast(InstrumentedAttribute[Release], Package.release)
     rel_pmc = cast(InstrumentedAttribute[PMC], Release.pmc)
@@ -794,8 +794,8 @@ async def release_add_post(session: ClientSession, request: 
Request) -> Response
 
 async def release_delete_validate(db_session: AsyncSession, release_key: str, 
session_uid: str) -> Release:
     """Validate release deletion request and return the release if valid."""
-    if Release.pmc is None:
-        raise FlashError("Release has no associated PMC")
+    # if Release.pmc is None:
+    #     raise FlashError("Release has no associated PMC")
 
     rel_pmc = cast(InstrumentedAttribute[PMC], Release.pmc)
     statement = 
select(Release).options(selectinload(rel_pmc)).where(Release.storage_key == 
release_key)
@@ -807,7 +807,7 @@ async def release_delete_validate(db_session: AsyncSession, 
release_key: str, se
 
     # Check permissions
     if release.pmc:
-        if session_uid not in release.pmc.pmc_members and session_uid not in 
release.pmc.committers:
+        if (session_uid not in release.pmc.pmc_members) and (session_uid not 
in release.pmc.committers):
             raise FlashError("You don't have permission to delete this 
release")
 
     return release


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

Reply via email to