Skip to content

Commit

Permalink
Switch to use github action to check links in markdown (thanos-io#3106)
Browse files Browse the repository at this point in the history
Signed-off-by: Xiang Dai <[email protected]>
  • Loading branch information
daixiang0 authored Sep 21, 2020
1 parent 6fa6b4a commit a11b790
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 36 deletions.
6 changes: 0 additions & 6 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ $(JSONNETFMT): .bingo/jsonnetfmt.mod
@echo "(re)installing $(GOBIN)/jsonnetfmt-v0.16.0"
@cd .bingo && $(GO) build -modfile=jsonnetfmt.mod -o=$(GOBIN)/jsonnetfmt-v0.16.0 "github.com/google/go-jsonnet/cmd/jsonnetfmt"

LICHE := $(GOBIN)/liche-v0.0.0-20200229003944-f57a5d1c5be4
$(LICHE): .bingo/liche.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/liche-v0.0.0-20200229003944-f57a5d1c5be4"
@cd .bingo && $(GO) build -modfile=liche.mod -o=$(GOBIN)/liche-v0.0.0-20200229003944-f57a5d1c5be4 "github.com/raviqqe/liche"

MINIO := $(GOBIN)/minio-v0.0.0-20200527010300-cccf2de129da
$(MINIO): .bingo/minio.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
Expand Down
13 changes: 0 additions & 13 deletions .bingo/liche.mod

This file was deleted.

2 changes: 0 additions & 2 deletions .bingo/variables.env
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ JSONNET="${gobin}/jsonnet-v0.16.0"

JSONNETFMT="${gobin}/jsonnetfmt-v0.16.0"

LICHE="${gobin}/liche-v0.0.0-20200229003944-f57a5d1c5be4"

MINIO="${gobin}/minio-v0.0.0-20200527010300-cccf2de129da"

PROMETHEUS_ARRAY="${gobin}/prometheus-v2.4.3+incompatible${gobin}/prometheus-v1.8.2-0.20200724121523-657ba532e42f"
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check Markdown links

on:
push:
branches:
- master
tags:
pull_request:

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
config-file: '.github/workflows/links_config.json'
34 changes: 34 additions & 0 deletions .github/workflows/links_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"ignorePatterns": [
{
"pattern": "^https://github.com"
},
{
"pattern": "^http://127.0.0.1"
},
{
"pattern": "^http://localhost"
},
{
"pattern": "^https://couchdb.apache.org"
},
{
"pattern": "^https://cloud.tencent.com"
},
{
"pattern": "^https://alibabacloud.com"
},
{
"pattern": "^https://zoom.us"
},
{
"pattern": "^https://goreportcard.com"
}
],
"replacementPatterns": [
{
"pattern": "^/",
"replacement": "file:///github/workspace/"
}
]
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This document explain the process of contributing to the Thanos project.

First of all please follow the [CODE_OF_CONDUCT](https://github.com/thanos-io/thanos/blob/master/CODE_OF_CONDUCT.md) in all your interactions with the project.
First of all please follow the [CODE_OF_CONDUCT](/CODE_OF_CONDUCT.md) in all your interactions with the project.

## Thanos Philosophy

Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,10 @@ docs: $(EMBEDMD) build

.PHONY: check-docs
check-docs: ## checks docs against discrepancy with flags, links, white noise.
check-docs: $(EMBEDMD) $(LICHE) build
check-docs: $(EMBEDMD) build
@echo ">> checking docs generation"
@EMBEDMD_BIN="$(EMBEDMD)" SED_BIN="$(SED)" THANOS_BIN="$(GOBIN)/thanos" scripts/genflagdocs.sh check
@echo ">> checking links (DISABLED for now)"
# TODO(bwplotka): Fix it!
#@time $(LICHE) --recursive docs --exclude "(couchdb.apache.org/bylaws.html|cloud.tencent.com|alibabacloud.com|zoom.us)" --document-root .
#@time $(LICHE) --exclude "goreportcard.com|github.com" --document-root . *.md # We have to block checking GitHub as we are often rate-limited from GitHub Actions.
@find . -type f -name "*.md" | SED_BIN="$(SED)" xargs scripts/cleanup-white-noise.sh
$(call require_clean_work_tree,'run make docs and commit changes')

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/how-to-contribute-to-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Why?
* Links works on GitHub
* Links works on website
* Markdown plugins works as expected (e.g IDE integrations)
* We use liche to test links.
* We use markdown-link-check to test links

## Sections/Menu

Expand Down
10 changes: 5 additions & 5 deletions docs/governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It is meant to be followed by all the developers of the Thanos project and the T
* **Maintainers Team**: A core Thanos team that have owner access to http://github.com/thanos-io organization and all projects within it. Current list is available [here][maintainers-doc].

* **Triage Team**: Contributors who does not belong to Maintainer's team, but has `Triage` GitHub role on [Thanos](https://github.com/thanos-io/thanos) repository allowing to change GitHub issues and PRs statuses and labels.
They are listed [here](https://thanos.io/tip/thanos/maintainers/#triage).
They are listed [here](https://thanos.io/tip/thanos/maintainers.md/#triage).

* **The Thanos project**: The sum of all activities performed under the [thanos-io organization on GitHub][gh], concerning one or more repositories or the community.

Expand Down Expand Up @@ -78,7 +78,7 @@ Upon death of a member, their Triage team membership ends automatically.
### Technical decisions

Smaller technical decisions are made informally and [lazy consensus](#consensus) is assumed. Technical decisions that span multiple parts of the Thanos project
should be discussed and made on the [GitHub issues][issues] and in most cases followed by proposal as described [here](https://thanos.io/tip/contributing/contributing/#adding-new-features-components).
should be discussed and made on the [GitHub issues][issues] and in most cases followed by proposal as described [here](/CONTRIBUTING.md#adding-new-features--components).

Decisions are usually made by [lazy consensus](#consensus). If no consensus can be reached, the matter may be resolved by [majority vote](#majority-vote).

Expand Down Expand Up @@ -169,7 +169,7 @@ It's about number of up votes to agree on the decision.

### How do I propose a decision?

See [Contributor doc](https://thanos.io/tip/contributing/contributing/#adding-new-features-components)
See [Contributor doc](/CONTRIBUTING.md#adding-new-features--components)

### How do I become a team member?

Expand All @@ -183,7 +183,7 @@ Should the decision be in favor, your new membership will also be announced on t

As a team member, propose the new project on the [Thanos GitHub Issue][issues]. However, currently to maintain project in our organization you have to become Thanos Maintainers.

All are encourage to start their own project related to Thanos. Thanos team is happy to link to your poject in appriopriate page e.g https://thanos.io/tip/integrations.md/
All are encourage to start their own project related to Thanos. Thanos team is happy to link to your poject in appriopriate page e.g https://thanos.io/tip/thanos/integrations.md/

### How do I remove a Maintainer or Triage member?

Expand All @@ -202,7 +202,7 @@ For supermajority voting team has to wait for all answers.

[twitter]: https://twitter.com/ThanosMetrics
[issues]: https://github.com/thanos-io/thanos/issues
[maintainers-doc]: https://thanos.io/tip/thanos/maintainers/
[maintainers-doc]: https://thanos.io/tip/thanos/maintainers.md/
[team]: https://groups.google.com/forum/#!forum/thanos-io
[gh]: https://github.com/thanos-io
[charter]: https://www.cncf.io/about/charter/
Expand Down
4 changes: 2 additions & 2 deletions mixin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ $ jb update

#### Configure

This project is intended to be used as a library. You can extend and customize dashboards and alerting rules by creating for own generators, such as the generators ([alerts.jsonnet](alerts.jsonnet) and [dashboards.jsonnet](dashboards.jsonnet)) that are use to create [examples](../../examples). Default parameters are collected in [config.libsonnet](config.libsonnet), feel free to modify and generate your own definitons.
This project is intended to be used as a library. You can extend and customize dashboards and alerting rules by creating for own generators, such as the generators ([alerts.jsonnet](alerts.jsonnet) and [dashboards.jsonnet](dashboards.jsonnet)) that are use to create [examples](/examples). Default parameters are collected in [config.libsonnet](config.libsonnet), feel free to modify and generate your own definitons.

[embedmd]:# (config.libsonnet)
```libsonnet
Expand Down Expand Up @@ -152,7 +152,7 @@ You validate your structural correctness of your Prometheus [alerting rules](htt
$ make example-rules-lint
```

Check out [test.yaml](../../examples/alerts/tests.yaml) to add/modify tests for the mixin. To learn more about how to write test for Prometheus, check out [official documentation](https://www.prometheus.io/docs/prometheus/latest/configuration/unit_testing_rules/).
Check out [test.yaml](/examples/alerts/tests.yaml) to add/modify tests for the mixin. To learn more about how to write test for Prometheus, check out [official documentation](https://www.prometheus.io/docs/prometheus/latest/configuration/unit_testing_rules/).

You test alerts with:

Expand Down
2 changes: 1 addition & 1 deletion tutorials/katacoda/thanos/1-globalview/step2.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ In this step we will focus on `thanos sidecar`:
Sidecar as the name suggests should be deployed together with Prometheus. Sidecar has multiple features:
* It exposes Prometheus metrics as a common Thanos [StoreAPI](https://thanos.io/tip/integrations.md/#storeapi). StoreAPI
* It exposes Prometheus metrics as a common Thanos [StoreAPI](https://thanos.io/tip/thanos/integrations.md/#storeapi). StoreAPI
is a generic gRPC API allowing Thanos components to fetch metrics from various systems and backends.
* It is essentially in further long term storage options described in [next]() courses.
* It is capable to watch for configuration and Prometheus rules (alerting or recording) and notify Prometheus for dynamic reloads:
Expand Down
2 changes: 1 addition & 1 deletion tutorials/katacoda/thanos/1-globalview/step3.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ But before that, let's take a closer look at what the Querier component does:
## Querier

The Querier component (also called "Query") is essentially a vanilla PromQL Prometheus engine that fetches the data from any service
that implements Thanos [StoreAPI](https://thanos.io/tip/integrations.md/#storeapi). This means that Querier exposes the Prometheus HTTP v1 API to query the data in a common PromQL language.
that implements Thanos [StoreAPI](https://thanos.io/tip/thanos/integrations.md/#storeapi). This means that Querier exposes the Prometheus HTTP v1 API to query the data in a common PromQL language.
This allows compatibility with Grafana or other consumers of Prometheus' API.

Additionally, Querier is capable of deduplicating StoreAPIs that are in the same HA group. We will see how it
Expand Down

0 comments on commit a11b790

Please sign in to comment.