From 75f4e8ab2e07407ff7b3c6da8594d1389209557d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Mar 2026 02:41:48 +0000 Subject: [PATCH 1/3] Fix Arcane API response parsing to unwrap .data field The Arcane API wraps all responses in {success, data, pagination} but the action was parsing responses as raw arrays/objects. This caused repository lookup to always miss (creating duplicates) and ID extraction from create responses to fail. - List endpoints: use .data[] instead of .[] to iterate items - Create endpoints: use .data.id instead of .id to extract IDs https://claude.ai/code/session_01EPuZkcSGc4zpbDDBvMd3Jz --- .github/actions/arcane-deploy/action.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/arcane-deploy/action.sh b/.github/actions/arcane-deploy/action.sh index 1a4a99e..e2a7f42 100755 --- a/.github/actions/arcane-deploy/action.sh +++ b/.github/actions/arcane-deploy/action.sh @@ -206,7 +206,7 @@ ensure_repository() { REPOSITORY_ID=$(echo "${repos}" | jq -r \ --arg url "${REPO_URL}" \ - '[.[] | select(.url == $url)] | first // empty | .id') + '[.data[] | select(.url == $url)] | first // empty | .id') if [[ -n "${REPOSITORY_ID}" && "${REPOSITORY_ID}" != "null" ]]; then log_info "Found existing repository: ${REPOSITORY_ID}" @@ -267,7 +267,7 @@ ensure_repository() { result=$(arcane_api POST "/customize/git-repositories" -d "${create_payload}") # [H7] Validate the response contains a real ID - REPOSITORY_ID=$(jq_extract_id "${result}" '.id' "create repository") + REPOSITORY_ID=$(jq_extract_id "${result}" '.data.id' "create repository") log_info "Created repository: ${REPOSITORY_ID}" fi @@ -286,7 +286,7 @@ upsert_sync() { existing_id=$(echo "${existing_syncs}" | jq -r \ --arg composePath "${compose_path}" \ --arg repoId "${REPOSITORY_ID}" \ - '[.[] | select(.composePath == $composePath and .repositoryId == $repoId)] | first // empty | .id') + '[.data[] | select(.composePath == $composePath and .repositoryId == $repoId)] | first // empty | .id') local sync_id if [[ -n "${existing_id}" && "${existing_id}" != "null" ]]; then @@ -338,7 +338,7 @@ upsert_sync() { result=$(arcane_api POST "/environments/${ENV_ID}/gitops-syncs" -d "${create_payload}") # [H7] Validate the response contains a real ID - sync_id=$(jq_extract_id "${result}" '.id' "create sync '${sync_name}'") + sync_id=$(jq_extract_id "${result}" '.data.id' "create sync '${sync_name}'") log_info " Created sync: ${sync_id}" SYNCS_CREATED=$((SYNCS_CREATED + 1)) From f14030c6a20150b69e81aed021bb996d35e42b62 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Mar 2026 02:48:58 +0000 Subject: [PATCH 2/3] Increase API timeout to 360s for sync-heavy operations The Arcane server performs an initial git sync inline during POST /gitops-syncs (cloning the repo and deploying the compose file). The server-side timeout for this is 5 minutes, but the curl --max-time was only 30 seconds, causing the request to time out before the sync could complete. https://claude.ai/code/session_01EPuZkcSGc4zpbDDBvMd3Jz --- .github/actions/arcane-deploy/action.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/arcane-deploy/action.sh b/.github/actions/arcane-deploy/action.sh index e2a7f42..5bc8241 100755 --- a/.github/actions/arcane-deploy/action.sh +++ b/.github/actions/arcane-deploy/action.sh @@ -82,7 +82,7 @@ arcane_api() { local http_code # [H2] Capture curl exit code separately to detect transport failures http_code=$(curl -s -w "%{http_code}" \ - --max-time 30 --connect-timeout 10 \ + --max-time 360 --connect-timeout 10 \ -X "${method}" \ -H "X-Api-Key: ${API_KEY}" \ -H "Content-Type: application/json" \ From fa718b24ed744b943dd457d1b8a4779069bf1b6b Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Mar 2026 02:57:00 +0000 Subject: [PATCH 3/3] Ensure git repository is enabled when updating credentials When updating an existing repository's credentials, the action was not setting enabled: true. If the repo was disabled in Arcane, it would stay disabled and syncs would not work. https://claude.ai/code/session_01EPuZkcSGc4zpbDDBvMd3Jz --- .github/actions/arcane-deploy/action.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/arcane-deploy/action.sh b/.github/actions/arcane-deploy/action.sh index 5bc8241..7769b52 100755 --- a/.github/actions/arcane-deploy/action.sh +++ b/.github/actions/arcane-deploy/action.sh @@ -216,7 +216,7 @@ ensure_repository() { local update_payload update_payload=$(jq -n \ --arg token "${GIT_TOKEN}" \ - '{token: $token}') + '{token: $token, enabled: true}') arcane_api PUT "/customize/git-repositories/${REPOSITORY_ID}" \ -d "${update_payload}" > /dev/null @@ -229,7 +229,7 @@ ensure_repository() { --arg sshKey "${SSH_PRIVATE_KEY}" \ --arg username "git" \ --arg sshHostKeyVerification "${SSH_HOST_KEY_VERIFICATION}" \ - '{sshKey: $sshKey, username: $username, sshHostKeyVerification: $sshHostKeyVerification}') + '{sshKey: $sshKey, username: $username, sshHostKeyVerification: $sshHostKeyVerification, enabled: true}') arcane_api PUT "/customize/git-repositories/${REPOSITORY_ID}" \ -d "${update_payload}" > /dev/null