commit 2532ff75fe2a33a1784e450b3abfe11cec1c53d0
parent 1042b9d1b7fb654d1968fa74655f768d5cee33b6
Author: Jean Schurger <jean@schurger.org>
Date: Fri, 13 Nov 2026 16:35:00 -0500
fastlane: invite lane (External group, beta review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K7deYGSNhtY1AmBH7DQGNs
Diffstat:
1 file changed, 50 insertions(+), 0 deletions(-)
diff --git a/fastlane/Fastfile b/fastlane/Fastfile
@@ -102,6 +102,56 @@ platform :ios do
upload_to_testflight(api_key: api_key, ipa: File.expand_path("../build_output/OpenMerou.ipa"), skip_waiting_for_build_processing: true)
end
+ desc "Invite un testeur externe (email:...) : groupe « Externes », dernière build attachée, revue bêta"
+ lane :invite do |opts|
+ api_key
+ email = opts[:email] or UI.user_error!("email: manquant")
+ app = Spaceship::ConnectAPI::App.find(APP_ID)
+ err = ->(r) { (r["errors"] || []).map { |e| e["detail"] }.join(" ; ") }
+
+ # Infos de revue bêta : reprises de Sonodrill (même compte) si elles manquent ici.
+ _, mine = asc(:get, "/v1/betaAppReviewDetails/#{app.id}")
+ attrs = mine.dig("data", "attributes") || {}
+ if attrs["contactEmail"].to_s.empty?
+ sono = Spaceship::ConnectAPI::App.find("org.schurger.sonodrill")
+ _, src = asc(:get, "/v1/betaAppReviewDetails/#{sono.id}")
+ a = src.dig("data", "attributes") || {}
+ body = { data: { type: "betaAppReviewDetails", id: app.id, attributes: {
+ contactFirstName: a["contactFirstName"], contactLastName: a["contactLastName"],
+ contactEmail: a["contactEmail"], contactPhone: a["contactPhone"], demoAccountRequired: false,
+ notes: "No account needed. The app controls a Bluetooth dive housing; without one, tap 'Simulate a housing' on the first screen to try every feature with on-screen housing buttons." } } }
+ c, r = asc(:patch, "/v1/betaAppReviewDetails/#{app.id}", body)
+ UI.message("REVUE BETA infos -> #{c} #{err.(r)}")
+ end
+
+ _, groups = asc(:get, "/v1/apps/#{app.id}/betaGroups")
+ group = groups["data"].find { |g| g["attributes"]["name"] == "Externes" }
+ unless group
+ c, r = asc(:post, "/v1/betaGroups", { data: { type: "betaGroups", attributes: { name: "Externes" },
+ relationships: { app: { data: { type: "apps", id: app.id } } } } })
+ UI.message("GROUPE Externes -> #{c} #{err.(r)}")
+ group = r["data"]
+ end
+
+ _, testers = asc(:get, "/v1/betaTesters?filter[email]=#{email}&filter[apps]=#{app.id}")
+ if testers["data"].empty?
+ c, r = asc(:post, "/v1/betaTesters", { data: { type: "betaTesters", attributes: { email: email },
+ relationships: { betaGroups: { data: [{ type: "betaGroups", id: group["id"] }] } } } })
+ UI.message("TESTEUR #{email} -> #{c} #{err.(r)}")
+ else
+ c, r = asc(:post, "/v1/betaGroups/#{group["id"]}/relationships/betaTesters", { data: [{ type: "betaTesters", id: testers["data"][0]["id"] }] })
+ UI.message("TESTEUR #{email} déjà connu, ajouté au groupe -> #{c} #{err.(r)}")
+ end
+
+ _, builds = asc(:get, "/v1/builds?filter[app]=#{app.id}&sort=-uploadedDate&limit=1")
+ build = builds["data"].first or UI.user_error!("aucune build")
+ c, r = asc(:post, "/v1/betaGroups/#{group["id"]}/relationships/builds", { data: [{ type: "builds", id: build["id"] }] })
+ UI.message("BUILD #{build["attributes"]["version"]} dans Externes -> #{c} #{err.(r)}")
+ c, r = asc(:post, "/v1/betaAppReviewSubmissions", { data: { type: "betaAppReviewSubmissions",
+ relationships: { build: { data: { type: "builds", id: build["id"] } } } } })
+ UI.message("SOUMISSION revue bêta -> #{c} #{err.(r)}")
+ end
+
desc "TestFlight : groupe interne « Interne » (toutes les builds) avec Jean, textes bêta fr/en, « À tester » de la dernière build"
lane :beta_setup do
api_key