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

GitHub Actions link checker #1619

Merged
merged 190 commits into from
Sep 22, 2020
Merged

GitHub Actions link checker #1619

merged 190 commits into from
Sep 22, 2020

Conversation

rogermparent
Copy link
Contributor

@rogermparent rogermparent commented Jul 23, 2020

GitHub Actions Link Checker

This PR introduces a big feature overhaul: A completely new JS-based link checker that runs in both GitHub Actions and the CLI!

You can find the new app's repo at https://github.com/iterative/link-check. It has a submodule for distributing the lambda-esque compiled action, but the source is all in the same repo.

This link checker primarily aims to solve two issues:

  • Root-relative links are checked against the deploy preview, not master (new links to files added in the same commit don't fail)
  • Initial request uses HEAD, but falls back to GET on 405 (affects towardsdatascience.com links, which are removed from the exclude list now)

These two features, if I understand correctly, make this PR fix #1000 barring any regressions

Output examples

This is my attempt to rig up our link checker to run on GitHub Actions after the deployment is finished.

Boy howdy do I hope this can be tested in a deploy preview.
@shcheklein shcheklein temporarily deployed to dvc-landing-gh-actions--0beant July 23, 2020 19:16 Inactive
@rogermparent
Copy link
Contributor Author

Seems like PR workflows do show up. Nice! No need for prod testing.

@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--0beant July 23, 2020 19:39 Inactive
This time I read the payload docs more carefully
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--0beant July 23, 2020 19:53 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--0beant July 23, 2020 20:08 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--0beant July 23, 2020 20:32 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--0beant July 23, 2020 20:52 Inactive
@rogermparent rogermparent changed the title GitHub Actions link checker: Attempt 1 GitHub Actions link checker Jul 23, 2020
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--0beant July 23, 2020 21:21 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--0beant July 23, 2020 21:44 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--0beant July 23, 2020 22:05 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--0beant July 24, 2020 06:17 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--0beant July 24, 2020 07:01 Inactive
I think this could be causing a bug with GH actions
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--0beant July 24, 2020 07:39 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--0beant July 24, 2020 08:12 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--5wy1ky September 12, 2020 00:23 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--5wy1ky September 12, 2020 00:49 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--5wy1ky September 14, 2020 01:02 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--5wy1ky September 14, 2020 02:12 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--5wy1ky September 14, 2020 02:34 Inactive
Seems there's no way around needing the deployment trigger, even if the job is
skipped on deployment.

The prefix can't be removed, but "Run" and "Report" are the most evocative names
I can think of for the suffixes
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--5wy1ky September 14, 2020 22:30 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--5wy1ky September 18, 2020 19:26 Inactive
@rogermparent
Copy link
Contributor Author

rogermparent commented Sep 18, 2020

Here's a copy of the latest changes!

  • Make "filesystem" the default source

  • Make Git Diff a simpler boolean option

  • Make exit code output a boolean option automatic

  • Update Check Action to 1.0

  • Rename "bottlenecks" to "linkOptions"

  • Use longhand --report-unused-patterns instead of -u

  • Improve documentation around --report-unused-patterns only Replace report-unused-patterns=only with boolean unused-patterns-only

  • use Commander over Minimist for extra features like auto-help

  • change all arguments to be consistently camelCase, even in CLI

  • change reportUnusedPatterns to boolean unusedPatternsOnly, default
    behavior is now to always report unused but otherwise be silent unless using
    this flag.

  • rename bottlenecks to linkOptions

  • change source into boolean diff, using diff source when true and FS otherwise

  • change exit code to always apply on CLI and GHA with CLI output mode

  • add configurable default minTime and maxConcurrent

  • all filePatternFiles options renamed to singular (PatternFile) because one
    file per is the only reasonable usage even though multiple can be used.

  • exitCode output is now an internal part of the program.

@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--5wy1ky September 18, 2020 19:45 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--5wy1ky September 18, 2020 20:09 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--5wy1ky September 18, 2020 23:10 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--5wy1ky September 22, 2020 02:08 Inactive
@rogermparent rogermparent temporarily deployed to dvc-landing-gh-actions--5wy1ky September 22, 2020 02:11 Inactive
@shcheklein shcheklein merged commit a73cd75 into master Sep 22, 2020
@shcheklein shcheklein deleted the gh-actions-link-check branch February 28, 2021 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scripts: link check improvements
2 participants