-
Notifications
You must be signed in to change notification settings - Fork 105
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[minor]: Add GitHub action to check broken links #403
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,4 @@ | |||
{ | |||
"aliveStatusCodes": [200, 206, 402], |
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.
Is it possible to do ranges? We prob want all 200's, all 300's, etc
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.
Based on my brief chat-gpt research it's not easily doable programatically. I just copied this from the main langgraph one so I assume someone smarter than me had a good reason for selecting these codes but idk
.github/workflows/link_check.yml
Outdated
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: "0 5 * * *" | ||
workflow_dispatch: |
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.
From the code below, it looks like you only want .ipynb
files, in that case do this
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 5 * * *" | |
workflow_dispatch: | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
paths: | |
- '**.ipynb' | |
workflow_dispatch: |
and no need for scheduling, just have it run in PRs and on commits to main
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.
Ah, unless this is because we want to have a recurring check. Prob makes sense. In that case ya keep the scheduling.
.github/workflows/link_check.yml
Outdated
run: | | ||
if [ "${{ github.event_name }}" == "schedule" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ] || ([ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref }}" == "refs/heads/main" ]); then | ||
echo "Running link check on all notebooks in examples directory..." | ||
yarn run pytest -v --check-links-ignore "https://(api|web)\.smith\.langchain\.com/.*" --check-links-ignore "https://x.com/.*" --check-links examples |
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.
Not sure where the pytest
yarn script is coming from. Maybe you forgot to commit a new dependency you added?
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.
also, is this --check-links-ignore "https://(api|web)\.smith\.langchain\.com/.*"
saying don't check langsmith links? If so, why?
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.
langsmith links stuff was copied over, not sure why but assume there was a reason. tried to fix the pytest stuff in next push
.github/workflows/link_check.yml
Outdated
run: | | ||
if [ "${{ github.event_name }}" == "schedule" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ] || ([ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref }}" == "refs/heads/main" ]); then |
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.
prob dont need this since we have the condition at the top which will only run this on a pr push, push to main, workflow dispatch, or scheduling
No description provided.