-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
ci: added a link-check ci #297
Conversation
Thanks for your contribution! =] I think this is blocked by #295 If we merged this before actually fixing links, it would block PRs till the bad links are fixed, I think. |
Lets wait for #295 to be solved |
Hey, I am not sure if linkinator is the right tool for checking broken links for our use-case. |
reason will be appreciated @DarhkVoyd |
Hey @Relequestual can you review it made some changes here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving in the right direction. Made a few comments for change. Thanks for your continued effort on this work! =D
@Relequestual made some changes a review will be appreciated and left some comment in the code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We very close. Nice job!
Left some comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I havent tested it but looks good to me.
Thank you for your changes, @utnim2. To ensure that the - name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive Checkout this for more details : #297 (comment) |
- name: Build Next.js App | ||
run: yarn build | ||
|
||
- name: Serve App Locally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to remove this steps and add this to linkchecker job as we need our app to run locally so that linkchecker can do it job.
- name: Serve App Locally | |
Remove this step |
Here no need to run app locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I too agree with you regarding to need to build and deploy locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review @aialok
no we need to first build and deploy it here and pass the deployed url in the linkchecker action (i have put localhost:3000 as of now)
The deploy step is missing here as the deployment is not yet clear
Got it man. But I still have one doubt what do you mean by deploy locally. Deploy locally means running on localhost?
Thank you @utnim2. You have done pretty good job : )
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add steps to run our app locally, as we need it to run locally since most of our links are based on localhost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@utnim2 , See Comment : )
With reference to this comment : #297 (comment) I think we do already deploy our app on cloudflare. @utnim2 @DarhkVoyd |
Please refer to #297 (comment) |
My Bad...Got it : ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @benjagm @utnim2 @aialok
This PR was quite difficult and posed some challenges during review. So, please bear with me if I make some mistakes and I appreciate your patience as I worked through it. Below are my findings, change requests, and suggestions:
- We should consider either merging the two jobs or rebuilding and serving the website again in the second job to address post-action cleanup in the workflow.
- Despite the expected downtime of our served website due to post-cleanup actions, the initial job fails to serve the website. The current workflow experiences a silent failure in the first job due to a command not found error when serving the website.
Upon investigation, it appears that theserve
package, utilized in ourpackage.json
for local website deployment, is missing from our dependencies. This absence is the root cause of the deployment failure. To resolve this issue, we must ensure the inclusion of theserve
package in our dependencies. - Given that we use
localhost
as the base for our action, we need to define which files should be considered part of the action. Because, I am not sure if all markdown file references are served on our website this ensures we avoid unnecessary errors. - In my testing of the workflow, I found several broken links. To prevent workflow failure, I suggest creating a separate issue to address these broken links before merging this pull request. The broken links may be related to unnecessary files from submodules or other issues discussed in point 4. We might also use
.lycheeignore
to ignore certain URIs or URLs.
Thank you for your patience. For a more detailed overview of my changes, please visit this link.
- name: Wait for App to Start | ||
run: sleep 20 | ||
|
||
linkChecker: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing jobs runs post action cleanup in workflow which closes all of our node processes from previous step which includes the one serving the site on local host. So, we should either build and serve again or simply merge them into a single job.
@DarhkVoyd thanks for you review |
Can you add your opinion @Relequestual |
Can we just validate the external links for now and leave the internal ones for a second iteration? |
An alternative approach can be pause this effort to validate broken links in deployment time, to use a different approach to have a crawler finding broken links every X days. For example: https://github.com/marketplace/actions/broken-links-crawler Specifically I like this approach: https://andrewwegner.com/find-broken-links-with-github-actions.html |
utnim2, |
Great review! Thanks, @DarhkVoyd. I've gone through your workflow, and everything looks good to me. However, I noticed that we are checking links of Other than this, everything looks good to me. @benjagm, your solution is also a good way to handle things. Happy coding! |
aialok,
benjagm,
This is another great solution, however we might still end up with our pursuit of errors related to external and internal links. |
I too agree with this |
I'm not concerned much about external links, as they can be broken any time. I'm much more concerned about internal links. We should avoid introducing changes which cause internal links to break. That should be our primary objective here (at least to me). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid checking the node_modules
folder =] .
Is it possible to only check internal links?
I don't mind also checking external links, but I don't think it's as needed or the intent of the Issue.
So i need to modify the action so that it checks only for external links right? |
What Ben was saying is check only internal but the problem with internal links but as we have been discussing this approach seems to not work for the specific type of architecture and stack of this site. |
Closing this as there was not activity for the last weeks. |
Fixes #103
follow up to #291