From cedc73f416840eb7ef57262bfe7f1e4a35e71e98 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sat, 13 Jan 2024 20:07:44 +0800 Subject: [PATCH 1/4] ci: checks markdown for bad links Signed-off-by: Adrian Cole --- .github/workflows/test_markdown.yml | 30 +++++++++++++++++++++++++++++ README.md | 4 ++-- build-bin/README.md | 11 +++++++++-- build-bin/mlc_config.json | 10 ++++++++++ docker/README.md | 2 +- module/README.md | 2 +- 6 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/test_markdown.yml create mode 100644 build-bin/mlc_config.json diff --git a/.github/workflows/test_markdown.yml b/.github/workflows/test_markdown.yml new file mode 100644 index 00000000..9bf1aaeb --- /dev/null +++ b/.github/workflows/test_markdown.yml @@ -0,0 +1,30 @@ +# yamllint --format github .github/workflows/test_markdown.yml +--- +name: test_markdown + +# We test documentation-only commits. +on: + # We run tests on non-tagged pushes to master that aren't a commit made by the release plugin + push: + tags: '' + branches: master + paths: '**/*.md' + # We also run tests on pull requests targeted at the master branch. + pull_request: + branches: master + paths: '**/*.md' + +jobs: + test-markdown: + name: Test Markdown + runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish + if: "!contains(github.event.head_commit.message, 'maven-release-plugin')" + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Check Markdown links + uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + check-modified-files-only: 'yes' diff --git a/README.md b/README.md index f97a5246..a0a59294 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Api and all collector components. | Storage | Description | |--------------------------------------------|-----------------------------| -| [Stackdriver Trace](./storage/stackdriver) | Free cloud service provider | +| [Stackdriver Trace](./storage-stackdriver) | Free cloud service provider | ## Server integration In order to integrate with zipkin-server, you need to use properties @@ -79,7 +79,7 @@ $ STORAGE_TYPE=stackdriver STACKDRIVER_PROJECT_ID=zipkin-demo \ If you cannot use our [Docker image](./docker/README.md), you can still integrate yourself by downloading a couple jars. -[Here's an example](autoconfigure/storage-stackdriver#quick-start) of +[Here's an example](module/README.md#quick-start) of integrating Stackdriver storage. ## Troubleshooting diff --git a/build-bin/README.md b/build-bin/README.md index e7989226..27e0e883 100755 --- a/build-bin/README.md +++ b/build-bin/README.md @@ -5,8 +5,15 @@ This is a Maven+Docker project, which uses standard conventions for test and dep The Docker image for zipkin-gcp is a layer over zipkin, including only the [../module] and configuration settings. -[docker-compose-zipkin-gcp.xml] ensures GCP authentication works. It is not run on pull request, as -the required secure variable is only available on master push. +[docker-compose-zipkin-gcp.xml](docker-compose-zipkin-gcp.yml) ensures GCP authentication works. +It is not run on pull request, as the required secure variable is only available on master push. + +[mlc_config.json](mlc_config.json) is run by GitHub Action, but you can also run it locally, +assuming you installed markdown-link-check via NPM. + +```bash +$ find . -name \*.md |xargs markdown-link-check -c ./build-bin/mlc_config.json +``` [//]: # (Below here should be standard for all projects) diff --git a/build-bin/mlc_config.json b/build-bin/mlc_config.json new file mode 100644 index 00000000..969c9aa1 --- /dev/null +++ b/build-bin/mlc_config.json @@ -0,0 +1,10 @@ +{ + "ignorePatterns": [ + { + "pattern": "https://oss.sonatype.org/content/repositories/snapshots" + }, + { + "pattern": "http://localhost:9411/api/v[12]/spans" + } + ] +} \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index ab091145..07f7bbea 100644 --- a/docker/README.md +++ b/docker/README.md @@ -33,7 +33,7 @@ In docker, the following can also be set: ### Stackdriver -Stackdriver Configuration variables are detailed [here](../module/storage-stackdriver#configuration). +Stackdriver Configuration variables are detailed [here](../module/README.md#configuration). ## Building diff --git a/module/README.md b/module/README.md index ae6a98a4..062c4966 100644 --- a/module/README.md +++ b/module/README.md @@ -47,7 +47,7 @@ The Zipkin server can be further configured as described in the Configuration can be applied either through environment variables or an external Zipkin configuration file. The module includes default configuration that can be used as a -[reference](https://github.com/openzipkin/zipkin-gcp/tree/master/autoconfigure/storage-stackdriver/src/main/resources/zipkin-server-stackdriver.yml) +[reference](./src/main/resources/zipkin-server-gcp.yml) for users that prefer a file based approach. #### Environment Variables From 3b4a8233dc5fccd273d440639a9734fcb0850a88 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sat, 13 Jan 2024 20:27:30 +0800 Subject: [PATCH 2/4] actually use config Signed-off-by: Adrian Cole --- .github/workflows/test_markdown.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_markdown.yml b/.github/workflows/test_markdown.yml index 9bf1aaeb..31ab830b 100644 --- a/.github/workflows/test_markdown.yml +++ b/.github/workflows/test_markdown.yml @@ -25,6 +25,7 @@ jobs: - name: Check Markdown links uses: gaurav-nelson/github-action-markdown-link-check@v1 with: + config-file: './build-bin/mlc_config.json' use-quiet-mode: 'yes' use-verbose-mode: 'yes' check-modified-files-only: 'yes' From 31c723e11138d286d495b853c345f54dac9d5b92 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sat, 13 Jan 2024 20:33:41 +0800 Subject: [PATCH 3/4] eol before eof Signed-off-by: Adrian Cole --- build-bin/mlc_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-bin/mlc_config.json b/build-bin/mlc_config.json index 969c9aa1..8214cd5a 100644 --- a/build-bin/mlc_config.json +++ b/build-bin/mlc_config.json @@ -7,4 +7,4 @@ "pattern": "http://localhost:9411/api/v[12]/spans" } ] -} \ No newline at end of file +} From a4daf479ac38e990577ed04847b08541fd497c00 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sun, 14 Jan 2024 07:11:56 +0800 Subject: [PATCH 4/4] polish Signed-off-by: Adrian Cole --- .github/workflows/test_markdown.yml | 32 +++++++++++++++-------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test_markdown.yml b/.github/workflows/test_markdown.yml index 31ab830b..7b0a741a 100644 --- a/.github/workflows/test_markdown.yml +++ b/.github/workflows/test_markdown.yml @@ -2,22 +2,27 @@ --- name: test_markdown -# We test documentation-only commits. -on: - # We run tests on non-tagged pushes to master that aren't a commit made by the release plugin - push: - tags: '' - branches: master - paths: '**/*.md' - # We also run tests on pull requests targeted at the master branch. - pull_request: - branches: master - paths: '**/*.md' +on: # yamllint disable-line rule:truthy + push: # non-tagged pushes to master + branches: + - master + tags-ignore: + - '*' + paths: + - '**/*.md' + - ./build-bin/mlc_config.json + pull_request: # pull requests targeted at the master branch. + branches: + - master + paths: + - '**/*.md' + - ./build-bin/mlc_config.json jobs: test-markdown: name: Test Markdown - runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish + runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish + # skip commits made by the release plugin if: "!contains(github.event.head_commit.message, 'maven-release-plugin')" steps: - name: Checkout Repository @@ -26,6 +31,3 @@ jobs: uses: gaurav-nelson/github-action-markdown-link-check@v1 with: config-file: './build-bin/mlc_config.json' - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' - check-modified-files-only: 'yes'