Skip to content

INTER-2911: Check docs links in CI - #126

Open
JuroUhlar wants to merge 4 commits into
mainfrom
INTER-2911-ci-docs-link-check
Open

JuroUhlar wants to merge 4 commits into
mainfrom
INTER-2911-ci-docs-link-check

Conversation

@JuroUhlar

@JuroUhlar JuroUhlar commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Context

INTER-2911 | docs-link-checker

Why

Broken links in the README, contributing guide, and source comments are now caught on every PR and push to main instead of being found by readers.

Things to note

  • README links to this repo's own files are now relative (./LICENSE etc.), so the check validates them against the PR's files instead of main. npm still renders them as GitHub links via the package repository field.
  • The checker only reads the listed files, so the generated CHANGELOG.md files are left out (the tool has no exclude syntax).
  • linkcheck.baseline.json ignores one false positive: the placeholder endpoint https://test/integration in a unit test.
  • The action is pinned to a commit SHA, like the other third-party actions in this repo's workflows.

Verification

Ran the pinned checker locally on the same globs: before the fix it reported 2 links to fix, after the fix and baseline it reports "No links to fix" (51 checked, 1 ignored by baseline). The new CI job has not been checked on GitHub yet.

Change outline

New workflow, runs on pull_request and push to main, with read-only contents permission:

.github/workflows/check-links.yml
  checkout -> fingerprintjs/docs-link-checker (baseline: linkcheck.baseline.json)
  files:
    README.md
    CONTRIBUTING.md
    projects/*/README.md
    projects/**/*.ts
    bin/**/*.{js,ts}

Link fix found by the first run (GitHub repo's default branch is main):

 projects/demo-angular15/server.ts
-  https://github.com/angular/universal/tree/master/modules/express-engine
+  https://github.com/angular/universal/tree/main/modules/express-engine

Baseline entry:

{ "href": "https://test/integration",
  "page": "projects/fingerprintjs-pro-angular/src/lib/fingerprint-angular.service.spec.ts",
  "reason": "Placeholder endpoint in a unit test, not a real URL" }

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements 100% 40/40
🟢 Branches 100% 5/5
🟢 Functions 100% 6/6
🟢 Lines 100% 37/37

Test suite run success

14 tests passing in 5 suites.

Report generated by 🧪jest coverage report action from 5a97d5e

Show full coverage report
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟢 All files 100 100 100 100
🟢  src 100 100 100 100
🟢   public-api.ts 100 100 100 100
🟢  src/lib 100 100 100 100
🟢   fingerprint.module.ts 100 100 100 100
🟢   fingerprint.providers.ts 100 100 100 100
🟢   fingerprint.service.ts 100 100 100 100
🟢   version.ts 100 100 100 100
🟢  src/lib/tokens 100 100 100 100
🟢   fingerprint-angular-settings-token.ts 100 100 100 100

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The link checker misses URLs in raw HTML and images, and resolves repository self-links against main rather than the PR tree.

2 open issues
What changed in this PR

Adds CI link checking for selected documentation and TypeScript files in the Angular SDK repository.

Changes:

  • Runs a commit-pinned link checker on pull requests and pushes to main, with read-only repository permissions.
  • Ignores one placeholder test URL through a baseline entry.
  • Corrects an Angular Universal URL in a source comment; runtime behavior is unchanged.
File Description
projects/​demo-angular15/​server.ts Corrects the branch in a documentation comment’s URL.
linkcheck.baseline.json Exempts the placeholder integration-test endpoint.
.github/​workflows/​check-links.yml Adds link checking for the selected documentation and source files.

Review effort: Balanced

Comment thread .github/workflows/check-links.yml Resolved
Comment thread .github/workflows/check-links.yml Resolved
Relative links are checked against the PR's own files, so a move or
delete that breaks one fails the PR. npm and pub.dev still render them
as GitHub links via the package's repository field.

Refs: INTER-2911

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The link-checking workflow misses source comments in bin, leaving an existing URL unchecked.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Include bin scripts in source-link checks

.github/​workflows/​check-links.yml:26

The source-file glob misses the existing source-comment link in bin/generate-version.js:4, so that URL can break without failing this job. Include the build/test scripts under bin as well, so source comments outside projects are checked as described.

1 resolved since last review

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR doesn't contain any changesets. If there are user-facing changes, don't forget to run:

pnpm exec changeset

to create a changeset.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The published README links to a demo path missing from the package, so the link breaks when opened locally.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Published README links to a file missing from the package

README.md:34

bin/copy_assets.sh copies this README into the published package, but the package does not contain projects/demo-angular21/src. The link therefore breaks when the bundled README is opened locally (for example, in an editor); npm's website rewrite does not help there. Please keep the checkout-relative link for CI but rewrite it to a GitHub URL in the published README, or include the target in the package.

Review effort: Balanced

@JuroUhlar

Copy link
Copy Markdown
Contributor Author

Re the README demo link in the published package: declining. The link works where people read this README, on GitHub and on npmjs.com (npm rewrites relative links to the repository URL). Opening the copy inside node_modules in an editor is the one place it breaks, and rewriting links in copy_assets.sh would add a build step for that case. ./LICENSE is copied into the package, so it works everywhere.

This branch has not been deployed

No deployments
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.

2 participants