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.
    • Generates a formatted link report and posts or updates it as a PR comment.
    • Workflow fails when broken links are detected and includes caching, retries, timeouts and concurrency controls for robustness.
    • Reporting/commenting flow revised and a dedicated report formatting step added.

@github-actions
Copy link
Contributor

Dangerous URL check

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

@coderabbitai
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, runs Lychee 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 and concurrency per PR; 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, multiple --exclude patterns, --timeout 20, --max-retries 5, --retry-wait-time 5, --max-concurrency 16) targeting ./content/**/*.md and ./content/**/*.mdx with workingDirectory: "content" and env: GITHUB_TOKEN; creates lychee/formatted.md by prepending a header and removing 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 the Lychee step exit code indicates broken links.

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 pull request title "DC-5259 Added Lychee Link Checker" directly and clearly describes the main change in the changeset: the addition of a new GitHub Actions workflow file that implements Lychee Link Checker for automated link validation. The title is concise, specific, and avoids vague terminology, making it clear to teammates scanning the history that Lychee Link Checker functionality was added. The inclusion of the ticket reference "DC-5259" follows common team conventions and does not diminish the clarity of the actual change description.
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 19887ad and 44e3675.

📒 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: Check internal links
  • GitHub Check: runner / linkspector
  • GitHub Check: Cloudflare Pages

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

@github-actions
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.

@cloudflare-workers-and-pages
Copy link

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

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6b117ef
Status: ✅  Deploy successful!
Preview URL: https://7c326566.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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

✅ Actions performed

Reviews paused.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

✅ Actions performed

Reviews paused.

@aidankmcalister
Copy link
Member Author

@CodeRabbit resume

@coderabbitai
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
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 21, 2025
@github-actions
Copy link
Contributor

🍈 Lychee Link Check Report

Note: Links are cached for 3 hours to avoid unnecessary requests, and speed up consecutive runs.

📊 Results Overview

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

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

🍈 Lychee Link Check Report

Note: Links are cached for 3 hours to avoid unnecessary requests, and speed up consecutive runs.

📊 Results Overview

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

@aidankmcalister aidankmcalister merged commit 4afe5e1 into main Oct 22, 2025
7 checks passed
@aidankmcalister aidankmcalister deleted the DC-5259-lychee-link-checker branch October 22, 2025 14:51
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.

3 participants