Skip to content

Upgrade link-check to 0.12 - #271

Merged
rogermparent merged 4 commits into
masterfrom
link-check-0.12
Jul 22, 2022
Merged

rogermparent merged 4 commits into
masterfrom
link-check-0.12

Conversation

@rogermparent

@rogermparent rogermparent commented Jul 19, 2022 •

Copy link
Copy Markdown
Contributor

See treeverse/dvc.org#3700 for more info

This will need some improvements, but solves a lot of issues as-is

@rogermparent
rogermparent requested a review from a team July 19, 2022 14:38
@rogermparent rogermparent self-assigned this Jul 19, 2022
@shcheklein
shcheklein temporarily deployed to cml-dev-link-check-0-12-zphj4p July 19, 2022 14:38 Inactive
@rogermparent
rogermparent temporarily deployed to cml-dev-link-check-0-12-zphj4p July 19, 2022 14:51 Inactive
@github-actions

github-actions Bot commented Jul 19, 2022 •

Copy link
Copy Markdown

Link Check Report

There were no links to check!

@rogermparent
rogermparent temporarily deployed to cml-dev-link-check-0-12-zphj4p July 19, 2022 15:25 Inactive
@@ -0,0 +1,12 @@
module.exports = async ({ github, context }) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

given this is used only in one place, is it better to inline it in the yml file instead?

@rogermparent rogermparent Jul 20, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The only real reason to keep this separate was so that linters and such can more easily read the js used for the action than they could for js inside a yaml string.
It's also currently duplicated across all the sites which isn't ideal, I'm happy to hear any suggestions for a better implementation because it's going to need one soon.

@casperdcl casperdcl Jul 21, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if it's used a lot across repos, it sounds worth creating a separate actions repo? Something like https://github.com/iterative/get-pr-number. Then usage would be:

- id: pr-number
  uses: iterative/get-pr-number@v1
...
- run: echo ${{ steps.pr-number.outputs.result }}

Or we could have a mono-repo for actions (https://github.com/iterative/actions):

- id: pr-number
  uses: iterative/actions/get-pr-number@v1
...
- run: echo ${{ steps.pr-number.outputs.result }}

(vis. https://github.com/int128/typescript-actions-monorepo/tree/main/hello-world)

body-includes: "<h1 id=\"link-check\">Link Check Report</h1>"

- name: Create or update comment
uses: peter-evans/create-or-update-comment@v2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@iterative/cml if this action can update a comment without a user-provided PAT, why can't cml?

@rogermparent rogermparent Jul 20, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The one thing I could see in the code is that create-or-update-comment gets its octokit through @actions/github's core.getOctokit while CML's GitHub driver gets it through @octokit/rest's Octokit constructor, seemingly in order to add the throttling plugin.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@casperdcl Different kinds of comments, comment on a commit vs comment on a pr?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Different kinds of comments

if that's the issue (a commit-comment requires less perms than pr-comment) then shouldn't --pr should fallback to commit-comment + warning rather than just failing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's an action that creates commit comments which, if the docs are to be believed can also take the GHA token

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rogermparent
rogermparent temporarily deployed to cml-dev-link-check-0-12-zphj4p July 21, 2022 19:25 Inactive

@yathomasi yathomasi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good on my end.

This branch was previously deployed

1 inactive deployment
cml-dev-link-check-0-12-zphj4p — 6066035d Deployed Jul 21, 2022 by rogermparent
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.

5 participants