Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/sdk-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
GO_VERSION: "1.22"
JAVA_VERSION: "11"
JAVA_VERSION: "25"

jobs:
main-go:
Expand Down
17 changes: 16 additions & 1 deletion scripts/download-oas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,22 @@ EOF
fi
cd ${work_dir}/${OAS_REPO_NAME} >/dev/null
git checkout -q $apiVersion || (echo "version ${apiVersion} does not exist, using main instead" && git checkout -q main)
echo "$service=$(git rev-parse HEAD)" >> oas_commits

# write commit hash to oas_commits file, normalize name first to match service name in sdk-create-pr.sh, normalization
# occurs in go/java/python.sh when creating the SDK modules
service_normalized=${service}
service_normalized="${service_normalized//-/}" # remove dashes
service_normalized="${service_normalized// /}" # remove empty spaces
service_normalized="${service_normalized//_/}" # remove underscores
service_normalized=$(echo "${service_normalized}" | tr '[:upper:]' '[:lower:]') # convert upper case letters to lower case
service_normalized=$(echo "${service_normalized}" | tr -d -c '[:alnum:]') # remove non-alphanumeric characters
echo "$service_normalized=$(git rev-parse HEAD)" >> oas_commits
# To support initial integrations of the IaaS API in an Alpha state, we will temporarily use it to generate an IaaS Alpha SDK module
# This check can be removed once the IaaS API moves all endpoints to Beta
if [[ ${service_normalized} == "iaas" ]]; then
echo "iaasalpha=$(git rev-parse HEAD)" >> oas_commits
fi

cd - >/dev/null

# Prioritize GA over Beta over Alpha versions
Expand Down
14 changes: 12 additions & 2 deletions scripts/sdk-create-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,21 @@ for service_path in ${work_dir}/sdk_to_push/services/*; do
fi

# write OAS commit hash of service into source tree, create compare link
old_commit=$(cat "services/${service}/oas_commit")
new_commit=$(grep "${service}=" "${ROOT_DIR}/oas/oas_commits" | cut -d = -f 2)
echo ">> Updating OAS commit for $service"
old_commit=""
if [[ -f "services/${service}/oas_commit" ]]; then
old_commit=$(cat "services/${service}/oas_commit")
echo "old commit: ${old_commit}"
fi
new_commit=""
if [[ -f "${ROOT_DIR}/oas/oas_commits" ]]; then
new_commit=$(grep "${service}=" "${ROOT_DIR}/oas/oas_commits" | cut -d = -f 2)
echo "new commit: ${new_commit}"
fi
compare_link=""
if [[ -n "${old_commit}" ]] && [[ -n "${new_commit}" ]]; then
compare_link=https://github.com/stackitcloud/stackit-api-specifications/compare/${old_commit}...${new_commit}
echo "compare link: ${compare_link}"
fi
if [[ -n "${new_commit}" ]]; then
echo "${new_commit}" > "services/${service}/oas_commit"
Expand Down
Loading