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

Fix and update link-check #2954

Merged
merged 3 commits into from
Oct 25, 2021
Merged

Fix and update link-check #2954

merged 3 commits into from
Oct 25, 2021

Conversation

rogermparent
Copy link
Contributor

@rogermparent rogermparent commented Oct 21, 2021

Context: #2932

This PR fixes the odd failures that are happening on PRs by using fetch-depth: 0 on the checkout action, allowing full access to all branches' git history and allowing so we can do a proper github-like diff that doesn't include origin/master changes that have happened since the PR in question.

Separately, this PR upgrades link-check to a new version that uses a small change that uses a single command of git diff origin/master...HEAD instead of a two-step merge-base and diff. Functionally the same thing (probably didn't need a minor bump, just a patch, but oh well we're still in 0.x.x), just more simple and elegant- the only reason we didn't do it before is I wasn't aware of triple-dot syntax. I tested this new version a couple times to make sure it doesn't just break everything, and it works fine.

One big caveat is that merging master (or any Gatsby 3 commit) into our current Gatsby 2 PRs that currently have this issue will cause caching havoc that needs manual intervention to be remedied. I can do so for PRs that really need it, but I'd suggest using local link-check instead since everyone probably has full commit history locally and it should work. At least we'll have it solved for the future!

@shcheklein shcheklein temporarily deployed to dvc-org-link-check-chec-ydiyat October 21, 2021 23:12 Inactive
@rogermparent rogermparent force-pushed the link-check-checkout-deep branch from 37c7a61 to 94597c9 Compare October 22, 2021 01:38
@rogermparent rogermparent temporarily deployed to dvc-org-link-check-chec-ydiyat October 22, 2021 01:38 Inactive
@rogermparent
Copy link
Contributor Author

rogermparent commented Oct 22, 2021

Tested on #2932, this fixes the link-check problem because origin/master was inaccessible without it under some circumstances and accessible in others. I don't know the exact circumstances because cloud is a nightmare to debug- maybe it just had to be multiple commits in and then the shallow copy cut it off?

@rogermparent rogermparent reopened this Oct 22, 2021
@shcheklein shcheklein temporarily deployed to dvc-org-link-check-chec-zxukwh October 22, 2021 22:28 Inactive
@rogermparent rogermparent temporarily deployed to dvc-org-link-check-chec-zxukwh October 22, 2021 23:14 Inactive
@rogermparent rogermparent changed the title Do a non-shallow checkout on link-check deploy Fix and update deploy link-check Oct 23, 2021
@rogermparent rogermparent changed the title Fix and update deploy link-check Fix and update link-check Oct 23, 2021
@@ -21,7 +23,7 @@ jobs:
status: queued
- name: Run Link Check
id: check
uses: iterative/link-check.action@v0.8
uses: iterative/link-check.action@v0.9
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Next update I should sync up the action version tag and the NPM version, this can get a little confusing.

@@ -79,7 +79,7 @@
"react-use": "^14.0.0",
"rehype-react": "^6.2.1",
"remark-preset-lint-recommended": "^5.0.0",
"repo-link-check": "^0.7.1",
"repo-link-check": "^0.8.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This just applies to the local CLI script.

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Oct 24, 2021

Thanks @rogermparent ! Looks good i.e. I'd approve but

merging master (or any Gatsby 3 commit) into our current Gatsby 2 PRs that currently have this issue will cause caching havoc that needs manual intervention to be remedied

That sounds scary haha. No matter when we merge this there will be several PRs open that may require merging master to solve conflicts. Are you suggesting we just ignore the CI link-checker for those?

@rogermparent
Copy link
Contributor Author

Are you suggesting we just ignore the CI link-checker for those?

I was thinking of that on the CI level, but maybe we can get a decent mid-ground fix by just cherry-picking this commit into the PRs that need it, especially since only one line is actually needed to patch the problem. I can look into that today.

@rogermparent
Copy link
Contributor Author

Just did a retroactive update on the existing PRs that have the problem- without a full master merge, they don't require manual intervention and we get CI results from link-check!

git checkout link-check-checkout-deep .github/workflows/link-check-deploy.yml && git commit -am "Fix link-check" && git push have been run on all the PRs that I saw having an issue. There's probably others that just happen not to be having an issue right now, in which case the same command can be run with no other intervention needed.

Beyond that, once this is merged we shouldn't run into the same issue in the future.

Copy link
Contributor

@julieg18 julieg18 left a comment

Choose a reason for hiding this comment

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

Looks good!

@rogermparent rogermparent merged commit dcb2492 into master Oct 25, 2021
@rogermparent rogermparent deleted the link-check-checkout-deep branch October 25, 2021 19:00
@rogermparent rogermparent mentioned this pull request Oct 28, 2021
1 task
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.

4 participants