Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #2364 by adding a Github workflow for checking dead links #2406

Merged
merged 9 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Markdown Link Checking
on:
pull_request:
push:
branches:
- "master"

jobs:
check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes' # show only broken links
use-verbose-mode: 'yes'
config-file: .github/workflows/markdown-links-config.json # for removing any false positives
22 changes: 22 additions & 0 deletions .github/workflows/markdown-links-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"ignorePatterns": [
{
"pattern": "^http://localhost"
},
{
"pattern": "^https://twitter.com/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

@SahibYar SahibYar Jul 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we don't add this, our workflow will always fail because

curl --verbose --location 'https://twitter.com/awalterschulze/status/1584553056100057088'

My Github action was showing error like this

FILE: ./CHANGELOG.md
[✖] https://github.com/libp2p/go-libp2p/blob/master/p2p/net/swarm/grafana-dashboards/swarm.json → Status: 404
[✖] https://github.com/libp2p/go-libp2p/blob/master/p2p/host/eventbus/grafana-dashboards/eventbus.json → Status: 404
[✖] https://twitter.com/awalterschulze/status/1584553056100057088 → Status: 0 Error: Exceeded maxRedirects. Probably stuck in a redirect loop https://twitter.com/awalterschulze/status/1584553056100057088
    at Redirect.onResponse (/usr/local/lib/node_modules/markdown-link-check/node_modules/request/lib/redirect.js:98:27)
    at Request.onRequestResponse (/usr/local/lib/node_modules/markdown-link-check/node_modules/request/request.js:986:22)
    at ClientRequest.emit (node:events:513:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:701:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at TLSSocket.socketOnData (node:_http_client:542:22)
    at TLSSocket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)

132 links checked.

ERROR: 3 dead links found!
[✖] https://github.com/libp2p/go-libp2p/blob/master/p2p/net/swarm/grafana-dashboards/swarm.json → Status: 404
[✖] https://github.com/libp2p/go-libp2p/blob/master/p2p/host/eventbus/grafana-dashboards/eventbus.json → Status: 404
[✖] https://twitter.com/awalterschulze/status/[158](https://github.com/SahibYar/go-libp2p/actions/runs/5433440994/jobs/9881111425#step:4:159)4553056100057088 → Status: 0

Details: gaurav-nelson/github-action-markdown-link-check#182 (comment)

Copy link
Collaborator

@MarcoPolo MarcoPolo Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Twitter links are auth-walled so there's no way to check if the link works

},
{
"pattern": "^https://opensource.org/"
}
],
"aliveStatusCodes": [200],
"httpHeaders": [
{
"urls": ["https://docs.github.com/"],
"headers": {
"Accept-Encoding": "*"
}
}
]
}
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ Fix some test-utils used by https://github.com/libp2p/go-libp2p-kad-dht
### Metrics <!-- omit in toc -->

We've started instrumenting the entire stack. In this release, we're adding metrics for:
* the swarm: tracking incoming and outgoing connections, transports, security protocols and stream multiplexers in use: (https://github.com/libp2p/go-libp2p/blob/master/p2p/net/swarm/grafana-dashboards/swarm.json)
* the event bus: tracking how different events are propagated through the stack and to external consumers (https://github.com/libp2p/go-libp2p/blob/master/p2p/host/eventbus/grafana-dashboards/eventbus.json)
* the swarm: tracking incoming and outgoing connections, transports, security protocols and stream multiplexers in use: (https://github.com/libp2p/go-libp2p/blob/master/dashboards/swarm/swarm.json)
* the event bus: tracking how different events are propagated through the stack and to external consumers (https://github.com/libp2p/go-libp2p/blob/master/dashboards/eventbus/eventbus.json)

Our metrics effort is still ongoing, see https://github.com/libp2p/go-libp2p/issues/1356 for progress. We'll add metrics and dashboards for more libp2p components in a future release.

Expand Down
2 changes: 1 addition & 1 deletion examples/multipro/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Protocol Multiplexing using rpc-style protobufs with libp2p

This example shows how to use protobufs to encode and transmit information between libp2p hosts using libp2p Streams.
This example expects that you are already familiar with the [echo example](https://github.com/libp2p/go-libp2p-examples/tree/master/echo).
This example expects that you are already familiar with the [echo example](https://github.com/libp2p/go-libp2p/tree/master/examples/echo).

## Build

Expand Down
2 changes: 1 addition & 1 deletion test-plans/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ of these nodes with the other version's interop test.
# Running all interop tests locally with Compose

To run this test against all released libp2p versions you'll need to have the
(libp2p/test-plans)[https://github.com/libp2p/test-plans] checked out. Then do
[libp2p/test-plans](https://github.com/libp2p/test-plans) checked out. Then do
the following (from the root directory of this repository):

1. Build the image: `docker build -t go-libp2p-head -f test-plans/PingDockerfile .`.
Expand Down