From 223e6630a45b6b1e14bd2a1cb3a3a6d4b8842c4e Mon Sep 17 00:00:00 2001 From: Rahul De Date: Thu, 13 May 2021 12:27:13 +0200 Subject: [PATCH] [#102] fix pause logic, bump and optimize builds --- .github/workflows/ci.yml | 39 ++++------------------------ apiserver/resources/bob/api.yaml | 2 +- apiserver/src/apiserver/handlers.clj | 2 +- 3 files changed, 7 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac207658..9df1f0c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - name: "Prepare tools-deps" uses: "DeLaGuardo/setup-clojure@master" with: - cli: "1.10.3.814" + cli: "1.10.3.833" - name: "Apply Cache" uses: "actions/cache@v2" @@ -49,46 +49,17 @@ jobs: - name: "Setup Babashka" uses: "turtlequeue/setup-babashka@v1.2.1" with: - babashka-version: 0.3.5 - - - name: "Run end to end tests" - run: "make e2e" + babashka-version: 0.4.0 - name: "Build JARs" run: "make -j3 compile" - - name: "Collect Artifacts" - uses: "actions/upload-artifact@v2" - with: - name: "bob-jars" - path: | - entities/entities.jar - runner/runner.jar - apiserver/apiserver.jar - - build-and-push: - needs: "test" - runs-on: "ubuntu-latest" - - steps: - - name: "Checkout code" - uses: "actions/checkout@v2" - - - name: "Download Artifacts" - uses: "actions/download-artifact@v2" - with: - name: "bob-jars" - path: "artifacts" - - - name: "Move Docker images" - run: | - mv artifacts/entities/entities.jar entities/ && \ - mv artifacts/runner/runner.jar runner/ && \ - mv artifacts/apiserver/apiserver.jar apiserver/ - - name: "Build Docker images" run: "make -j3 docker-image" + - name: "Run end to end tests" + run: "make e2e" + - name: "Publish Docker images" if: github.ref == 'refs/heads/main' run: | diff --git a/apiserver/resources/bob/api.yaml b/apiserver/resources/bob/api.yaml index 80abf1fe..bfbee19e 100644 --- a/apiserver/resources/bob/api.yaml +++ b/apiserver/resources/bob/api.yaml @@ -343,7 +343,7 @@ paths: examples: success: value: - message: "Pipeline cannot be paused now. Try again when running or stop it." + message: "Pipeline cannot be paused/is already paused now. Try again when running or stop it." "/pipelines/unpause/groups/{group}/names/{name}/runs/{id}": post: diff --git a/apiserver/src/apiserver/handlers.clj b/apiserver/src/apiserver/handlers.clj index dc057a7d..744720ba 100644 --- a/apiserver/src/apiserver/handlers.clj +++ b/apiserver/src/apiserver/handlers.clj @@ -129,7 +129,7 @@ {{pipeline-info :path} :parameters db :db queue :queue}] - (if (not (pausable? db (:id pipeline-info))) + (if (and pause? (not (pausable? db (:id pipeline-info)))) (respond "Pipeline cannot be paused/is already paused now. Try again when running or stop it." 422) (exec #(publish queue (if pause?