diff --git a/.github/workflows/verify-pr-prefix.yml b/.github/workflows/verify-pr-prefix.yml index d446b1ddb2..fc47fd2375 100644 --- a/.github/workflows/verify-pr-prefix.yml +++ b/.github/workflows/verify-pr-prefix.yml @@ -20,7 +20,12 @@ jobs: with: fetch-depth: 0 + - name: Dump commit message to file + run: | + git fetch origin ${{ github.event.pull_request.head.sha }} + git log -1 --pretty=format:"%B" ${{ github.event.pull_request.head.sha }} | head -n1 > commit-message-file + - name: Run commit message check id: prefixcheck run: | - ./scripts/check-role-prefix.sh + ./scripts/check-role-prefix.sh commit-message-file diff --git a/roles/kustomize_deploy/README.md b/roles/kustomize_deploy/README.md index 0cd373b7a8..c94068e09a 100644 --- a/roles/kustomize_deploy/README.md +++ b/roles/kustomize_deploy/README.md @@ -101,6 +101,7 @@ with a message. Some tasks uses timeouts when applying or waiting for resources. Those timeouts can be controlled by: * `cifmw_kustomize_deploy_delay`: (Int) Ansible `delay` passed to tasks that waits for a resource to reach a target state (default `10`) +* `cifmw_kustomize_deploy_retries_subscription`: (Int) Ansible `retries` passed to tasks that wait for the Subscription (default `90`) * `cifmw_kustomize_deploy_retries_install_plan`: (Int) Ansible `retries` passed to tasks that wait for the InstallPlan (default `60`) ### Task tagging diff --git a/roles/kustomize_deploy/defaults/main.yml b/roles/kustomize_deploy/defaults/main.yml index 8b42ff26d0..653c4440c9 100644 --- a/roles/kustomize_deploy/defaults/main.yml +++ b/roles/kustomize_deploy/defaults/main.yml @@ -222,6 +222,7 @@ cifmw_kustomize_deploy_dp_dest_file: >- # timeouts and retry configuration cifmw_kustomize_deploy_delay: 10 +cifmw_kustomize_deploy_retries_subscription: 90 cifmw_kustomize_deploy_retries_install_plan: 60 # Default retry settings for k8s_info operations to handle transient auth failures diff --git a/roles/kustomize_deploy/tasks/install_operators.yml b/roles/kustomize_deploy/tasks/install_operators.yml index fcf3650b4a..d4a76c7367 100644 --- a/roles/kustomize_deploy/tasks/install_operators.yml +++ b/roles/kustomize_deploy/tasks/install_operators.yml @@ -91,9 +91,9 @@ src: "{{ cifmw_kustomize_deploy_olm_dest_file }}" register: _cifmw_kustomize_deploy_olm_apply_out - - name: Wait for the openstack operators InstallPlan to be created + - name: Wait for the openstack operators Subscription to be created vars: - _cifmw_kustomize_deploy_olm_osp_operator_sub: >- + _cifmw_kustomize_deploy_olm_osp_operator_subscription: >- {{ ( _cifmw_kustomize_deploy_olm_apply_out.result.results | @@ -108,18 +108,18 @@ kubeconfig: "{{ cifmw_openshift_kubeconfig }}" api_key: "{{ cifmw_openshift_token | default(omit) }}" context: "{{ cifmw_openshift_context | default(omit) }}" - api_version: "{{ _cifmw_kustomize_deploy_olm_osp_operator_sub.apiVersion }}" + api_version: "{{ _cifmw_kustomize_deploy_olm_osp_operator_subscription.apiVersion }}" kind: Subscription - namespace: "{{ _cifmw_kustomize_deploy_olm_osp_operator_sub.metadata.namespace }}" - name: "{{ _cifmw_kustomize_deploy_olm_osp_operator_sub.metadata.name }}" - register: _cifmw_kustomize_deploy_olm_osp_operator_sub_out - retries: "{{ cifmw_kustomize_deploy_retries_install_plan }}" + namespace: "{{ _cifmw_kustomize_deploy_olm_osp_operator_subscription.metadata.namespace }}" + name: "{{ _cifmw_kustomize_deploy_olm_osp_operator_subscription.metadata.name }}" + register: _cifmw_kustomize_deploy_olm_osp_operator_subscription_out + retries: "{{ cifmw_kustomize_deploy_retries_subscription }}" delay: "{{ cifmw_kustomize_deploy_delay }}" until: - - _cifmw_kustomize_deploy_olm_osp_operator_sub_out.failed is false - - _cifmw_kustomize_deploy_olm_osp_operator_sub_out.resources is defined - - _cifmw_kustomize_deploy_olm_osp_operator_sub_out.resources | length == 1 - - (_cifmw_kustomize_deploy_olm_osp_operator_sub_out.resources | first)['status']['installPlanRef'] is defined + - _cifmw_kustomize_deploy_olm_osp_operator_subscription_out.failed is false + - _cifmw_kustomize_deploy_olm_osp_operator_subscription_out.resources is defined + - _cifmw_kustomize_deploy_olm_osp_operator_subscription_out.resources | length == 1 + - (_cifmw_kustomize_deploy_olm_osp_operator_subscription_out.resources | first)['status']['installPlanRef'] is defined - name: Install plan ansible.builtin.include_tasks: install_plan.yml @@ -131,7 +131,7 @@ vars: _install_plan: >- {{ - (_cifmw_kustomize_deploy_olm_osp_operator_sub_out.resources | first).status.installPlanRef + (_cifmw_kustomize_deploy_olm_osp_operator_subscription_out.resources | first).status.installPlanRef }} kubernetes.core.k8s_info: kubeconfig: "{{ cifmw_openshift_kubeconfig }}" diff --git a/scripts/check-role-prefix.sh b/scripts/check-role-prefix.sh index 73e5a8dea3..b530177e2c 100755 --- a/scripts/check-role-prefix.sh +++ b/scripts/check-role-prefix.sh @@ -1,8 +1,16 @@ #!/bin/bash # Get the latest commit message file -TMP_MSG_FILE=$(mktemp) -git log -1 --pretty=format:"%s%n%n%b" >"$TMP_MSG_FILE" +TMP_MSG_FILE="$1" + +echo "Checking file $TMP_MSG_FILE" +cat $TMP_MSG_FILE + +if [ -z "$TMP_MSG_FILE" ]; then + echo "now here" + TMP_MSG_FILE=$(mktemp) + git log -1 --pretty=format:"%B" | head -n1 +fi echo "Checking latest commit message:" cat "$TMP_MSG_FILE" diff --git a/scripts/git-check-commit-body-length.sh b/scripts/git-check-commit-body-length.sh index 2ce9e64ea9..656806a9a1 100755 --- a/scripts/git-check-commit-body-length.sh +++ b/scripts/git-check-commit-body-length.sh @@ -20,7 +20,7 @@ FAIL_LENGTH=0 FAIL_SIGNED_OFF_BY=0 BODY=$(tail -n +3 "$MSG_FILE" | sed '/^\s*#/d' | sed '/^\s*$/d') -BODY_LEN=$(echo -n "$BODY" | wc -m) +BODY_LEN=$(echo -n "$BODY" | sed '/Signed-off-by:/d' | wc -m) if [ "$BODY_LEN" -lt "$MIN_BODY_LEN" ]; then echo -e "\n\n**WARNING: Commit message body is too short (has $BODY_LEN chars, minimum $MIN_BODY_LEN required).**\n" >&2