From d6ab2d6622a0f607173ffcf39923643a221768ef Mon Sep 17 00:00:00 2001 From: Artjoms Iskovs Date: Mon, 20 Dec 2021 12:27:39 +0000 Subject: [PATCH 1/2] Fix wrong `RepositoryVisibility` usage --- splitgraph/cloud/__init__.py | 4 +--- test/splitgraph/commandline/http_fixtures.py | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/splitgraph/cloud/__init__.py b/splitgraph/cloud/__init__.py index 06849af7..b14adee2 100644 --- a/splitgraph/cloud/__init__.py +++ b/splitgraph/cloud/__init__.py @@ -998,9 +998,7 @@ def start_load_params( for tn, to in external.tables.items() ], "sync": sync, - "initialVisibility": ( - "RepositoryVisibility.PRIVATE" if initial_private else "RepositoryVisibility.PUBLIC" - ), + "initialVisibility": ("PRIVATE" if initial_private else "PUBLIC"), } if credential_data: diff --git a/test/splitgraph/commandline/http_fixtures.py b/test/splitgraph/commandline/http_fixtures.py index 9147b013..8bb2ede4 100644 --- a/test/splitgraph/commandline/http_fixtures.py +++ b/test/splitgraph/commandline/http_fixtures.py @@ -766,11 +766,7 @@ def _gql_callback(request, uri, response_headers): ], "sync": True, "credentialData": '{"username": "my_username", "password": "secret"}', - "initialVisibility": ( - "RepositoryVisibility.PRIVATE" - if initial_private - else "RepositoryVisibility.PUBLIC" - ), + "initialVisibility": ("PRIVATE" if initial_private else "PUBLIC"), } return [ 200, From 6db424161e23533a2def0146bfe73e9cb05750d2 Mon Sep 17 00:00:00 2001 From: Artjoms Iskovs Date: Mon, 20 Dec 2021 12:28:39 +0000 Subject: [PATCH 2/2] Speed up release workflow Split building docs, wheel and the engine image into separate jobs that we can choose to skip (especially the slow Asciicast recording which we currently don't use) --- .ci/build_docs.sh | 13 +++++++ .ci/{build_artifacts.sh => build_wheel.sh} | 1 - .../workflows/build_and_test_and_release.yml | 34 +++++++++++++------ 3 files changed, 37 insertions(+), 11 deletions(-) create mode 100755 .ci/build_docs.sh rename .ci/{build_artifacts.sh => build_wheel.sh} (93%) diff --git a/.ci/build_docs.sh b/.ci/build_docs.sh new file mode 100755 index 00000000..f1b16610 --- /dev/null +++ b/.ci/build_docs.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +CI_DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) +REPO_ROOT_DIR="${CI_DIR}/.." + +source "$HOME"/.poetry/env + +pushd "$REPO_ROOT_DIR" \ + && poetry run "$CI_DIR"/prepare_doc_bundle.sh \ + && popd \ + && exit 0 + +exit 1 diff --git a/.ci/build_artifacts.sh b/.ci/build_wheel.sh similarity index 93% rename from .ci/build_artifacts.sh rename to .ci/build_wheel.sh index 1ee9f4ca..3fc88053 100755 --- a/.ci/build_artifacts.sh +++ b/.ci/build_wheel.sh @@ -18,7 +18,6 @@ pushd "$REPO_ROOT_DIR" \ && poetry config http-basic.testpypi splitgraph "$PYPI_PASSWORD" \ && poetry config http-basic.pypi splitgraph "$PYPI_PASSWORD" \ && poetry build \ - && poetry run "$CI_DIR"/prepare_doc_bundle.sh \ && popd \ && exit 0 diff --git a/.github/workflows/build_and_test_and_release.yml b/.github/workflows/build_and_test_and_release.yml index 3277e604..e837645e 100644 --- a/.github/workflows/build_and_test_and_release.yml +++ b/.github/workflows/build_and_test_and_release.yml @@ -80,27 +80,41 @@ jobs: run: | source "$HOME"/.poetry/env poetry run coveralls --service=github - - name: "Build doc / Asciicast bundle and push out Docker engine (tags only)" - if: "startsWith(github.ref, 'refs/tags/')" + - name: "Push out Docker engine (tags only)" + if: "startsWith(github.ref, 'refs/tags/') && !contains(github.event.head_commit.message, '[skip engine]')" + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + run: | + echo "Uploading engine image to Docker Hub" + ./.ci/push_engine.sh + - name: "Build doc / Asciicast bundle" + if: "startsWith(github.ref, 'refs/tags/') && !contains(github.event.head_commit.message, '[skip docs]')" env: SG_DEMO_KEY: ${{ secrets.SG_DEMO_KEY }} SG_DEMO_SECRET: ${{ secrets.SG_DEMO_SECRET }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - # We could split this out into a separate stage but it would mean installing Poetry, Compose and this package all over again. run: | echo "Building Asciicast/doc bundle" export PATH=$PATH:$(readlink -f $DBT_VENV/bin) - ./.ci/build_artifacts.sh - echo "Uploading engine image to Docker Hub" - ./.ci/push_engine.sh + ./.ci/build_docs.sh + cp ./install.sh dist + # TODO figure out if we want to do poetry upload here (can only do once, so will fail + # if we're retrying an upload) + # "$HOME"/.poetry/bin/poetry build + - name: "Build and publish wheel" + if: "startsWith(github.ref, 'refs/tags/') && !contains(github.event.head_commit.message, '[skip wheel]')" + env: + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + # We could split this out into a separate stage but it would mean installing Poetry, Compose and this package all over again. + run: | + ./.ci/build_wheel.sh cp ./install.sh dist - # TODO figure out if we want to do poetry upload here + # TODO figure out if we want to do poetry upload here (can only do once, so will fail + # if we're retrying an upload) # "$HOME"/.poetry/bin/poetry build - # Currently upload is commented out since it's once-only and we love - # republishing v0.1.0 for now. - # "$HOME"/.poetry/bin/poetry publish -r testpypi - name: "Upload release artifacts" uses: actions/upload-artifact@v2 with: