From 5d3459e1129bb433d320c1fbd077658339843c04 Mon Sep 17 00:00:00 2001 From: Marcel Jacek Date: Fri, 10 Oct 2025 14:22:50 +0200 Subject: [PATCH 1/3] fix: skip linter and tests in create PR script - prevents unrecognized api changes because before no PR was created - if e.g. the waiter and the generated code aren't align anymore, no PR was created --- scripts/sdk-create-pr.sh | 41 ++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/scripts/sdk-create-pr.sh b/scripts/sdk-create-pr.sh index cbb3706..0556947 100755 --- a/scripts/sdk-create-pr.sh +++ b/scripts/sdk-create-pr.sh @@ -98,22 +98,27 @@ for service_path in ${work_dir}/sdk_to_push/services/*; do go work use -r . fi - # If lint or test fails for a service, we skip it and continue to the next one - make lint skip-non-generated-files=true service="$service" || { - echo "! Linting failed for $service. THE UPDATE OF THIS SERVICE WILL BE SKIPPED." - continue - } - # Our unit test template fails because it doesn't support fields with validations, - # such as the UUID component used by IaaS. We introduce this hardcoded skip until we fix it - if [ "${service}" = "iaas" ] || [ "${service}" = "iaasalpha" ]; then - echo ">> Skipping tests of $service service" - else - make test skip-non-generated-files=true service="$service" || { - echo "! Testing failed for $service. THE UPDATE OF THIS SERVICE WILL BE SKIPPED." + # If the target branch is main, we run the linter and tests in order to have code which can be compiled. + # If the target branch is not main, we skip the linter and tests, because in the create PRs the CI pipeline will check run them as well. + # This prevents unrecognized api changes, because we will see them within the PR itself. + if [[ "$branch" == "main" ]]; then + # If lint or test fails for a service, we skip it and continue to the next one + make lint skip-non-generated-files=true service="$service" || { + echo "! Linting failed for $service. THE UPDATE OF THIS SERVICE WILL BE SKIPPED." continue } + # Our unit test template fails because it doesn't support fields with validations, + # such as the UUID component used by IaaS. We introduce this hardcoded skip until we fix it + if [ "${service}" = "iaas" ] || [ "${service}" = "iaasalpha" ]; then + echo ">> Skipping tests of $service service" + else + make test skip-non-generated-files=true service="$service" || { + echo "! Testing failed for $service. THE UPDATE OF THIS SERVICE WILL BE SKIPPED." + continue + } + fi fi - + git add "services/${service}/" if [ "${LANGUAGE}" == "go" ] && [ ! -d "${work_dir}/sdk_backup/services/${service}/" ]; then # Check if it is a newly added SDK module git add go.work @@ -121,13 +126,13 @@ for service_path in ${work_dir}/sdk_to_push/services/*; do if [[ "$branch" != "main" ]]; then echo ">> Creating PR for $service" - git commit -m "Generate $service" - git push origin "$branch" - gh pr create --title "Generator: Update SDK /services/$service" --body "$COMMIT_INFO" --head "$branch" --base "main" + echo "git commit -m \"Generate $service\"" + echo "git push origin \"$branch\"" + echo 'gh pr create --title "Generator: Update SDK /services/$service" --body "$COMMIT_INFO" --head "$branch" --base "main"' else echo ">> Pushing changes for $service service..." - git commit -m "Generate $service: $COMMIT_INFO" - git push origin "$branch" + echo 'git commit -m "Generate $service: $COMMIT_INFO"' + echo 'git push origin "$branch"' fi fi done From a87b6e134e9fb3d4777b9047c0f3229e9cbd103a Mon Sep 17 00:00:00 2001 From: Marcel Jacek Date: Mon, 13 Oct 2025 10:25:41 +0200 Subject: [PATCH 2/3] Add step to remove waiters --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e9fa8d1..fc4174d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -70,6 +70,9 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION_BUILD }} + - name: Remove waiters + working-directory: ./sdk-repo-updated + run: rm -r services/*/wait - name: Lint working-directory: ./sdk-repo-updated run: make lint skip-non-generated-files=true From 29ae4cb349b697c980c3929499b747aa0ca9d294 Mon Sep 17 00:00:00 2001 From: Marcel Jacek Date: Mon, 13 Oct 2025 11:09:10 +0200 Subject: [PATCH 3/3] remove leftover from testing --- scripts/sdk-create-pr.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/sdk-create-pr.sh b/scripts/sdk-create-pr.sh index 0556947..54707d4 100755 --- a/scripts/sdk-create-pr.sh +++ b/scripts/sdk-create-pr.sh @@ -126,13 +126,13 @@ for service_path in ${work_dir}/sdk_to_push/services/*; do if [[ "$branch" != "main" ]]; then echo ">> Creating PR for $service" - echo "git commit -m \"Generate $service\"" - echo "git push origin \"$branch\"" - echo 'gh pr create --title "Generator: Update SDK /services/$service" --body "$COMMIT_INFO" --head "$branch" --base "main"' + git commit -m "Generate $service" + git push origin "$branch" + gh pr create --title "Generator: Update SDK /services/$service" --body "$COMMIT_INFO" --head "$branch" --base "main" else echo ">> Pushing changes for $service service..." - echo 'git commit -m "Generate $service: $COMMIT_INFO"' - echo 'git push origin "$branch"' + git commit -m "Generate $service: $COMMIT_INFO" + git push origin "$branch" fi fi done