gaurav-nelson / github-action-markdown-link-check

Check all links in markdown files if they are alive or dead. πŸ”—βœ”οΈ
MIT License
403 stars 77 forks source link

🧐 Detects working links as not working for danielecook/Awesome-Bioinformatics #76

Closed tgotwig closed 3 years ago

tgotwig commented 3 years ago

Hello there πŸ™‹β€β™‚οΈ

This Action doesn't work very well with https://github.com/TGotwig/Awesome-Bioinformatics/tree/patch-2

The output is sometimes quite random from run to run and has always working links showing as not working πŸ€”

 ERROR: 25 dead links found!
[βœ–] http://nextflow.io β†’ Status: 0
[βœ–] https://software.broadinstitute.org/gatk β†’ Status: 403
[βœ–] https://github.com/arq5x/bedtools2 β†’ Status: 429
[βœ–] https://github.com/adamewing/bamsurgeon β†’ Status: 429
[βœ–] https://github.com/lh3/wgsim β†’ Status: 429
[βœ–] https://github.com/teamdfir/sift β†’ Status: 429
[βœ–] https://github.com/pcingola/SnpEff β†’ Status: 429
[βœ–] https://github.com/brentp/cruzdb β†’ Status: 429
[βœ–] https://github.com/openvax/pyensembl β†’ Status: 429
[βœ–] https://github.com/cokelaer/bioservices β†’ Status: 429
[βœ–] https://github.com/arq5x/cyvcf β†’ Status: 429
[βœ–] https://github.com/jamescasbon/PyVCF β†’ Status: 429
[βœ–] https://github.com/brentp/cyvcf2 β†’ Status: 429
[βœ–] https://github.com/daler/pybedtools β†’ Status: 429
[βœ–] https://github.com/arq5x/bedtools β†’ Status: 429
[βœ–] https://github.com/mdshw5/pyfaidx β†’ Status: 429
[βœ–] https://github.com/pysam-developers/pysam β†’ Status: 429
[βœ–] https://github.com/Lab41/squiggle β†’ Status: 429
[βœ–] https://github.com/dasmoth/dalliance β†’ Status: 429
[βœ–] https://github.com/biojs/biojs β†’ Status: 429
[βœ–] http://biojs.net/ β†’ Status: 0
[βœ–] https://github.com/jonathancrabtree/Circleator β†’ Status: 429
[βœ–] https://github.com/drio/dnaism β†’ Status: 429
[βœ–] https://github.com/igvteam/igv β†’ Status: 429
[βœ–] http://watson.nci.nih.gov/cran_mirror/web/packages/RCircos/index.html β†’ Status: 0

What it should look like:

 ERROR: 2 dead links found!
[βœ–] http://biojs.net/ β†’ Status: 522
[βœ–] http://watson.nci.nih.gov/cran_mirror/web/packages/RCircos/index.html β†’ Status: 
gaurav-nelson commented 3 years ago

Thanks @TGotwig GitHub (and some other sites) return a Status: 429: Too Many Requests

To fix this, just accept the status 429 as alive, use the config-file option and specify the following in your mlc_config.json file:

{
  "aliveStatusCodes":[200, 206, 429]
}
gaurav-nelson commented 3 years ago

@TGotwig before you try that, just re-run the check again, I've updated the markdown-link-check dependency to the latest version and that might resolve the issue. Please confirm if it does, otherwise try the solution in my previous comment. :+1:

tgotwig commented 3 years ago

Ahh yeah makes sense!

So now I still get:

ERROR: 4 dead links found!
[βœ–] http://nextflow.io β†’ Status: 0
[βœ–] https://software.broadinstitute.org/gatk β†’ Status: 403
[βœ–] http://biojs.net/ β†’ Status: 0
[βœ–] http://watson.nci.nih.gov/cran_mirror/web/packages/RCircos/index.html β†’ Status: 0

Hmm the first two are working fine πŸ€”

gaurav-nelson commented 3 years ago

@TGotwig looks correct to me.

tgotwig commented 3 years ago

This gif proves that the first two are working 🧐 But yeah sometimes the second one loads very slow 🐌

ezgif-3-095319eb7dd6

gaurav-nelson commented 3 years ago

Thanks @TGotwig for the GIF. I still can't reach out to http://nextflow.io. Maybe ignore these domains if you think they are working.

{
    "ignorePatterns": [
        {
            "pattern": "^http://nextflow.io",
            "pattern": ".*(broadinstitute.org).*"
        }
    ]
}
tgotwig commented 3 years ago

Hmm maybe this is country specific or so, thanks for the tip with ignorePatterns πŸ‘

tgotwig commented 3 years ago

Because of ignorePatterns, why are there two keys with the same name pattern? Wouldn't it be better when passing raw strings into ignorePatterns?

With that I still get:

ERROR: 3 dead links found!
[βœ–] http://nextflow.io β†’ Status: 0
[βœ–] http://biojs.net/ β†’ Status: 0
[βœ–] http://watson.nci.nih.gov/cran_mirror/web/packages/RCircos/index.html β†’ Status: 0
gaurav-nelson commented 3 years ago

PS: https://github.com/gaurav-nelson/github-action-markdown-link-check#too-many-requests

Its an issue with the underlying library.