You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2026/07/23 19:19:03 UTC

(airavata-custos) 31/35: Seed the tutorial PI as a pending non-personal identity

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

lahirujayathilake pushed a commit to branch pearc26
in repository https://gitbox.apache.org/repos/asf/airavata-custos.git

commit c7b083d7a91a8aea535b9b7a420fb449bcb97af8
Author: lahiruj <la...@gmail.com>
AuthorDate: Wed Jul 22 05:02:39 2026 -0400

    Seed the tutorial PI as a pending non-personal identity
---
 dev-ops/compose/seeds/pearc26/setup-live.sh | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/dev-ops/compose/seeds/pearc26/setup-live.sh b/dev-ops/compose/seeds/pearc26/setup-live.sh
index 25c6e2e42..e77784bca 100755
--- a/dev-ops/compose/seeds/pearc26/setup-live.sh
+++ b/dev-ops/compose/seeds/pearc26/setup-live.sh
@@ -111,9 +111,22 @@ if ! echo "$me" | grep -q "projects:write"; then
   exit 1
 fi
 
+echo "== Ensuring the tutorial PI identity"
+PI_EMAIL="${PEARC26_PI_EMAIL:-dev@airavata.apache.org}"
+PI_FIRST="${PEARC26_PI_FIRST:-Apache}"
+PI_LAST="${PEARC26_PI_LAST:-Airavata}"
+# Seed PENDING with no OIDC binding so that if this PI email belongs to a real
+# person, their first login links to this row by email and activates it. The
+# email must match the one their IdP asserts.
+"${DB_EXEC[@]}" -e "INSERT INTO users (id, organization_id, first_name, last_name, email, status) VALUES (UUID(), 'system', '$PI_FIRST', '$PI_LAST', '$PI_EMAIL', 'PENDING') ON DUPLICATE KEY UPDATE email=email;"
+PI_ID=$("${DB_EXEC[@]}" -N -e "SELECT id FROM users WHERE email='$PI_EMAIL' LIMIT 1;")
+[ -n "$PI_ID" ] || { echo "Could not resolve the tutorial PI user"; exit 1; }
+echo "  PI: $PI_FIRST $PI_LAST <$PI_EMAIL> ($PI_ID)"
+
 echo "== Creating project"
-# The authenticated admin is the PI: the seed approver has no login.
-project=$(capi POST /projects "{\"originated_id\":\"PEARC26\",\"title\":\"PEARC26 Tutorial Workshop\",\"origination\":\"pearc26\",\"project_pi_id\":\"$ADMIN_ID\",\"status\":\"ACTIVE\"}")
+# PI is a non-personal identity so no maintainer name shows on the tutorial;
+# the authenticated admin keeps governance through the PI membership below.
+project=$(capi POST /projects "{\"originated_id\":\"PEARC26\",\"title\":\"PEARC26 Tutorial Workshop\",\"origination\":\"pearc26\",\"project_pi_id\":\"$PI_ID\",\"status\":\"ACTIVE\"}")
 project_id=$(echo "$project" | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])")
 echo "  project $project_id"