From 5453a616892608bb987ddd11c8ba7856e7107d3a Mon Sep 17 00:00:00 2001 From: Alexey Snigir <35569332+l0uden@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:08:58 +0100 Subject: [PATCH] Fix running status in circleci failed the tests (#255) --- .circleci/config.yml | 28 +++++++++-- .github/workflows/release-if-needed.yml | 5 +- ...111254_alexey_snigir_fix_running_status.md | 48 +++++++++++++++++++ 3 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 vizro-core/changelog.d/20240109_111254_alexey_snigir_fix_running_status.md diff --git a/.circleci/config.yml b/.circleci/config.yml index 628ea7a5e..a57b91d68 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,12 +57,30 @@ jobs: echo $created_workflow_status - if [[ "$created_workflow_status" != "success" ]]; then - echo "Workflow not successful - ${created_workflow_status}" - (exit -1) - fi + if [[ "$created_workflow_status" == "running" ]]; then + created_workflow_status_updated=$(curl --request GET \ + --url "https://circleci.com/api/v2/pipeline/${triggered_pipeline_id}/workflow" \ + --header "Circle-Token: $CIRCLECI_API_KEY" \ + --header "content-type: application/json" \ + | jq -r '.items[0].status' + ) + while [[ "$created_workflow_status_updated" == "running" ]] + do + created_workflow_status_updated=$(curl --request GET \ + --url "https://circleci.com/api/v2/pipeline/${triggered_pipeline_id}/workflow" \ + --header "Circle-Token: $CIRCLECI_API_KEY" \ + --header "content-type: application/json" \ + | jq -r '.items[0].status' + ) + done + + if [[ "$created_workflow_status_updated" != "success" ]]; then + echo "Workflow not successful - ${created_workflow_status_updated}" + (exit -1) + fi - echo "Created workflow successful" + echo "Created workflow successful" + fi workflows: version: 2 diff --git a/.github/workflows/release-if-needed.yml b/.github/workflows/release-if-needed.yml index 9faf29dc3..d2784af4f 100644 --- a/.github/workflows/release-if-needed.yml +++ b/.github/workflows/release-if-needed.yml @@ -35,7 +35,8 @@ jobs: echo "package_version=${{ env.PACKAGE_VERSION }}" >> $GITHUB_OUTPUT if [ "${{ env.PACKAGE_NAME }}" == "vizro-ai" ]; then echo "dist_package_name=vizro_ai" >> $GITHUB_OUTPUT - else echo "dist_package_name=${{ env.PACKAGE_NAME }}" >> $GITHUB_OUTPUT + elif [ "${{ env.PACKAGE_NAME }}" == "vizro-core" ]; then + echo "dist_package_name=vizro" >> $GITHUB_OUTPUT fi outputs: new_release: ${{ steps.version_check.outputs.new_release }} @@ -92,7 +93,7 @@ jobs: cd "${{ needs.check-version.outputs.package_name }}/dist" local=$(md5sum ${{ needs.check-version.outputs.dist_package_name }}-${{ needs.check-version.outputs.package_version }}-py3-none-any.whl) cd .. - pip download ${{ needs.check-version.outputs.package_name }}==${{ needs.check-version.outputs.package_version }} -d . --no-deps --timeout 300 + pip download ${{ needs.check-version.outputs.dist_package_name }}==${{ needs.check-version.outputs.package_version }} -d . --no-deps --timeout 300 pypi=$(md5sum ${{ needs.check-version.outputs.dist_package_name }}-${{ needs.check-version.outputs.package_version }}-py3-none-any.whl) if [[ $local = $pypi ]]; then echo "md5 hash is the same"; else echo "md5 hash is not the same"; exit 1; fi diff --git a/vizro-core/changelog.d/20240109_111254_alexey_snigir_fix_running_status.md b/vizro-core/changelog.d/20240109_111254_alexey_snigir_fix_running_status.md new file mode 100644 index 000000000..f1f65e73c --- /dev/null +++ b/vizro-core/changelog.d/20240109_111254_alexey_snigir_fix_running_status.md @@ -0,0 +1,48 @@ + + + + + + + + +