From a3214e9bfd8b7adf1a9074572c45ed7149a702a4 Mon Sep 17 00:00:00 2001 From: "denis.bilenko" Date: Tue, 3 Nov 2026 15:28:25 +0000 Subject: [PATCH] acc: match PROD_ROOT_DIR_ID with a regex in default-python/classic The script looked up the prod root directory's object id and registered it as a literal replacement. Match it by its position in the permissions path instead; this drops the extra get-status call and the jq/python workaround. Co-authored-by: Isaac --- acceptance/bundle/templates/default-python/classic/script | 3 --- acceptance/bundle/templates/default-python/classic/test.toml | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/acceptance/bundle/templates/default-python/classic/script b/acceptance/bundle/templates/default-python/classic/script index 3029c012d05..a1227e1fb0d 100644 --- a/acceptance/bundle/templates/default-python/classic/script +++ b/acceptance/bundle/templates/default-python/classic/script @@ -21,9 +21,6 @@ trace $CLI bundle plan -t dev -o json | nostamp > ../../out.plan_after_deploy_de $CLI bundle deploy -t prod $(readplanarg ../../out.plan_prod.json) 2>&1 | grep -vE '^Building python_artifact|^Uploading dist' print_requests.py --sort '^//import-file/' '^//telemetry-ext' > ../../out.requests.prod.txt read_id.py -t prod sample_job > /dev/null -# Extracted with python, not jq: the id exceeds 2^53 and jq 1.6 rounds it. -root_dir_id=$(MSYS_NO_PATHCONV=1 $CLI workspace get-status "/Workspace/Users/${CURRENT_USER_NAME}/.bundle/my_default_python/prod" -o json | python3 -c 'import sys, json; print(json.load(sys.stdin)["object_id"])') -add_repl "$root_dir_id" PROD_ROOT_DIR_ID trace $CLI bundle plan -t prod # check if there is drift trace $CLI bundle plan -t prod -o json | nostamp > ../../out.plan_after_deploy_prod.json diff --git a/acceptance/bundle/templates/default-python/classic/test.toml b/acceptance/bundle/templates/default-python/classic/test.toml index 68f298aca3d..5252e07b369 100644 --- a/acceptance/bundle/templates/default-python/classic/test.toml +++ b/acceptance/bundle/templates/default-python/classic/test.toml @@ -1,3 +1,8 @@ Phase = 1 RecordRequests = true EnvMatrix.READPLAN = ["", "1"] + +[[Repls]] +# The prod deploy sets permissions on its root directory, addressed by workspace object id. +Old = '/permissions/directories/\d+' +New = '/permissions/directories/[PROD_ROOT_DIR_ID]'