Skip to content

Conversation

aidankmcalister
Copy link
Member

@aidankmcalister aidankmcalister commented Oct 15, 2025

Summary by CodeRabbit

  • Chores
    • Added automated link validation that runs on pull requests to scan markdown content.
    • Produces a formatted Lychee report and posts or updates it as a PR comment.
    • Workflow fails when broken links are detected and includes caching, retry and timeout behavior for robustness.
    • Updated the reporting/commenting approach and added a dedicated report formatting step.

Copy link
Contributor

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

Copy link
Contributor

coderabbitai bot commented Oct 15, 2025

Walkthrough

Adds a new GitHub Actions workflow .github/workflows/lychee.yml that runs on pull_request, checks links using lycheeverse/lychee-action@v2 from the content directory (with fail: false), formats the Lychee report, posts it as a PR comment, and fails the job when broken links are detected.

Changes

Cohort / File(s) Summary
CI workflow: Lychee link checker
.github/workflows/lychee.yml
New PR-triggered workflow on ubuntu-latest with pull-requests: write; checks out the repo, runs lycheeverse/lychee-action@v2 with fail: false, output: ../lychee/out.md, many args (cache, --max-cache-age 3h, --verbose, --no-progress, --accept 200,201,204,304,403,429, --timeout 20, --max-retries 5, --retry-wait-time 5, --max-concurrency 16, multiple --exclude patterns, targets ./**/*.md and ./**/*.mdx), workingDirectory: "content", and env: GITHUB_TOKEN; creates lychee/formatted.md by prepending a header and stripping the original top-level "Summary" header from lychee/out.md; posts the formatted report to the PR using peter-evans/create-or-update-comment@v4; final step fails the job if Lychee reported broken links (non-zero exit code).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "DC-5259 Added Lychee Link Checker" directly reflects the main change in the pull request, which is the addition of a new GitHub Actions workflow that implements Lychee Link Checker for checking broken links in markdown files. The title is concise, clear, and specific enough that a teammate scanning the PR history would immediately understand the primary change being introduced. The ticket reference (DC-5259) is a standard organizational prefix and does not constitute noise like emojis or vague terms.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c6d1045 and 19887ad.

📒 Files selected for processing (1)
  • .github/workflows/lychee.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/lychee.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: runner / linkspector
  • GitHub Check: Check internal links
  • GitHub Check: Cloudflare Pages

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

Copy link

cloudflare-workers-and-pages bot commented Oct 15, 2025

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 19887ad
Status: ✅  Deploy successful!
Preview URL: https://b30a377e.docs-51g.pages.dev
Branch Preview URL: https://dc-5259-lychee-link-checker.docs-51g.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/lychee.yml (1)

2-2: Consider adding manual and scheduled triggers.

Add workflow_dispatch and a weekly schedule to catch rot outside PRs.

-on: [pull_request]
+on:
+  pull_request:
+  workflow_dispatch:
+  schedule:
+    - cron: '0 6 * * 1' # Mondays 06:00 UTC
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b40389e and b886e14.

📒 Files selected for processing (1)
  • .github/workflows/lychee.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Check internal links
  • GitHub Check: runner / linkspector
  • GitHub Check: Cloudflare Pages

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
.github/workflows/lychee.yml (1)

18-23: Lychee configuration is incomplete; missing output handling and action steps to surface results.

The lychee action step (lines 13-18) is missing critical configuration that prevents broken links from being properly tracked:

  • Missing output configuration: No format or output specified, so lychee won't produce the report file needed for result tracking
  • Missing token: No token configured; adding ${{ secrets.GITHUB_TOKEN }} improves rate limits on GitHub links
  • No issue creation or failure steps: The permissions already grant issues: write (as noted in the comment), suggesting these steps were intended but are missing
  • Missing error handling: No continue-on-error or downstream steps to fail the workflow when broken links are found

The workflow currently runs lychee with fail: false and no output file, meaning broken links are silently ignored.

Add the missing configuration and steps to complete the workflow:

      - name: Lychee Link Checker
        id: lychee
        uses: lycheeverse/lychee-action@v2
+       continue-on-error: true
        with:
          args: --base-url dist --exclude-all-private dist
          fail: false
+         token: ${{ secrets.GITHUB_TOKEN }}
+         format: markdown
+         output: ./lychee/out.md
+
+     - name: Create Issue From File
+       if: ${{ steps.lychee.outputs.exit_code != 0 && github.event.pull_request.head.repo.fork == false }}
+       uses: peter-evans/create-issue-from-file@v5
+       with:
+         title: Link Checker Report
+         content-filepath: ./lychee/out.md
+
+     - name: Fail workflow if broken links found
+       if: ${{ steps.lychee.outputs.exit_code != 0 }}
+       run: exit 1
🧹 Nitpick comments (1)
.github/workflows/lychee.yml (1)

25-42: Commented Linkspector alternative can be cleaned up or kept as reference.

The commented-out Linkspector workflow is complete and functional, but since the Lychee approach is being pursued, you may consider either removing it (once Lychee workflow is finalized and tested) or keeping it as documentation for a potential future alternative.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d1c5be6 and c73c151.

📒 Files selected for processing (1)
  • .github/workflows/lychee.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Check internal links
  • GitHub Check: runner / linkspector
🔇 Additional comments (1)
.github/workflows/lychee.yml (1)

1-16: Workflow structure and build step look good.

The job setup, permissions configuration, and build step are correctly configured. The issues: write permission is necessary and properly included.

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 21, 2025
@aidankmcalister
Copy link
Member Author

@CodeRabbit pause

Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

✅ Actions performed

Reviews paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/lychee.yml (1)

71-73: Use explicit expression syntax for consistency.

The condition on line 72 uses shorthand syntax if: steps.lychee.outputs.exit_code != 0. For consistency with GitHub Actions best practices and the explicit ${{ }} syntax used elsewhere in the file, prefer the explicit expression syntax.

Apply this diff:

       - name: 🚫 Fail if broken links found
-        if: steps.lychee.outputs.exit_code != 0
+        if: ${{ steps.lychee.outputs.exit_code != 0 }}
         run: exit ${{ steps.lychee.outputs.exit_code }}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 59f21d8 and c6d1045.

📒 Files selected for processing (1)
  • .github/workflows/lychee.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: runner / linkspector

@aidankmcalister
Copy link
Member Author

@CodeRabbit pause

@prisma prisma deleted a comment from github-actions bot Oct 21, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 21, 2025
@prisma prisma deleted a comment from github-actions bot Oct 21, 2025
@prisma prisma deleted a comment from github-actions bot Oct 21, 2025
@prisma prisma deleted a comment from github-actions bot Oct 21, 2025
Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

✅ Actions performed

Reviews paused.

@aidankmcalister
Copy link
Member Author

@CodeRabbit resume

Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

✅ Actions performed

Reviews resumed.

@prisma prisma deleted a comment from github-actions bot Oct 21, 2025
@prisma prisma deleted a comment from github-actions bot Oct 21, 2025
Copy link
Contributor

🍈 Lychee Link Check Report

Automated link validation — All links in documentation have been checked for availability.

Note: Links are cached for 6 hours to avoid unnecessary requests.

📊 Results Overview

Status Count
🔍 Total 2416
✅ Successful 2324
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 91
❓ Unknown 0
🚫 Errors 0
⛔ Unsupported 1
Full Github Actions output

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.

1 participant