From 8160a1b893f5f53e60c942509612afa830533c58 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Thu, 11 Jun 2020 19:10:04 +0200 Subject: [PATCH 01/16] fix: typo in docs --- docs/source/tutorial/tutorial02.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/tutorial/tutorial02.rst b/docs/source/tutorial/tutorial02.rst index 732834c..5d5b32e 100644 --- a/docs/source/tutorial/tutorial02.rst +++ b/docs/source/tutorial/tutorial02.rst @@ -47,7 +47,7 @@ What have we done? **Senior** Looks good to me, clean and simple, and it is a very good idea to use ``GET`` - here as it wont change anything in the server. Let's restart *Kapow!* and try it. + here as it won't change anything in the server. Let's restart *Kapow!* and try it. **Junior** From 87ec20519aebadcc9bd636d9366a1a6516d768b5 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Thu, 11 Jun 2020 19:14:32 +0200 Subject: [PATCH 02/16] fix: typo in docs --- docs/source/tutorial/tutorial04.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/tutorial/tutorial04.rst b/docs/source/tutorial/tutorial04.rst index 609a7f2..f6e4677 100644 --- a/docs/source/tutorial/tutorial04.rst +++ b/docs/source/tutorial/tutorial04.rst @@ -56,7 +56,7 @@ I Need my Report! **Junior** - And why *Susan* can't ``ssh`` into the server herself to see all of this? + And why can't *Susan* ``ssh`` into the server herself to see all of this? **Senior** From 09b6d5448789e630351f1598c51ad01381a9a1cd Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Thu, 11 Jun 2020 19:45:57 +0200 Subject: [PATCH 03/16] doc: wording and style fixes --- docs/source/examples/working_with_pow_files.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/source/examples/working_with_pow_files.rst b/docs/source/examples/working_with_pow_files.rst index 8110fa2..145104b 100644 --- a/docs/source/examples/working_with_pow_files.rst +++ b/docs/source/examples/working_with_pow_files.rst @@ -99,15 +99,14 @@ source. In fact, a `pow` file is just a regular shell script. Debugging scripts ----------------- -Kapow! redirect standard output and standard error of the pow file given on server -startup to its own standard output and error, so you can use ``set -x`` at the beginning -of the script in order to be able to see all the commands expanded and usethat information -for debugging. +Since *Kapow!* redirects the standard output and the standard error of the `pow` +file given on server startup to its own, you can leverage ``set -x`` to see the +commands that are being executed, and use that for debugging. -In order to be able to debug user request executions, the server subcommand has -a ``--debug`` option flag that redirects the script standard output and standard error -to Kapow! standard output, so you can use ``set -x`` at the beginning of the script -the same way as in pow files. +To support debugging user request executions, the server subcommand has a +``--debug`` option flag that prompts `Kapow!` to redirect both the script's +standard output and standard error to `Kapow!`'s standard output, so you can +leverage ``set -x`` the same way as with `pow` files. .. code-block:: console From 77b358e3c87499d6a3756000f6f71a4e2faa1eb0 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Thu, 11 Jun 2020 19:48:47 +0200 Subject: [PATCH 04/16] doc: style fixes --- docs/source/examples/working_with_pow_files.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/examples/working_with_pow_files.rst b/docs/source/examples/working_with_pow_files.rst index 145104b..2d43501 100644 --- a/docs/source/examples/working_with_pow_files.rst +++ b/docs/source/examples/working_with_pow_files.rst @@ -104,8 +104,8 @@ file given on server startup to its own, you can leverage ``set -x`` to see the commands that are being executed, and use that for debugging. To support debugging user request executions, the server subcommand has a -``--debug`` option flag that prompts `Kapow!` to redirect both the script's -standard output and standard error to `Kapow!`'s standard output, so you can +``--debug`` option flag that prompts *Kapow!* to redirect both the script's +standard output and standard error to *Kapow!*'s standard output, so you can leverage ``set -x`` the same way as with `pow` files. From a311da0d873dcd0413e14f5f872bf15b2cb33c13 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Thu, 11 Jun 2020 20:04:11 +0200 Subject: [PATCH 05/16] doc: drop shebang lines in .pow files For now, Kapow! treats .pow files as shell scripts, not executables. See https://github.com/BBVA/kapow/issues/62 --- docs/source/examples/working_with_pow_files.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/source/examples/working_with_pow_files.rst b/docs/source/examples/working_with_pow_files.rst index 2d43501..8343f4b 100644 --- a/docs/source/examples/working_with_pow_files.rst +++ b/docs/source/examples/working_with_pow_files.rst @@ -84,8 +84,6 @@ whole thing documented in one html file, served with *Kapow!*. :linenos: $ cat index.pow - #!/usr/bin/env bash - kapow route add / - <<-'EOF' cat howto.html | kapow set /response/body EOF @@ -112,8 +110,6 @@ leverage ``set -x`` the same way as with `pow` files. .. code-block:: console $ cat withdebug.pow - #!/usr/bin/env bash - kapow route add / - <<-'EOF' set -x echo "This will be seen in the log" From 2b56e0ea275c60b8453a3beba229788265bc0911 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 12 Jun 2020 09:40:16 +0200 Subject: [PATCH 06/16] chore: add GitHub Actions "Test" workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Héctor Hurtado --- .github/workflows/test.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7b1e4cc --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,21 @@ +name: Test + +on: + push: + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Lint + uses: golangci/golangci-lint-action@v1 + with: + version: v1.27 + + - name: Build + run: | + make test race build + + - name: Spec test + run: | + docker run --mount type=bind,source=$(pwd)/build/kapow,target=/usr/local/bin/kapow bbvalabsci/kapow-spec-test-suite:latest behave --tags=~@skip From 17e473ab455f4fbe900e7260638e009374307185 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 12 Jun 2020 10:02:59 +0200 Subject: [PATCH 07/16] chore: try to fix lint run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Héctor Hurtado --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7b1e4cc..aa8bd97 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,7 @@ jobs: uses: golangci/golangci-lint-action@v1 with: version: v1.27 + working-directory: kapow - name: Build run: | From 598856b9cadac4931465b6b35a5fcf58514e3045 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 12 Jun 2020 10:06:39 +0200 Subject: [PATCH 08/16] chore: try to fix lint run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Héctor Hurtado --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aa8bd97..a90c0fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: uses: golangci/golangci-lint-action@v1 with: version: v1.27 - working-directory: kapow + working-directory: kapow/kapow - name: Build run: | From b91a5ac998419a120f56cf73abe86a63fa5ada83 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 12 Jun 2020 10:09:51 +0200 Subject: [PATCH 09/16] chore: add missing actions/checkout to workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Héctor Hurtado --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a90c0fc..8c0bd68 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,11 +7,12 @@ jobs: build: runs-on: ubuntu-20.04 steps: + - uses: action/checkout@v2 + - name: Lint uses: golangci/golangci-lint-action@v1 with: version: v1.27 - working-directory: kapow/kapow - name: Build run: | From b44c3b465820ed064272e8b6973dc3749d67b2a0 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 12 Jun 2020 10:11:02 +0200 Subject: [PATCH 10/16] chore: fix path to action in workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Héctor Hurtado --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c0bd68..19db4c9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: build: runs-on: ubuntu-20.04 steps: - - uses: action/checkout@v2 + - uses: actions/checkout@v2 - name: Lint uses: golangci/golangci-lint-action@v1 From 307e348b62605d158b22d211f0a9808d279d1888 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 12 Jun 2020 12:48:06 +0200 Subject: [PATCH 11/16] chore: update test badge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No longer using CircleCI for this, but GitHub Actions. Co-authored-by: Héctor Hurtado --- README.md | 2 +- docs/source/index.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 288aea1..9d6b54a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Kapow! Logo

If you can script it, you can HTTP it.

- Test status + Test status Go Report Open Issues Documentation diff --git a/docs/source/index.rst b/docs/source/index.rst index 8f53bb2..2014648 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,8 +1,8 @@ Welcome to *Kapow!* =================== -.. image:: https://circleci.com/gh/BBVA/kapow/tree/master.svg?style=svg - :target: https://circleci.com/gh/BBVA/kapow/tree/master +.. image:: https://github.com/BBVA/kapow/workflows/Test/badge.svg + :target: https://github.com/BBVA/kapow/actions?query=workflow%3ATest .. image:: https://goreportcard.com/badge/github.com/bbva/kapow :target: https://goreportcard.com/report/github.com/bbva/kapow .. image:: https://img.shields.io/github/issues/BBVA/kapow From 9da4b4b91d0a56e40346bccbff7223ea3c288263 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 12 Jun 2020 13:06:14 +0200 Subject: [PATCH 12/16] doc: fix dangling link Fixes #111 --- docs/source/tutorial/tutorial02.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/source/tutorial/tutorial02.rst b/docs/source/tutorial/tutorial02.rst index 5d5b32e..817613d 100644 --- a/docs/source/tutorial/tutorial02.rst +++ b/docs/source/tutorial/tutorial02.rst @@ -21,9 +21,8 @@ What have we done? **Junior** - Got it! There're a - `lot of resources to work with `_, I see that we - can write to the response. Do you think this will work for us? + Got it! There're a :ref:`lot of resources to work with `_. + I see that we can write to the response. Do you think this will work for us? **Senior** From c04f89bdc574c528afa055e52d3caeea9377ff2b Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 12 Jun 2020 13:15:00 +0200 Subject: [PATCH 13/16] doc: drop spurious underscore --- docs/source/tutorial/tutorial02.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/tutorial/tutorial02.rst b/docs/source/tutorial/tutorial02.rst index 817613d..3f52bd2 100644 --- a/docs/source/tutorial/tutorial02.rst +++ b/docs/source/tutorial/tutorial02.rst @@ -21,7 +21,7 @@ What have we done? **Junior** - Got it! There're a :ref:`lot of resources to work with `_. + Got it! There're a :ref:`lot of resources to work with `. I see that we can write to the response. Do you think this will work for us? **Senior** From edeafdd881e18a1984fc4417b38ef45c7bb9bf8e Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 12 Jun 2020 13:20:44 +0200 Subject: [PATCH 14/16] doc: fix reference --- docs/source/tutorial/tutorial02.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/tutorial/tutorial02.rst b/docs/source/tutorial/tutorial02.rst index 3f52bd2..24cc043 100644 --- a/docs/source/tutorial/tutorial02.rst +++ b/docs/source/tutorial/tutorial02.rst @@ -21,7 +21,7 @@ What have we done? **Junior** - Got it! There're a :ref:`lot of resources to work with `. + Got it! There're a :ref:`lot of resources to work with `. I see that we can write to the response. Do you think this will work for us? **Senior** From 2e5e11cc47b723afc1fd0a7a08fad96e53285be3 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Tue, 16 Jun 2020 11:23:47 +0200 Subject: [PATCH 15/16] doc: fix typo --- docs/source/concepts/resource_tree.rst | 2 +- spec/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/concepts/resource_tree.rst b/docs/source/concepts/resource_tree.rst index 50dd3e1..53f3c3f 100644 --- a/docs/source/concepts/resource_tree.rst +++ b/docs/source/concepts/resource_tree.rst @@ -21,7 +21,7 @@ Overview / │ ├─ request - │ ├──── method Used HTTP Method (GET, POST) + │ ├──── method HTTP Method used (GET, POST) │ ├──── host Host part of the URL │ ├──── path Complete URL path (URL-unquoted) │ ├──── matches diff --git a/spec/README.md b/spec/README.md index 64bf21b..c200f0c 100644 --- a/spec/README.md +++ b/spec/README.md @@ -424,7 +424,7 @@ following resource paths: / The root of the resource paths tree │ ├─ request All information related to the HTTP request. Read-Only -│ ├──── method Used HTTP Method (GET, POST) +│ ├──── method HTTP Method used (GET, POST) │ ├──── host Host part of the URL │ ├──── path Complete URL path (URL-unquoted) │ ├──── matches Previously matched URL path parts From 94f1e7e6eac23614a1775f60c7731eec9aedb1d4 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Fri, 26 Jun 2020 13:30:17 +0200 Subject: [PATCH 16/16] chore: leverage panchoh/go-bump action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Héctor Hurtado --- .github/versions/go | 1 + .github/workflows/go-bump.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/release.yml | 8 +++++--- 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 .github/versions/go create mode 100644 .github/workflows/go-bump.yml diff --git a/.github/versions/go b/.github/versions/go new file mode 100644 index 0000000..4ea8ad8 --- /dev/null +++ b/.github/versions/go @@ -0,0 +1 @@ +1.14.3 diff --git a/.github/workflows/go-bump.yml b/.github/workflows/go-bump.yml new file mode 100644 index 0000000..e6ee17e --- /dev/null +++ b/.github/workflows/go-bump.yml @@ -0,0 +1,29 @@ +name: Bump Go + +on: + schedule: + - cron: 00 7 * * * + + push: + branches: + - master + +jobs: + go-bump: + + runs-on: ubuntu-20.04 + + steps: + - name: Clone current repo + uses: actions/checkout@v2 + + - name: Bump Go + id: go-bump + uses: panchoh/go-bump@master + + - name: Create pull request + uses: peter-evans/create-pull-request@v2 + with: + title: ${{ steps.go-bump.outputs.pr-title }} + commit-message: ${{ steps.go-bump.outputs.pr-title }} + branch: ${{ steps.go-bump.outputs.branch-name }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7794600..ca1214a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,6 @@ on: tags: - v*.*.* -env: - GO_VERSION: 1.14.4 - jobs: build: @@ -18,6 +15,11 @@ jobs: with: fetch-depth: 0 + - name: Load Go version + id: go-version + run: | + echo "::set-env name=GO_VERSION::$(tr -d '\n' < .github/versions/go)" + - uses: actions/setup-go@v2 with: go-version: ${{ env.GO_VERSION }}