diff --git a/.circleci/config.yml b/.circleci/config.yml index efacf47f1..6484d4458 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,48 +20,48 @@ commands: add-github-auth: steps: - run: git config --global url."https://moleculacorp:${GITHUB_PERSONAL_ACCESS_TOKEN}@github.com".insteadOf "https://github.com" + restore-mod-cache: + steps: + - restore_cache: + key: mod-cache-{{ checksum "go.sum" }} + save-mod-cache: + steps: + - save_cache: + key: mod-cache-{{ checksum "go.sum" }} + paths: + - /go/pkg/mod/ + checkout-plus: + steps: + - add-github-auth + - checkout + - restore-mod-cache jobs: setup: executor: name: golang steps: - - add-github-auth - - checkout - - restore_cache: - keys: - - mod-cache-{{ checksum "go.sum" }} - - run: "go mod download" - - save_cache: - key: mod-cache-{{ checksum "go.sum" }} - paths: - - /go/pkg/mod/ - - persist_to_workspace: - root: . - paths: "*" + - checkout-plus + - run: go mod download + - save-mod-cache check-license-headers: executor: name: golang steps: - - attach_workspace: - at: . + - checkout-plus - run: make check-license-headers linter: executor: name: golang steps: - - attach_workspace: - at: . - - add-github-auth + - checkout-plus - run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/local/bin v1.23.8 - run: make golangci-lint test-build-arm: executor: name: golang steps: - - attach_workspace: - at: . - - add-github-auth + - checkout-plus - run: make build GOOS=linux GOARCH=arm GOARM=5 - run: make build GOOS=linux GOARCH=arm GOARM=6 - run: make build GOOS=linux GOARCH=arm GOARM=7 @@ -91,9 +91,7 @@ jobs: version: << parameters.golang_version >> resource_class: << parameters.resource_class >> steps: - - attach_workspace: - at: . - - add-github-auth + - checkout-plus - run: sudo apt-get install lsof - run: command: make << parameters.test_make_target >> SHARD_WIDTH=<< parameters.shard_width >> GOARCH=<< parameters.goarch >> @@ -102,18 +100,14 @@ jobs: executor: name: golang steps: - - attach_workspace: - at: . - - add-github-auth + - checkout-plus - setup_remote_docker - run: make clustertests-build prerelease: executor: name: golang steps: - - attach_workspace: - at: . - - add-github-auth + - checkout-plus - run: make prerelease - store_artifacts: path: build @@ -124,6 +118,7 @@ jobs: executor: name: golang steps: + - checkout-plus - attach_workspace: at: . - run: make release @@ -136,6 +131,7 @@ jobs: docker: - image: circleci/python:2.7-jessie steps: + - checkout-plus - attach_workspace: at: . - run: sudo pip install awscli @@ -144,10 +140,7 @@ jobs: executor: name: golang steps: - - checkout - - attach_workspace: - at: . - - add-github-auth + - checkout-plus - setup_remote_docker - run: make docker - run: docker login -u $DOCKER_USER -p $DOCKER_PASS @@ -156,10 +149,7 @@ jobs: executor: name: golang steps: - - checkout - - attach_workspace: - at: . - - add-github-auth + - checkout-plus - setup_remote_docker - run: make docker - run: docker login -u $DOCKER_USER -p $DOCKER_PASS @@ -170,6 +160,7 @@ workflows: build: jobs: - setup: + context: molecula filters: tags: only: /^v.*/ diff --git a/executor.go b/executor.go index f2dd49fcb..c54ad6d8d 100644 --- a/executor.go +++ b/executor.go @@ -3125,11 +3125,19 @@ func (e *executor) executeSetRow(ctx context.Context, indexName string, c *pql.C // Merge returned results at coordinating node. reduceFn := func(ctx context.Context, prev, v interface{}) interface{} { - val := v.(bool) - if prev == nil { + val, ok := v.(bool) + if !ok { + return errors.Errorf("executeSetRow.reduceFn: val is non-bool (%+v)", v) + } + if val { return val } - return val || prev.(bool) + + pval, ok := prev.(bool) + if !ok { + return errors.Errorf("executeSetRow.reduceFn: prev is non-bool (%+v)", prev) + } + return pval } result, err := e.mapReduce(ctx, indexName, shards, c, opt, mapFn, reduceFn)